fixed missing packet ids transmission

This commit is contained in:
SpaceToad 2014-02-10 18:24:27 +01:00
parent 8f7f8d31ad
commit ef400b1d92
3 changed files with 4 additions and 10 deletions

View file

@ -18,9 +18,7 @@ public class PacketCoordinates extends BuildCraftPacket {
}
public PacketCoordinates(int id, int x, int y, int z) {
this.id = id;
this.posX = x;
this.posY = y;
this.posZ = z;
@ -28,7 +26,7 @@ public class PacketCoordinates extends BuildCraftPacket {
@Override
public void writeData(ByteBuf data) {
data.writeByte(id);
data.writeInt(posX);
data.writeInt(posY);
data.writeInt(posZ);
@ -36,16 +34,14 @@ public class PacketCoordinates extends BuildCraftPacket {
@Override
public void readData(ByteBuf data) {
id = data.readByte ();
posX = data.readInt();
posY = data.readInt();
posZ = data.readInt();
}
@Override
public int getID() {
return id;
}
}

View file

@ -23,7 +23,6 @@ public class PacketNBT extends PacketCoordinates {
@Override
public void writeData(ByteBuf data) {
super.writeData(data);
try {
@ -38,7 +37,6 @@ public class PacketNBT extends PacketCoordinates {
@Override
public void readData(ByteBuf data) {
super.readData(data);
short length = data.readShort();

View file

@ -21,9 +21,9 @@ public class PacketPowerUpdate extends PacketCoordinates {
}
@Override
public void readData(ByteBuf data) {
displayPower = new short[] { 0, 0, 0, 0, 0, 0 };
public void readData(ByteBuf data) {
super.readData(data);
displayPower = new short[] { 0, 0, 0, 0, 0, 0 };
overload = data.readBoolean();
for (int i = 0; i < displayPower.length; i++) {
displayPower[i] = data.readByte();