Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-09 01:30:13 +01:00
Handle PacketMultiBlockChange correctly
Dieser Commit ist enthalten in:
Ursprung
4f3074eca8
Commit
db57916af4
@ -105,17 +105,15 @@ public class WorldPackets {
|
|||||||
handler(new PacketHandler() {
|
handler(new PacketHandler() {
|
||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper wrapper) throws Exception {
|
public void handle(PacketWrapper wrapper) throws Exception {
|
||||||
BlockStorage storage = wrapper.user().get(BlockStorage.class);
|
|
||||||
int chunkX = wrapper.get(Type.INT, 0);
|
int chunkX = wrapper.get(Type.INT, 0);
|
||||||
int chunkZ = wrapper.get(Type.INT, 0);
|
int chunkZ = wrapper.get(Type.INT, 1);
|
||||||
// Convert ids
|
// Convert ids
|
||||||
for (BlockChangeRecord record : wrapper.get(Type.BLOCK_CHANGE_RECORD_ARRAY, 0)) {
|
for (BlockChangeRecord record : wrapper.get(Type.BLOCK_CHANGE_RECORD_ARRAY, 0)) {
|
||||||
int newBlock = toNewId(record.getBlockId());
|
int newBlock = toNewId(record.getBlockId());
|
||||||
Position position = new Position(
|
Position position = new Position(
|
||||||
(long) (record.getHorizontal() >> 4 & 15) + (chunkX * 16),
|
(long) (record.getHorizontal() >> 4 & 15) + (chunkX * 16),
|
||||||
(long) record.getY(),
|
(long) record.getY(),
|
||||||
(long) ((record.getHorizontal() & 15) + (chunkZ * 16)));
|
(long) (record.getHorizontal() & 15) + (chunkZ * 16));
|
||||||
|
|
||||||
record.setBlockId(checkStorage(wrapper.user(), position, newBlock));
|
record.setBlockId(checkStorage(wrapper.user(), position, newBlock));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren