|
1 | 1 | package gregtech.client.utils; |
2 | 2 |
|
3 | 3 | import gregtech.api.gui.resources.TextureArea; |
| 4 | +import gregtech.api.util.Mods; |
4 | 5 |
|
5 | 6 | import net.minecraft.client.Minecraft; |
6 | 7 | import net.minecraft.client.gui.FontRenderer; |
|
27 | 28 |
|
28 | 29 | import codechicken.lib.vec.Matrix4; |
29 | 30 | import com.cleanroommc.modularui.api.MCHelper; |
| 31 | +import com.cleanroommc.modularui.api.widget.IWidget; |
| 32 | +import com.cleanroommc.modularui.integration.jei.JeiGhostIngredientSlot; |
| 33 | +import com.cleanroommc.modularui.integration.jei.ModularUIJeiPlugin; |
30 | 34 | import org.jetbrains.annotations.NotNull; |
31 | 35 | import org.jetbrains.annotations.Nullable; |
32 | 36 | import org.lwjgl.opengl.GL11; |
@@ -711,4 +715,15 @@ public void put(int element, float @NotNull... data) { |
711 | 715 | public static @NotNull TextureAtlasSprite getMissingSprite() { |
712 | 716 | return getTextureMap().getMissingSprite(); |
713 | 717 | } |
| 718 | + |
| 719 | + public static void handleJeiGhostHighlight(IWidget slot) { |
| 720 | + if (!Mods.JustEnoughItems.isModLoaded()) return; |
| 721 | + if (!(slot instanceof JeiGhostIngredientSlot<?>ingredientSlot)) return; |
| 722 | + if (ModularUIJeiPlugin.hasDraggingGhostIngredient() || |
| 723 | + ModularUIJeiPlugin.hoveringOverIngredient(ingredientSlot)) { |
| 724 | + GlStateManager.colorMask(true, true, true, false); |
| 725 | + ingredientSlot.drawHighlight(slot.getArea(), slot.isHovering()); |
| 726 | + GlStateManager.colorMask(true, true, true, true); |
| 727 | + } |
| 728 | + } |
714 | 729 | } |
0 commit comments