use of net.minecraft.client.gui.inventory.GuiContainer in project LogisticsPipes by RS485.
the class LogisticsGuiOverrenderer method renderOverGui.
@SuppressWarnings("unchecked")
public void renderOverGui() {
if (hasBeenSaved) {
hasBeenSaved = false;
// Resore Mouse Pos
try {
fX.set(null, oldX);
fY.set(null, oldY);
} catch (Exception e) {
if (LPConstants.DEBUG) {
e.printStackTrace();
}
}
}
if (isOverlaySlotActive) {
GuiContainer gui = (GuiContainer) FMLClientHandler.instance().getClient().currentScreen;
int guiTop = gui.guiTop;
int guiLeft = gui.guiLeft;
int x = oldX * gui.width / FMLClientHandler.instance().getClient().displayWidth;
int y = gui.height - oldY * gui.height / FMLClientHandler.instance().getClient().displayHeight - 1;
for (Slot slot : (List<Slot>) gui.inventorySlots.inventorySlots) {
if (isMouseOverSlot(gui, slot, x, y)) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glTranslated(guiLeft, guiTop, 0);
int k1 = slot.xDisplayPosition;
int i1 = slot.yDisplayPosition;
SimpleGraphics.drawGradientRect(k1, i1, k1 + 16, i1 + 16, 0xa0ff0000, 0xa0ff0000, 0.0);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
if (clicked) {
MainProxy.sendPacketToServer(PacketHandler.getPacket(SlotFinderNumberPacket.class).setInventorySlot(slot.slotNumber).setSlot(this.slot).setPipePosX(pipePosX).setPipePosY(pipePosY).setPipePosZ(pipePosZ).setType(positionType).setPositionInt(positionInt).setPosX(targetPosX).setPosY(targetPosY).setPosZ(targetPosZ));
clicked = false;
FMLClientHandler.instance().getClient().thePlayer.closeScreen();
isOverlaySlotActive = false;
}
break;
}
}
clicked = false;
}
}
Aggregations