diff options
| author | shedaniel <daniel@shedaniel.me> | 2021-05-16 16:14:14 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2021-05-16 16:14:14 +0800 |
| commit | 1c867f9d6e686c70c36b2f2b774fdee17211fa45 (patch) | |
| tree | 33e3ec70c398f677ad548c8db67a22da0ddfaf1d /runtime/src/main | |
| parent | a190ce5cf4dfbb5aa7ed60578f15af4d351ac7a4 (diff) | |
| download | RoughlyEnoughItems-1c867f9d6e686c70c36b2f2b774fdee17211fa45.tar.gz RoughlyEnoughItems-1c867f9d6e686c70c36b2f2b774fdee17211fa45.tar.bz2 RoughlyEnoughItems-1c867f9d6e686c70c36b2f2b774fdee17211fa45.zip | |
Fix #530
Diffstat (limited to 'runtime/src/main')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java index 6e37adb49..8112b7630 100644 --- a/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java +++ b/runtime/src/main/java/me/shedaniel/rei/RoughlyEnoughItemsCore.java @@ -27,6 +27,7 @@ import com.google.common.collect.Lists; import me.shedaniel.architectury.event.events.GuiEvent; import me.shedaniel.architectury.event.events.RecipeUpdateEvent; import me.shedaniel.architectury.event.events.client.ClientScreenInputEvent; +import me.shedaniel.architectury.hooks.ScreenHooks; import me.shedaniel.architectury.networking.NetworkManager; import me.shedaniel.architectury.platform.Platform; import me.shedaniel.architectury.registry.ReloadListeners; @@ -517,7 +518,8 @@ public class RoughlyEnoughItemsCore { GuiEvent.INIT_POST.register((screen, widgets, children) -> { REIHelperImpl.getInstance().setPreviousScreen(screen); if (ConfigObject.getInstance().doesDisableRecipeBook() && screen instanceof AbstractContainerScreen) { - widgets.removeIf(widget -> widget instanceof ImageButton && ((ImageButton) widget).resourceLocation.equals(recipeButtonTex)); + ScreenHooks.getButtons(screen).removeIf(widget -> widget instanceof ImageButton && ((ImageButton) widget).resourceLocation.equals(recipeButtonTex)); + children.removeIf(widget -> widget instanceof ImageButton && ((ImageButton) widget).resourceLocation.equals(recipeButtonTex)); } }); ClientScreenInputEvent.MOUSE_CLICKED_PRE.register((minecraftClient, screen, mouseX, mouseY, button) -> { |
