-
-
Notifications
You must be signed in to change notification settings - Fork 25
Add support for Curios 5.11.x+ #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8b550e4
Update conditional-mixin repositories and group.
Favorlock 224338b
Update author list and version to 1.11.0
Favorlock be7521f
Update gradle to 8.8, Loom to 1.7-SNAPSHOT, and Conditional Mixin to …
Favorlock cd862af
Initial efforts in updating compatibility for both curios 5.10- and 5…
Favorlock 30f1426
Update gradle to 8.8 (again)
Favorlock 69fc47b
Need to specify the exact signature to match for the V1 mixin.
Favorlock 9b17f68
chore: use `bin` gradle wrapper type
RubixDev 410b470
chore: can be a patch version
RubixDev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
.../src/main/java/de/rubixdev/inventorio/mixin/forge/curios/SPacketSyncModifiersMixinV1.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| package de.rubixdev.inventorio.mixin.forge.curios; | ||
|
|
||
| import de.rubixdev.inventorio.integration.curios.ICuriosContainer; | ||
| import de.rubixdev.inventorio.util.CuriosTester; | ||
| import me.fallenbreath.conditionalmixin.api.annotation.Condition; | ||
| import me.fallenbreath.conditionalmixin.api.annotation.Restriction; | ||
| import net.minecraft.client.network.ClientPlayerEntity; | ||
| import net.minecraft.entity.Entity; | ||
| import net.minecraft.entity.LivingEntity; | ||
| import org.objectweb.asm.Opcodes; | ||
| import org.spongepowered.asm.mixin.Mixin; | ||
| import org.spongepowered.asm.mixin.injection.At; | ||
| import org.spongepowered.asm.mixin.injection.Inject; | ||
| import org.spongepowered.asm.mixin.injection.Slice; | ||
| import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
| import top.theillusivec4.curios.api.type.capability.ICuriosItemHandler; | ||
| import top.theillusivec4.curios.common.network.server.sync.SPacketSyncModifiers; | ||
|
|
||
| @Restriction( | ||
| require = { | ||
| @Condition(value = "curios", versionPredicates = "(,5.11)"), | ||
| @Condition(type = Condition.Type.TESTER, tester = CuriosTester.class) } | ||
| ) | ||
| @Mixin(SPacketSyncModifiers.class) | ||
| public class SPacketSyncModifiersMixinV1 { | ||
| @Inject( | ||
| method = "lambda$handle$0(Ltop/theillusivec4/curios/common/network/server/sync/SPacketSyncModifiers;Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/entity/Entity;Ltop/theillusivec4/curios/api/type/capability/ICuriosItemHandler;)V", | ||
| at = @At(value = "JUMP", opcode = Opcodes.IFEQ, shift = At.Shift.BEFORE, ordinal = 0), | ||
| slice = @Slice( | ||
| from = @At( | ||
| value = "INVOKE", | ||
| target = "Lnet/minecraftforge/eventbus/api/IEventBus;post(Lnet/minecraftforge/eventbus/api/Event;)Z" | ||
| ) | ||
| ) | ||
| ) | ||
| private static void inventorioResetSlots( | ||
| SPacketSyncModifiers data, | ||
| LivingEntity livingEntity, | ||
| Entity entity, | ||
| ICuriosItemHandler handler, | ||
| CallbackInfo ci | ||
| ) { | ||
| if ( | ||
| entity instanceof ClientPlayerEntity player | ||
| && player.currentScreenHandler instanceof ICuriosContainer curiosContainer | ||
| ) { | ||
| curiosContainer.inventorio$resetSlots(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.