mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-11-20 01:15:15 +01:00
Fix client-side slime collision box
This commit is contained in:
parent
bb48855396
commit
2641ec7c0f
@ -16,6 +16,7 @@ import java.util.Optional;
|
||||
class DataWatcherKey<T> {
|
||||
|
||||
private static final DataWatcherSerializer<Byte> BYTE_SERIALIZER = DataWatcherRegistry.a;
|
||||
private static final DataWatcherSerializer<Integer> INT_SERIALIZER = DataWatcherRegistry.b;
|
||||
private static final DataWatcherSerializer<Boolean> BOOLEAN_SERIALIZER = DataWatcherRegistry.i;
|
||||
private static final DataWatcherSerializer<ItemStack> ITEM_STACK_SERIALIZER = DataWatcherRegistry.g;
|
||||
private static final DataWatcherSerializer<Optional<IChatBaseComponent>> OPTIONAL_CHAT_COMPONENT_SERIALIZER = DataWatcherRegistry.f;
|
||||
@ -25,6 +26,7 @@ class DataWatcherKey<T> {
|
||||
static DataWatcherKey<Boolean> CUSTOM_NAME_VISIBILITY = new DataWatcherKey<>(3, BOOLEAN_SERIALIZER);
|
||||
static DataWatcherKey<ItemStack> ITEM_STACK = new DataWatcherKey<>(8, ITEM_STACK_SERIALIZER);
|
||||
static DataWatcherKey<Byte> ARMOR_STAND_STATUS = new DataWatcherKey<>(15, BYTE_SERIALIZER);
|
||||
static DataWatcherKey<Integer> SLIME_SIZE = new DataWatcherKey<>(16, INT_SERIALIZER);
|
||||
|
||||
private final int index;
|
||||
private final DataWatcherSerializer<T> serializer;
|
||||
|
@ -75,6 +75,11 @@ class EntityMetadataNMSPacket extends VersionNMSPacket {
|
||||
return this;
|
||||
}
|
||||
|
||||
Builder setSmallSlime() {
|
||||
packetByteBuffer.writeDataWatcherEntry(DataWatcherKey.SLIME_SIZE, 1);
|
||||
return this;
|
||||
}
|
||||
|
||||
EntityMetadataNMSPacket build() {
|
||||
packetByteBuffer.writeDataWatcherEntriesEnd();
|
||||
return new EntityMetadataNMSPacket(packetByteBuffer);
|
||||
|
@ -87,6 +87,7 @@ class VersionNMSPacketList extends AbstractNMSPacketList {
|
||||
add(new EntityLivingSpawnNMSPacket(entityID, EntityTypeID.SLIME, locationX, locationY, locationZ));
|
||||
add(EntityMetadataNMSPacket.builder(entityID)
|
||||
.setInvisible()
|
||||
.setSmallSlime() // Required for a correct client-side collision box
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user