diff options
| author | Unknown <shekwancheung0528@gmail.com> | 2019-01-09 22:40:49 +0800 |
|---|---|---|
| committer | Unknown <shekwancheung0528@gmail.com> | 2019-01-09 22:40:49 +0800 |
| commit | 8b89fff542fb941e209f0b25d3c6ea4f72518f70 (patch) | |
| tree | a8743148a17af29d1fdb4d345ecc562a52dd8396 | |
| parent | 376eabab786fdb5ce2a6324fc7d9738e871e125f (diff) | |
| download | RoughlyEnoughItems-2.0.0.30.tar.gz RoughlyEnoughItems-2.0.0.30.tar.bz2 RoughlyEnoughItems-2.0.0.30.zip | |
Fixes stuffv2.0.0.30
| -rwxr-xr-x | build.gradle | 2 | ||||
| -rwxr-xr-x | src/main/java/me/shedaniel/impl/REIRecipeManager.java | 1 | ||||
| -rw-r--r-- | src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java | 23 |
3 files changed, 16 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle index c11b7d3dd..d8882ed80 100755 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 archivesBaseName = "RoughlyEnoughItems" -version = "1.5.1-20" +version = "1.5.1-21" minecraft { } diff --git a/src/main/java/me/shedaniel/impl/REIRecipeManager.java b/src/main/java/me/shedaniel/impl/REIRecipeManager.java index edccce8ba..9ebfcf792 100755 --- a/src/main/java/me/shedaniel/impl/REIRecipeManager.java +++ b/src/main/java/me/shedaniel/impl/REIRecipeManager.java @@ -192,6 +192,7 @@ public class REIRecipeManager implements IRecipeManager { REIRecipeManager.instance().recipeManager = manager; Core.getListeners(IREIPlugin.class).forEach(IREIPlugin::registerCategories); Core.getListeners(IREIPlugin.class).forEach(IREIPlugin::registerRecipes); + Core.getListeners(IREIPlugin.class).forEach(IREIPlugin::registerSpecialGuiExclusion); } public void displayRecipesFor(ItemStack stack) { diff --git a/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java b/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java index 737f3c280..78389f51b 100644 --- a/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java +++ b/src/main/java/me/shedaniel/mixins/MixinCreativePlayerInventoryGui.java @@ -12,47 +12,52 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(CreativePlayerInventoryGui.class) public abstract class MixinCreativePlayerInventoryGui extends AbstractPlayerInventoryGui { @Shadow - public abstract int method_2469(); + protected abstract boolean doRenderScrollBar(); @Shadow - protected abstract boolean doRenderScrollBar(); + private static int selectedTab; public MixinCreativePlayerInventoryGui(Container container_1) { super(container_1); } @Inject(method = "keyPressed(III)Z", at = @At("HEAD"), cancellable = true) - public void keyPressed(int p_keyPressed_1_, int p_keyPressed_2_, int p_keyPressed_3_, CallbackInfoReturnable<Boolean> ci) { - if (method_2469() == ItemGroup.INVENTORY.getId()) - for(GuiKeyDown listener : Core.getListeners(GuiKeyDown.class)) - if (listener.keyDown(p_keyPressed_1_, p_keyPressed_2_, p_keyPressed_3_)) { + public void keyPressed(int a, int b, int c, CallbackInfoReturnable<Boolean> ci) { + if (selectedTab == ItemGroup.INVENTORY.getId()) + Core.getListeners(GuiKeyDown.class).forEach(guiKeyDown -> { + if (guiKeyDown.keyDown(a, b, c)) { ci.setReturnValue(true); ci.cancel(); return; } + }); } @Inject(method = "mouseScrolled(D)Z", at = @At("HEAD"), cancellable = true) public void mouseScrolled(double p_mouseScrolled_1_, CallbackInfoReturnable<Boolean> ci) { if (!this.doRenderScrollBar()) { - ci.setReturnValue(super.mouseScrolled(p_mouseScrolled_1_)); - ci.cancel(); + if (super.mouseScrolled(p_mouseScrolled_1_)) { + ci.setReturnValue(true); + ci.cancel(); + } } } @Inject(method = "mouseClicked(DDI)Z", at = @At("HEAD"), cancellable = true) public void mouseClicked(double double_1, double double_2, int int_1, CallbackInfoReturnable<Boolean> ci) { - if (method_2469() == ItemGroup.INVENTORY.getId() && REIRenderHelper.isGuiVisible()) + if (selectedTab == ItemGroup.INVENTORY.getId() && REIRenderHelper.isGuiVisible()) for(GuiClick guiClick : Core.getListeners(GuiClick.class)) if (guiClick.onClick((int) double_1, (int) double_2, int_1)) { ci.setReturnValue(true); ci.cancel(); + return; } } |
