OSDN Git Service

ChemiCraft.java修正
[chemicraft/chemicraft.git] / common / chemicraft / system / PacketHandler.java
index b7c7b1a..59945b4 100644 (file)
@@ -13,6 +13,7 @@ import net.minecraft.world.World;
 import chemicraft.ChemiCraft;
 import chemicraft.tileentity.TileEntityChemicalCombinationTable;
 import chemicraft.tileentity.TileEntityChemicalCraftingTable;
+import chemicraft.tileentity.TileEntityElectrolysisTable;
 import chemicraft.tileentity.TileEntityPyrolysisTable;
 import chemicraft.tileentity.TileEntityToolAndWeaponCraftingTable;
 
@@ -100,6 +101,37 @@ public class PacketHandler implements IPacketHandler {
                return packet;
        }
 
+       public static Packet getPacket(TileEntityElectrolysisTable tileEntity) {
+               ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
+               DataOutputStream var2 = new DataOutputStream(var1);
+
+               // Blockのx, y, z座標
+               int x, y, z;
+
+               // x, y, z座標を代入
+               x = tileEntity.xCoord;
+               y = tileEntity.yCoord;
+               z = tileEntity.zCoord;
+
+               try {
+                       // 座標書き込み
+                       var2.writeInt(x);
+                       var2.writeInt(y);
+                       var2.writeInt(z);
+                       tileEntity.writePacket(var2);
+               } catch (IOException e) {
+                       e.printStackTrace();
+               }
+
+               // パケットの作成
+               Packet250CustomPayload packet = new Packet250CustomPayload();
+               packet.channel = "chemicraft";
+               packet.data = var1.toByteArray();
+               packet.length = var1.size();
+               packet.isChunkDataPacket = true;
+               return packet;
+       }
+
        public static Packet getPacket(TileEntityChemicalCombinationTable tileEntity) {
                ByteArrayOutputStream var1 = new ByteArrayOutputStream(128);
                DataOutputStream var2 = new DataOutputStream(var1);