mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-25 22:34:21 +00:00
I went for what seemed like a good level of organisation: Java __________ Mekanism __________ Minecraft Forge FML __________ Netty LWJGL __________ Other APIs __________ Static Imports.
34 lines
755 B
Java
34 lines
755 B
Java
package mekanism.client.nei;
|
|
|
|
import mekanism.client.gui.GuiElement;
|
|
import mekanism.client.gui.GuiMekanism;
|
|
|
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
|
|
|
import codechicken.lib.vec.Rectangle4i;
|
|
import codechicken.nei.api.INEIGuiAdapter;
|
|
|
|
public class ElementBoundHandler extends INEIGuiAdapter
|
|
{
|
|
@Override
|
|
public boolean hideItemPanelSlot(GuiContainer gui, int x, int y, int width, int height)
|
|
{
|
|
if(gui instanceof GuiMekanism)
|
|
{
|
|
GuiMekanism guiMek = (GuiMekanism)gui;
|
|
|
|
Rectangle4i rect = new Rectangle4i(x, y, width, height);
|
|
|
|
for(GuiElement element : guiMek.guiElements)
|
|
{
|
|
if(element.getBounds(guiMek.getXPos(), guiMek.getYPos()).intersects(rect))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|