mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-10-04 18:47:32 +02:00
Fix VisibilitySettings not working
This commit is contained in:
parent
08410feb48
commit
f6c7fd5f0f
@ -38,7 +38,9 @@ class MetadataHelper {
|
|||||||
|
|
||||||
|
|
||||||
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;
|
itemSlotIndex = 7;
|
||||||
} else if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_10_R1)) {
|
} else if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_10_R1)) {
|
||||||
itemSlotIndex = 6;
|
itemSlotIndex = 6;
|
||||||
@ -48,7 +50,9 @@ class MetadataHelper {
|
|||||||
itemSlotIndex = 10;
|
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;
|
armorStandStatusIndex = 14;
|
||||||
} else {
|
} else {
|
||||||
armorStandStatusIndex = 11;
|
armorStandStatusIndex = 11;
|
||||||
|
@ -185,9 +185,18 @@ class PacketSender {
|
|||||||
|
|
||||||
|
|
||||||
private void sendDestroyEntitiesPacket(Player player, List<Integer> ids) {
|
private void sendDestroyEntitiesPacket(Player player, List<Integer> ids) {
|
||||||
WrapperPlayServerEntityDestroy packet = new WrapperPlayServerEntityDestroy();
|
if (NMSVersion.isGreaterEqualThan(NMSVersion.v1_17_R1)) {
|
||||||
packet.setEntities(ids);
|
// Requires multiple packets
|
||||||
packet.sendPacket(player);
|
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));
|
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