use of micdoodle8.mods.galacticraft.core.client.gui.container.GuiPositionedContainer in project Galacticraft by micdoodle8.
the class EventHandlerGC method schematicFlipEvent.
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void schematicFlipEvent(FlipPage event) {
ISchematicPage page = null;
switch(event.direction) {
case 1:
page = EventHandlerGC.getNextSchematic(event.index);
break;
case -1:
page = EventHandlerGC.getLastSchematic(event.index);
break;
}
if (page != null) {
GuiScreen cs = event.currentGui;
int benchX = (int) FMLClientHandler.instance().getClient().thePlayer.posX;
int benchY = (int) FMLClientHandler.instance().getClient().thePlayer.posY;
int benchZ = (int) FMLClientHandler.instance().getClient().thePlayer.posZ;
if (cs instanceof GuiPositionedContainer) {
benchX = ((GuiPositionedContainer) cs).getX();
benchY = ((GuiPositionedContainer) cs).getY();
benchZ = ((GuiPositionedContainer) cs).getZ();
}
GalacticraftCore.packetPipeline.sendToServer(new PacketSimple(EnumSimplePacket.S_OPEN_SCHEMATIC_PAGE, GCCoreUtil.getDimensionID(FMLClientHandler.instance().getClient().theWorld), new Object[] { page.getPageID(), benchX, benchY, benchZ }));
FMLClientHandler.instance().getClient().thePlayer.openGui(GalacticraftCore.instance, page.getGuiID(), FMLClientHandler.instance().getClient().thePlayer.worldObj, benchX, benchY, benchZ);
}
}
Aggregations