Fix explosion packet

This commit is contained in:
KennyTV 2021-03-13 15:34:57 +01:00
parent 62b321b7e9
commit f498d59303
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 5 additions and 4 deletions

View File

@ -145,6 +145,7 @@ public class Protocol1_16_4To1_17 extends BackwardsProtocol<ClientboundPackets1_
map(Type.FLOAT); // X
map(Type.FLOAT); // Y
map(Type.FLOAT); // Z
map(Type.FLOAT); // Strength
handler(wrapper -> {
wrapper.write(Type.INT, wrapper.read(Type.VAR_INT)); // Collection length
});

View File

@ -73,10 +73,10 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
ListTag dimensions = dimensionRegistry.get("value");
for (Tag dimension : dimensions) {
CompoundTag dimensionCompound = ((CompoundTag) dimension).get("element");
reduceForExtendedHeight(dimensionCompound, false);
reduceExtendedHeight(dimensionCompound, false);
}
reduceForExtendedHeight(wrapper.get(Type.NBT, 1), true);
reduceExtendedHeight(wrapper.get(Type.NBT, 1), true);
});
}
});
@ -86,7 +86,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
map(Type.NBT); // Dimension data
handler(getWorldDataTracker(0));
handler(wrapper -> {
reduceForExtendedHeight(wrapper.get(Type.NBT, 0), true);
reduceExtendedHeight(wrapper.get(Type.NBT, 0), true);
});
}
});
@ -189,7 +189,7 @@ public class EntityPackets1_17 extends EntityRewriter<Protocol1_16_4To1_17> {
return Entity1_17Types.getTypeFromId(typeId);
}
private void reduceForExtendedHeight(CompoundTag tag, boolean warn) {
private void reduceExtendedHeight(CompoundTag tag, boolean warn) {
IntTag minY = tag.get("min_y");
IntTag height = tag.get("height");
IntTag logicalHeight = tag.get("logical_height");