diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index ddb98e9c8..eed24c778 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -106,6 +106,9 @@ public class TechReborn { TRTileEntities.init(); ModFluids.init(); + ClientboundPackets.init(); + ServerboundPackets.init(); + // Entitys //EntityRegistry.registerModEntity(new ResourceLocation("techreborn", "nuke"), EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true); diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index 6b562b336..9709e3b24 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -31,7 +31,7 @@ import reborncore.client.gui.builder.GuiBase; import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.client.gui.builder.widget.GuiButtonUpDown; -import techreborn.packets.PacketAesu; +import techreborn.packets.ServerboundPackets; import techreborn.tiles.storage.TileAdjustableSU; import java.io.IOException; @@ -83,7 +83,7 @@ public class GuiAESU extends GuiBase { public void actionPerformed(final GuiButton button) throws IOException { super.actionPerformed(button); if (button.id >= 300 && button.id <= 303) { - NetworkManager.sendToServer(new PacketAesu(button.id, tile)); + NetworkManager.sendToServer(ServerboundPackets.createPacketAesu(button.id, tile)); } } } diff --git a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java index 8d6c17194..153cab672 100644 --- a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java +++ b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java @@ -35,7 +35,7 @@ import net.minecraft.util.ResourceLocation; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.common.network.NetworkManager; -import techreborn.packets.PacketAutoCraftingTableLock; +import techreborn.packets.ServerboundPackets; import techreborn.tiles.machine.tier1.TileAutoCraftingTable; import java.io.IOException; @@ -111,7 +111,7 @@ public class GuiAutoCrafting extends GuiBase { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { if (isPointInRect(145, 4, 20, 12, mouseX, mouseY)) { - NetworkManager.sendToServer(new PacketAutoCraftingTableLock(tileAutoCraftingTable, !tileAutoCraftingTable.locked)); + NetworkManager.sendToServer(ServerboundPackets.createPacketAutoCraftingTableLock(tileAutoCraftingTable, !tileAutoCraftingTable.locked)); return; } super.mouseClicked(mouseX, mouseY, mouseButton); diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index 9c8337bfa..9db55ff6b 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -40,7 +40,7 @@ import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.Torus; import reborncore.client.gui.builder.widget.GuiButtonUpDown; import techreborn.init.TRContent; -import techreborn.packets.PacketFusionControlSize; +import techreborn.packets.ServerboundPackets; import techreborn.tiles.fusionReactor.TileFusionControlComputer; import java.awt.*; @@ -134,7 +134,7 @@ public class GuiFusionReactor extends GuiBase { } private void sendSizeChange(int sizeDelta){ - NetworkManager.sendToServer(new PacketFusionControlSize(sizeDelta, tile.getPos())); + NetworkManager.sendToServer(ServerboundPackets.createPacketFusionControlSize(sizeDelta, tile.getPos())); //Reset the multiblock as it will be wrong now. if(ClientProxy.multiblockRenderEvent.currentMultiblock != null){ updateMultiBlockRender(); diff --git a/src/main/java/techreborn/client/gui/GuiRollingMachine.java b/src/main/java/techreborn/client/gui/GuiRollingMachine.java index b6cd49939..becfdff32 100644 --- a/src/main/java/techreborn/client/gui/GuiRollingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiRollingMachine.java @@ -28,7 +28,7 @@ import net.minecraft.entity.player.EntityPlayer; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; import reborncore.common.network.NetworkManager; -import techreborn.packets.PacketRollingMachineLock; +import techreborn.packets.ServerboundPackets; import techreborn.tiles.machine.tier1.TileRollingMachine; import java.io.IOException; @@ -77,7 +77,7 @@ public class GuiRollingMachine extends GuiBase { @Override protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { if(isPointInRect(130, 4, 20, 12, mouseX, mouseY)){ - NetworkManager.sendToServer(new PacketRollingMachineLock(rollingMachine, !rollingMachine.locked)); + NetworkManager.sendToServer(ServerboundPackets.createPacketRollingMachineLock(rollingMachine, !rollingMachine.locked)); return; } super.mouseClicked(mouseX, mouseY, mouseButton); diff --git a/src/main/java/techreborn/packets/ClientboundPackets.java b/src/main/java/techreborn/packets/ClientboundPackets.java new file mode 100644 index 000000000..a44d3d840 --- /dev/null +++ b/src/main/java/techreborn/packets/ClientboundPackets.java @@ -0,0 +1,9 @@ +package techreborn.packets; + +public class ClientboundPackets { + + public static void init() { + + } + +} diff --git a/src/main/java/techreborn/packets/PacketAesu.java b/src/main/java/techreborn/packets/PacketAesu.java deleted file mode 100644 index f21d6b663..000000000 --- a/src/main/java/techreborn/packets/PacketAesu.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.packets; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.network.NetworkEvent; -import reborncore.common.network.ExtendedPacketBuffer; -import reborncore.common.network.INetworkPacket; -import techreborn.tiles.storage.TileAdjustableSU; - -public class PacketAesu implements INetworkPacket { - - int buttonID; - BlockPos pos; - - public PacketAesu() { - } - - public PacketAesu(int buttonID, TileAdjustableSU tile) { - this.pos = tile.getPos(); - this.buttonID = buttonID; - } - - @Override - public void writeData(ExtendedPacketBuffer out) { - out.writeBlockPos(pos); - out.writeInt(buttonID); - } - - @Override - public void readData(ExtendedPacketBuffer in) { - this.pos = in.readBlockPos(); - this.buttonID = in.readInt(); - } - - @Override - public void processData(NetworkEvent.Context context) { - TileEntity tile = context.getSender().world.getTileEntity(pos); - if (tile instanceof TileAdjustableSU){ - ((TileAdjustableSU) tile).handleGuiInputFromClient(buttonID); - } - } -} diff --git a/src/main/java/techreborn/packets/PacketAutoCraftingTableLock.java b/src/main/java/techreborn/packets/PacketAutoCraftingTableLock.java deleted file mode 100644 index 5ec88a109..000000000 --- a/src/main/java/techreborn/packets/PacketAutoCraftingTableLock.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.packets; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.network.NetworkEvent; -import reborncore.common.network.ExtendedPacketBuffer; -import reborncore.common.network.INetworkPacket; -import techreborn.tiles.machine.tier1.TileAutoCraftingTable; - -public class PacketAutoCraftingTableLock implements INetworkPacket { - - BlockPos machinePos; - boolean locked; - - public PacketAutoCraftingTableLock(TileAutoCraftingTable machine, boolean locked) { - this.machinePos = machine.getPos(); - this.locked = locked; - } - - public PacketAutoCraftingTableLock() { - } - - @Override - public void writeData(ExtendedPacketBuffer buffer) { - buffer.writeBlockPos(machinePos); - buffer.writeBoolean(locked); - } - - @Override - public void readData(ExtendedPacketBuffer buffer) { - machinePos = buffer.readBlockPos(); - locked = buffer.readBoolean(); - } - - @Override - public void processData(NetworkEvent.Context context) { - TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos); - if(tileEntity instanceof TileAutoCraftingTable){ - ((TileAutoCraftingTable) tileEntity).locked = locked; - } - } -} diff --git a/src/main/java/techreborn/packets/PacketFusionControlSize.java b/src/main/java/techreborn/packets/PacketFusionControlSize.java deleted file mode 100644 index 87c80a12c..000000000 --- a/src/main/java/techreborn/packets/PacketFusionControlSize.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.packets; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.network.NetworkEvent; -import reborncore.common.network.ExtendedPacketBuffer; -import reborncore.common.network.INetworkPacket; -import techreborn.tiles.fusionReactor.TileFusionControlComputer; - -public class PacketFusionControlSize implements INetworkPacket { - - int sizeDelta; - BlockPos pos; - - public PacketFusionControlSize(int sizeDelta, BlockPos pos) { - this.sizeDelta = sizeDelta; - this.pos = pos; - } - - public PacketFusionControlSize() { - } - - @Override - public void writeData(ExtendedPacketBuffer buffer) { - buffer.writeInt(sizeDelta); - buffer.writeBlockPos(pos); - } - - @Override - public void readData(ExtendedPacketBuffer buffer) { - sizeDelta = buffer.readInt(); - pos = buffer.readBlockPos(); - } - - @Override - public void processData(NetworkEvent.Context context) { - TileEntity tile = context.getSender().world.getTileEntity(pos); - if(tile instanceof TileFusionControlComputer){ - ((TileFusionControlComputer) tile).changeSize(sizeDelta); - } - } -} diff --git a/src/main/java/techreborn/packets/PacketIdsu.java b/src/main/java/techreborn/packets/PacketIdsu.java deleted file mode 100644 index 830b7f260..000000000 --- a/src/main/java/techreborn/packets/PacketIdsu.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.packets; - -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.network.NetworkEvent; -import reborncore.common.network.ExtendedPacketBuffer; -import reborncore.common.network.INetworkPacket; -import techreborn.tiles.storage.idsu.TileInterdimensionalSU; - -public class PacketIdsu implements INetworkPacket { - - int buttonID; - BlockPos pos; - - public PacketIdsu() { - } - - public PacketIdsu(int buttonID, TileInterdimensionalSU tile) { - this.pos = tile.getPos(); - this.buttonID = buttonID; - } - - @Override - public void writeData(ExtendedPacketBuffer out) { - out.writeBlockPos(pos); - out.writeInt(buttonID); - } - - @Override - public void readData(ExtendedPacketBuffer in) { - this.pos = in.readBlockPos(); - buttonID = in.readInt(); - } - - @Override - public void processData(NetworkEvent.Context context) { - // if (!pos.getWorld().isRemote) { - // pos.handleGuiInputFromClient(buttonID); - // } - } -} diff --git a/src/main/java/techreborn/packets/PacketRollingMachineLock.java b/src/main/java/techreborn/packets/PacketRollingMachineLock.java deleted file mode 100644 index 5c44599a9..000000000 --- a/src/main/java/techreborn/packets/PacketRollingMachineLock.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * This file is part of TechReborn, licensed under the MIT License (MIT). - * - * Copyright (c) 2018 TechReborn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package techreborn.packets; - -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraftforge.fml.network.NetworkEvent; -import reborncore.common.network.ExtendedPacketBuffer; -import reborncore.common.network.INetworkPacket; -import techreborn.tiles.machine.tier1.TileRollingMachine; - -public class PacketRollingMachineLock implements INetworkPacket { - - BlockPos machinePos; - boolean locked; - - public PacketRollingMachineLock(TileRollingMachine machine, boolean locked) { - this.machinePos = machine.getPos(); - this.locked = locked; - } - - public PacketRollingMachineLock() { - } - - @Override - public void writeData(ExtendedPacketBuffer buffer) { - buffer.writeBlockPos(machinePos); - buffer.writeBoolean(locked); - } - - @Override - public void readData(ExtendedPacketBuffer buffer) { - machinePos = buffer.readBlockPos(); - locked = buffer.readBoolean(); - } - - @Override - public void processData(NetworkEvent.Context context) { - TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos); - if(tileEntity instanceof TileRollingMachine){ - ((TileRollingMachine) tileEntity).locked = locked; - } - } -} diff --git a/src/main/java/techreborn/packets/ServerboundPackets.java b/src/main/java/techreborn/packets/ServerboundPackets.java new file mode 100644 index 000000000..27f388fd9 --- /dev/null +++ b/src/main/java/techreborn/packets/ServerboundPackets.java @@ -0,0 +1,114 @@ +package techreborn.packets; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import reborncore.common.network.NetworkManager; +import reborncore.common.network.NetworkPacket; +import techreborn.tiles.fusionReactor.TileFusionControlComputer; +import techreborn.tiles.machine.tier1.TileAutoCraftingTable; +import techreborn.tiles.machine.tier1.TileRollingMachine; +import techreborn.tiles.storage.TileAdjustableSU; +import techreborn.tiles.storage.idsu.TileInterdimensionalSU; + +public class ServerboundPackets { + + public static final ResourceLocation AESU = new ResourceLocation("techreborn", "aesu"); + public static final ResourceLocation AUTO_CRAFTING_LOCK = new ResourceLocation("techreborn", "auto_crafting_lock"); + public static final ResourceLocation ROLLING_MACHINE_LOCK = new ResourceLocation("techreborn", "rolling_machine_lock"); + public static final ResourceLocation FUSION_CONTROL_SIZE = new ResourceLocation("techreborn", "fusion_control_size"); + public static final ResourceLocation IDSU = new ResourceLocation("techreborn", "idsu"); + + public static void init() { + NetworkManager.registerPacketHandler(AESU, (extendedPacketBuffer, context) -> { + BlockPos pos = extendedPacketBuffer.readBlockPos(); + int buttonID = extendedPacketBuffer.readInt(); + context.enqueueWork(() -> { + TileEntity tile = context.getSender().world.getTileEntity(pos); + if (tile instanceof TileAdjustableSU) { + ((TileAdjustableSU) tile).handleGuiInputFromClient(buttonID); + } + }); + }); + + NetworkManager.registerPacketHandler(AUTO_CRAFTING_LOCK, (extendedPacketBuffer, context) -> { + BlockPos machinePos = extendedPacketBuffer.readBlockPos(); + boolean locked = extendedPacketBuffer.readBoolean(); + context.enqueueWork(() -> { + TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos); + if (tileEntity instanceof TileAutoCraftingTable) { + ((TileAutoCraftingTable) tileEntity).locked = locked; + } + }); + }); + + NetworkManager.registerPacketHandler(FUSION_CONTROL_SIZE, (extendedPacketBuffer, context) -> { + int sizeDelta = extendedPacketBuffer.readInt(); + BlockPos pos = extendedPacketBuffer.readBlockPos(); + context.enqueueWork(() -> { + TileEntity tile = context.getSender().world.getTileEntity(pos); + if (tile instanceof TileFusionControlComputer) { + ((TileFusionControlComputer) tile).changeSize(sizeDelta); + } + }); + }); + + NetworkManager.registerPacketHandler(IDSU, (extendedPacketBuffer, context) -> { + BlockPos pos = extendedPacketBuffer.readBlockPos(); + int buttonID = extendedPacketBuffer.readInt(); + context.enqueueWork(() -> { + //TODO was commented out when I ported it, so ill leave it here, needs looking into tho + // if (!pos.getWorld().isRemote) { + // pos.handleGuiInputFromClient(buttonID); + // } + }); + }); + + NetworkManager.registerPacketHandler(ROLLING_MACHINE_LOCK, (extendedPacketBuffer, context) -> { + BlockPos machinePos = extendedPacketBuffer.readBlockPos(); + boolean locked = extendedPacketBuffer.readBoolean(); + context.enqueueWork(() -> { + TileEntity tileEntity = context.getSender().world.getTileEntity(machinePos); + if (tileEntity instanceof TileRollingMachine) { + ((TileRollingMachine) tileEntity).locked = locked; + } + }); + }); + } + + public static NetworkPacket createPacketAesu(int buttonID, TileAdjustableSU tile) { + return NetworkManager.createPacket(AESU, extendedPacketBuffer -> { + extendedPacketBuffer.writeBlockPos(tile.getPos()); + extendedPacketBuffer.writeInt(buttonID); + }); + } + + public static NetworkPacket createPacketAutoCraftingTableLock(TileAutoCraftingTable machine, boolean locked) { + return NetworkManager.createPacket(AUTO_CRAFTING_LOCK, extendedPacketBuffer -> { + extendedPacketBuffer.writeBlockPos(machine.getPos()); + extendedPacketBuffer.writeBoolean(locked); + }); + } + + public static NetworkPacket createPacketFusionControlSize(int sizeDelta, BlockPos pos) { + return NetworkManager.createPacket(FUSION_CONTROL_SIZE, extendedPacketBuffer -> { + extendedPacketBuffer.writeInt(sizeDelta); + extendedPacketBuffer.writeBlockPos(pos); + }); + } + + public static NetworkPacket createPacketIdsu(int buttonID, TileInterdimensionalSU tile) { + return NetworkManager.createPacket(IDSU, extendedPacketBuffer -> { + extendedPacketBuffer.writeBlockPos(tile.getPos()); + extendedPacketBuffer.writeInt(buttonID); + }); + } + + public static NetworkPacket createPacketRollingMachineLock(TileRollingMachine machine, boolean locked) { + return NetworkManager.createPacket(ROLLING_MACHINE_LOCK, extendedPacketBuffer -> { + extendedPacketBuffer.writeBlockPos(machine.getPos()); + extendedPacketBuffer.writeBoolean(locked); + }); + } + +}