From 5b9935f737c226847e668bde0185adbc6a5a8b7b Mon Sep 17 00:00:00 2001 From: Foghrye4 Date: Wed, 5 Apr 2017 20:41:13 +0300 Subject: some experiments --- ihl/ClientProxy.java | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'ihl/ClientProxy.java') diff --git a/ihl/ClientProxy.java b/ihl/ClientProxy.java index 974a7c4..b3583db 100644 --- a/ihl/ClientProxy.java +++ b/ihl/ClientProxy.java @@ -15,6 +15,7 @@ import ihl.crop_harvestors.SackTileEntity; import ihl.enviroment.LightBulbModel; import ihl.enviroment.LightBulbRender; import ihl.enviroment.LightBulbTileEntity; +import ihl.enviroment.LightHandler; import ihl.enviroment.MirrorRender; import ihl.enviroment.MirrorTileEntity; import ihl.enviroment.SpotlightModel; @@ -41,6 +42,7 @@ import ihl.items_blocks.FlexibleCableItem; import ihl.items_blocks.IHLTool; import ihl.items_blocks.MachineBaseBlock.MachineType; import ihl.model.*; +import ihl.processing.chemistry.DosingPumpTileEntity; import ihl.processing.chemistry.ElectrolysisBathModel; import ihl.processing.chemistry.ElectrolysisBathTileEntity; import ihl.processing.chemistry.FractionatorBottomModel; @@ -121,18 +123,28 @@ import cpw.mods.fml.common.network.internal.FMLProxyPacket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +@SideOnly(value = Side.CLIENT) public class ClientProxy extends ServerProxy { public boolean loadMirrorRender = true; public IHLRenderUtils renderUtils; public Map sharedBlockRenders = new HashMap(); public Map, ISelectionBoxSpecialRenderer> selectionBoxSpecialRendererRegistry = new HashMap, ISelectionBoxSpecialRenderer>(); + public LightHandler lightHandler; public ClientProxy() { } + public LightHandler getLightHandler() { + + return this.lightHandler; + } + @Override public void load() throws ParserConfigurationException { + if (lightHandler == null) { + lightHandler = new LightHandler(); + } if (channel == null) { channel = NetworkRegistry.INSTANCE.newEventDrivenChannel(IHLModInfo.MODID); channel.register(this); @@ -477,4 +489,22 @@ public class ClientProxy extends ServerProxy { } } + public void sendIntegerFieldValueFromClientToServer(int value, String fieldName, TileEntity tileEntity) { + ByteBuf bb = Unpooled.buffer(64); + ByteBufOutputStream byteBufOutputStream = new ByteBufOutputStream(bb); + try { + byteBufOutputStream.write(2); + byteBufOutputStream.writeInt(tileEntity.getWorldObj().provider.dimensionId); + byteBufOutputStream.writeInt(tileEntity.xCoord); + byteBufOutputStream.writeInt(tileEntity.yCoord); + byteBufOutputStream.writeInt(tileEntity.zCoord); + byteBufOutputStream.writeInt(value); + byteBufOutputStream.writeUTF(fieldName); + channel.sendToServer(new FMLProxyPacket(byteBufOutputStream.buffer(), IHLModInfo.MODID)); + byteBufOutputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } -- cgit v1.2.3