mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-07-01 09:05:10 +02:00
Fix VisibilitySettings not working
This commit is contained in:
parent
08410feb48
commit
f6c7fd5f0f
|
@ -38,7 +38,9 @@ class MetadataHelper {
|
|||
|
||||
|
||||
MetadataHelper() {
|
||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_14_R1)) {
|
||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_17_R1)) {
|
||||
itemSlotIndex = 8;
|
||||
} else if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_14_R1)) {
|
||||
itemSlotIndex = 7;
|
||||
} else if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_10_R1)) {
|
||||
itemSlotIndex = 6;
|
||||
|
@ -48,7 +50,9 @@ class MetadataHelper {
|
|||
itemSlotIndex = 10;
|
||||
}
|
||||
|
||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_15_R1)) {
|
||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_17_R1)) {
|
||||
armorStandStatusIndex = 15;
|
||||
} else if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_15_R1)) {
|
||||
armorStandStatusIndex = 14;
|
||||
} else {
|
||||
armorStandStatusIndex = 11;
|
||||
|
|
|
@ -185,9 +185,18 @@ class PacketSender {
|
|||
|
||||
|
||||
private void sendDestroyEntitiesPacket(Player player, List<Integer> ids) {
|
||||
WrapperPlayServerEntityDestroy packet = new WrapperPlayServerEntityDestroy();
|
||||
packet.setEntities(ids);
|
||||
packet.sendPacket(player);
|
||||
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_17_R1)) {
|
||||
// Requires multiple packets
|
||||
for (Integer id : ids) {
|
||||
WrapperPlayServerEntityDestroy packet = new WrapperPlayServerEntityDestroy();
|
||||
packet.setEntity(id);
|
||||
packet.sendPacket(player);
|
||||
}
|
||||
} else {
|
||||
WrapperPlayServerEntityDestroy packet = new WrapperPlayServerEntityDestroy();
|
||||
packet.setEntities(ids);
|
||||
packet.sendPacket(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -56,4 +56,11 @@ public class WrapperPlayServerEntityDestroy extends AbstractPacket {
|
|||
setEntities(Ints.toArray(entities));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the entity that will be destroyed. To be used from Minecraft 1.17 and higher.
|
||||
*/
|
||||
public void setEntity(Integer entity) {
|
||||
handle.getIntegers().write(0, entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user