aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/utils/ClothRegistry.java
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-03-19 14:25:15 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-03-19 14:25:15 +0800
commitc2d28cbf7028ffed2f56169adbce3f03cc0c5b49 (patch)
tree4d96cb58c551255a08a3abde18b067174c1c1246 /src/main/java/me/shedaniel/rei/utils/ClothRegistry.java
parent032b88e7f3784753987e9fdbf11c33d620b76d65 (diff)
downloadRoughlyEnoughItems-c2d28cbf7028ffed2f56169adbce3f03cc0c5b49.tar.gz
RoughlyEnoughItems-c2d28cbf7028ffed2f56169adbce3f03cc0c5b49.tar.bz2
RoughlyEnoughItems-c2d28cbf7028ffed2f56169adbce3f03cc0c5b49.zip
v2.5 Beta
Diffstat (limited to 'src/main/java/me/shedaniel/rei/utils/ClothRegistry.java')
-rw-r--r--src/main/java/me/shedaniel/rei/utils/ClothRegistry.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/me/shedaniel/rei/utils/ClothRegistry.java b/src/main/java/me/shedaniel/rei/utils/ClothRegistry.java
index 247b33139..7e85cfab1 100644
--- a/src/main/java/me/shedaniel/rei/utils/ClothRegistry.java
+++ b/src/main/java/me/shedaniel/rei/utils/ClothRegistry.java
@@ -1,11 +1,13 @@
package me.shedaniel.rei.utils;
+import me.shedaniel.cloth.ClothInitializer;
import me.shedaniel.cloth.api.EventPriority;
import me.shedaniel.cloth.hooks.ClothHooks;
import me.shedaniel.rei.RoughlyEnoughItemsCore;
import me.shedaniel.rei.api.TabGetter;
import me.shedaniel.rei.client.RecipeHelperImpl;
import me.shedaniel.rei.client.ScreenHelper;
+import me.shedaniel.rei.gui.ContainerScreenOverlay;
import net.minecraft.client.gui.ContainerScreen;
import net.minecraft.client.gui.ingame.CreativePlayerInventoryScreen;
import net.minecraft.client.gui.widget.RecipeBookButtonWidget;
@@ -42,6 +44,14 @@ public class ClothRegistry {
ScreenHelper.getLastOverlay().drawOverlay(post.getMouseX(), post.getMouseY(), post.getDelta());
}
}, EventPriority.LOWEST);
+ ClothHooks.CLIENT_SCREEN_MOUSE_SCROLLED.registerListener(event -> {
+ if (event.getScreen() instanceof ContainerScreen && !(event.getScreen() instanceof CreativePlayerInventoryScreen)) {
+ ContainerScreenOverlay overlay = ScreenHelper.getLastOverlay();
+ if (ScreenHelper.isOverlayVisible() && ContainerScreenOverlay.getItemListOverlay().getListArea().contains(ClothInitializer.clientUtils.getMouseLocation()))
+ if (overlay.mouseScrolled(event.getMouseX(), event.getMouseY(), event.getAmount()))
+ event.setCancelled(true);
+ }
+ }, EventPriority.LOWEST);
}
}