mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 23:03:01 +00:00
Major packet work, I think it's done. 34 errors to go!
This commit is contained in:
1 parent
659b963af6
commit
1933723b52
41 files changed
+638
-886
No files matched your search
@@ -24,20 +24,8 @@ public class PacketRedstoneControl extends MekanismPacket
|
||||
value = control;
|
||||
}
|
||||
|
||||
public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception
|
||||
{
|
||||
Coord4D obj = Coord4D.read(dataStream);
|
||||
RedstoneControl control = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
TileEntity tileEntity = obj.getTileEntity(world);
|
||||
|
||||
if(tileEntity instanceof IRedstoneControl)
|
||||
{
|
||||
((IRedstoneControl)tileEntity).setControlType(control);
|
||||
}
|
||||
}
|
||||
|
||||
public void write(DataOutputStream dataStream) throws Exception
|
||||
@Override
|
||||
public void write(ChannelHandlerContext ctx, ByteBuf dataStream)
|
||||
{
|
||||
dataStream.writeInt(coord4D.xCoord);
|
||||
dataStream.writeInt(coord4D.yCoord);
|
||||
@@ -48,15 +36,17 @@ public class PacketRedstoneControl extends MekanismPacket
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(ChannelHandlerContext ctx, ByteBuf buffer)
|
||||
public void read(ChannelHandlerContext ctx, EntityPlayer player, ByteBuf dataStream)
|
||||
{
|
||||
Coord4D obj = Coord4D.read(dataStream);
|
||||
RedstoneControl control = RedstoneControl.values()[dataStream.readInt()];
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(ChannelHandlerContext ctx, ByteBuf buffer)
|
||||
{
|
||||
TileEntity tileEntity = obj.getTileEntity(player.worldObj);
|
||||
|
||||
if(tileEntity instanceof IRedstoneControl)
|
||||
{
|
||||
((IRedstoneControl)tileEntity).setControlType(control);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user