diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java b/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java index 6883199..a20608e 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/record/PacketProcessor.java @@ -100,12 +100,13 @@ public class PacketProcessor { packetDecoder[0x0b] = this::damage; packetDecoder[0x0c] = this::fireTick; packetDecoder[0x20] = this::arenaInfo; - packetDecoder[0x30] = this::block; + packetDecoder[0x30] = this::byteWorldHeightBlock; packetDecoder[0x31] = this::particle; packetDecoder[0x32] = this::sound; packetDecoder[0x33] = this::shortBlock; packetDecoder[0x34] = this::soundAtPlayer; packetDecoder[0x35] = this::shortRelativeBlock; + packetDecoder[0x36] = this::block; packetDecoder[0xa0] = () -> send(ChatMessageType.CHAT); packetDecoder[0xa1] = () -> send(ChatMessageType.ACTION_BAR); packetDecoder[0xa2] = () -> send(ChatMessageType.SYSTEM); @@ -335,7 +336,7 @@ public class PacketProcessor { setBlock(x + Config.ArenaRegion.getMinX(), y + Config.BluePasteRegion.getMinY(), z + Config.ArenaRegion.getMinZ(), blockState); } - private void block() throws IOException { + private void byteWorldHeightBlock() throws IOException { int x = source.readInt() - arenaMinX; int y = Byte.toUnsignedInt(source.readByte()) - arenaMinY; int z = source.readInt() - arenaMinZ; @@ -349,6 +350,20 @@ public class PacketProcessor { setBlock(x + Config.ArenaRegion.getMinX(), y + Config.BluePasteRegion.getMinY(), z + Config.ArenaRegion.getMinZ(), blockState); } + private void block() throws IOException { + int x = source.readInt() - arenaMinX; + int y = source.readShort() - arenaMinY; + int z = source.readInt() - arenaMinZ; + int blockState = source.readInt(); + + if(rotateZ) { + x = Config.ArenaRegion.getSizeX() - x; + z = Config.ArenaRegion.getSizeZ() - z; + } + + setBlock(x + Config.ArenaRegion.getMinX(), y + Config.BluePasteRegion.getMinY(), z + Config.ArenaRegion.getMinZ(), blockState); + } + private void setBlock(int x, int y, int z, int blockState){ if(!Config.ArenaRegion.in2dRegion(x, z)) return; //Outside of the arena diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/record/Recorder.java b/FightSystem_Core/src/de/steamwar/fightsystem/record/Recorder.java index eb31336..7d571ae 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/record/Recorder.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/record/Recorder.java @@ -99,12 +99,13 @@ public interface Recorder { * * ArenaInfo (0x20) + bool blueNegZ + byte arenaY + int arenaMinX + int arenaMinZ * - * BlockPacket (0x30) + pos int, byte, int + int BlockState + * DEPRECATED BlockPacket (0x30) + pos int, byte, int + int BlockState * ParticlePacket (0x31) + double x, y, z + string particleType * SoundPacket (0x32) + int x, y, z + string soundType + string soundCategory + float volume, pitch * DEPRECATED ShortBlockPacket (0x33) + pos relative to ArenaMinX,ArenaMinZ byte, byte, byte + short BlockState * SoundAtPlayerPacket (0x34) + string (soundType, soundCategory) + float volume, pitch * ShortBlockPacket (0x35) + pos relative to ArenaMinX,BluePasteY,ArenaMinZ byte, byte, byte + short BlockState + * BlockPacket (0x36) + pos int, short, int + int BlockState * * * DEPRECATED ChatPacket (0xa0) + String message @@ -226,7 +227,7 @@ public interface Recorder { write(0x35, (byte)shortX, (byte)shortY, (byte)shortZ, (short)blockState); }else{ //Block packet - write(0x30, block.getX(), (byte)block.getY(), block.getZ(), blockState); + write(0x36, block.getX(), (short)block.getY(), block.getZ(), blockState); } }