|
30 | 30 | import com.falsepattern.chunk.api.DataManager; |
31 | 31 |
|
32 | 32 | import net.minecraft.nbt.NBTTagCompound; |
| 33 | +import net.minecraft.network.PacketBuffer; |
| 34 | +import net.minecraft.network.play.server.S23PacketBlockChange; |
33 | 35 | import net.minecraft.world.chunk.Chunk; |
34 | 36 | import net.minecraft.world.chunk.NibbleArray; |
35 | 37 | import net.minecraft.world.chunk.storage.ExtendedBlockStorage; |
36 | 38 |
|
37 | | -public class MetadataManager extends NibbleManager implements DataManager.SubChunkDataManager { |
| 39 | +import java.io.IOException; |
| 40 | + |
| 41 | +public class MetadataManager extends NibbleManager implements |
| 42 | + DataManager.BlockPacketDataManager, |
| 43 | + DataManager.SubChunkDataManager { |
38 | 44 | @Override |
39 | 45 | protected NibbleArray getNibbleArray(ExtendedBlockStorage subChunk) { |
40 | 46 | return subChunk.getMetadataArray(); |
@@ -64,4 +70,22 @@ public void readSubChunkFromNBT(Chunk chunk, ExtendedBlockStorage subChunk, NBTT |
64 | 70 | public void cloneSubChunk(Chunk fromChunk, ExtendedBlockStorage from, ExtendedBlockStorage to) { |
65 | 71 | to.setBlockMetadataArray(ArrayUtil.copyArray(from.getMetadataArray(), to.getMetadataArray())); |
66 | 72 | } |
| 73 | + |
| 74 | + @Override |
| 75 | + public void writeBlockToPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) { |
| 76 | + } |
| 77 | + |
| 78 | + @Override |
| 79 | + public void readBlockFromPacket(Chunk chunk, int x, int y, int z, S23PacketBlockChange packet) { |
| 80 | + } |
| 81 | + |
| 82 | + @Override |
| 83 | + public void writeBlockPacketToBuffer(S23PacketBlockChange packet, PacketBuffer buffer) throws IOException { |
| 84 | + buffer.writeByte(packet.field_148884_e & 0xF); |
| 85 | + } |
| 86 | + |
| 87 | + @Override |
| 88 | + public void readBlockPacketFromBuffer(S23PacketBlockChange packet, PacketBuffer buffer) throws IOException { |
| 89 | + packet.field_148884_e = buffer.readUnsignedByte() & 0xF; |
| 90 | + } |
67 | 91 | } |
0 commit comments