Inital pass of cleaning up the networking, I will prob do some more in 1.13
This commit is contained in:
parent
69b9c511c3
commit
693cb6807a
5 changed files with 15 additions and 15 deletions
|
@ -31,7 +31,7 @@ import reborncore.common.network.ExtendedPacketBuffer;
|
|||
import reborncore.common.network.INetworkPacket;
|
||||
import techreborn.tiles.storage.TileAdjustableSU;
|
||||
|
||||
public class PacketAesu implements INetworkPacket<PacketAesu> {
|
||||
public class PacketAesu implements INetworkPacket {
|
||||
|
||||
int buttonID;
|
||||
BlockPos pos;
|
||||
|
@ -57,10 +57,10 @@ public class PacketAesu implements INetworkPacket<PacketAesu> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processData(PacketAesu message, MessageContext context) {
|
||||
TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos);
|
||||
public void processData(MessageContext context) {
|
||||
TileEntity tile = context.getServerHandler().player.world.getTileEntity(pos);
|
||||
if (tile instanceof TileAdjustableSU){
|
||||
((TileAdjustableSU) tile).handleGuiInputFromClient(message.buttonID);
|
||||
((TileAdjustableSU) tile).handleGuiInputFromClient(buttonID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import reborncore.common.network.ExtendedPacketBuffer;
|
|||
import reborncore.common.network.INetworkPacket;
|
||||
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
|
||||
|
||||
public class PacketFusionControlSize implements INetworkPacket<PacketFusionControlSize> {
|
||||
public class PacketFusionControlSize implements INetworkPacket {
|
||||
|
||||
int sizeDelta;
|
||||
BlockPos pos;
|
||||
|
@ -57,8 +57,8 @@ public class PacketFusionControlSize implements INetworkPacket<PacketFusionContr
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processData(PacketFusionControlSize message, MessageContext context) {
|
||||
TileEntity tile = context.getServerHandler().player.world.getTileEntity(message.pos);
|
||||
public void processData(MessageContext context) {
|
||||
TileEntity tile = context.getServerHandler().player.world.getTileEntity(pos);
|
||||
if(tile instanceof TileFusionControlComputer){
|
||||
((TileFusionControlComputer) tile).changeSize(sizeDelta);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ import reborncore.common.network.ExtendedPacketBuffer;
|
|||
import reborncore.common.network.INetworkPacket;
|
||||
import techreborn.tiles.idsu.TileInterdimensionalSU;
|
||||
|
||||
public class PacketIdsu implements INetworkPacket<PacketIdsu> {
|
||||
public class PacketIdsu implements INetworkPacket {
|
||||
|
||||
int buttonID;
|
||||
BlockPos pos;
|
||||
|
@ -56,7 +56,7 @@ public class PacketIdsu implements INetworkPacket<PacketIdsu> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processData(PacketIdsu message, MessageContext context) {
|
||||
public void processData(MessageContext context) {
|
||||
// if (!pos.getWorld().isRemote) {
|
||||
// pos.handleGuiInputFromClient(buttonID);
|
||||
// }
|
||||
|
|
|
@ -31,7 +31,7 @@ import reborncore.common.network.ExtendedPacketBuffer;
|
|||
import reborncore.common.network.INetworkPacket;
|
||||
import techreborn.tiles.tier1.TileRollingMachine;
|
||||
|
||||
public class PacketRollingMachineLock implements INetworkPacket<PacketRollingMachineLock> {
|
||||
public class PacketRollingMachineLock implements INetworkPacket {
|
||||
|
||||
BlockPos machinePos;
|
||||
boolean locked;
|
||||
|
@ -57,7 +57,7 @@ public class PacketRollingMachineLock implements INetworkPacket<PacketRollingMac
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processData(PacketRollingMachineLock message, MessageContext context) {
|
||||
public void processData(MessageContext context) {
|
||||
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(machinePos);
|
||||
if(tileEntity instanceof TileRollingMachine){
|
||||
((TileRollingMachine) tileEntity).locked = locked;
|
||||
|
|
|
@ -36,7 +36,7 @@ import techreborn.tiles.tier1.TileAutoCraftingTable;
|
|||
/**
|
||||
* Created by modmuss50 on 20/06/2017.
|
||||
*/
|
||||
public class PacketSetRecipe implements INetworkPacket<PacketSetRecipe> {
|
||||
public class PacketSetRecipe implements INetworkPacket {
|
||||
|
||||
BlockPos pos;
|
||||
ResourceLocation recipe;
|
||||
|
@ -70,10 +70,10 @@ public class PacketSetRecipe implements INetworkPacket<PacketSetRecipe> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void processData(PacketSetRecipe message, MessageContext context) {
|
||||
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(message.pos);
|
||||
public void processData(MessageContext context) {
|
||||
TileEntity tileEntity = context.getServerHandler().player.world.getTileEntity(pos);
|
||||
if (tileEntity instanceof TileAutoCraftingTable) {
|
||||
((TileAutoCraftingTable) tileEntity).setCurrentRecipe(message.recipe, message.custom);
|
||||
((TileAutoCraftingTable) tileEntity).setCurrentRecipe(recipe, custom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue