From ec5cf3ca94067ce28a9d2cecc913cc7a9b92014c Mon Sep 17 00:00:00 2001 From: filoghost Date: Thu, 19 Aug 2021 09:28:58 +0200 Subject: [PATCH] Refactoring --- .../nms/entity/ClickableNMSPacketEntity.java | 3 +++ .../common/nms/entity/ItemNMSPacketEntity.java | 3 +++ .../common/nms/entity/TextNMSPacketEntity.java | 3 +++ .../v1_10_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_10_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_10_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_11_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_11_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_11_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_12_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_12_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_12_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_13_R2/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_13_R2/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_13_R2/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_14_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_14_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_14_R1/VersionTextNMSPacketEntity.java | 10 ++++++---- .../v1_15_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_15_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_15_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_16_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_16_R2/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R2/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R2/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_16_R3/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R3/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_16_R3/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_17_R1/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_17_R1/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_17_R1/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_8_R3/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_8_R3/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_8_R3/VersionTextNMSPacketEntity.java | 11 +++++++---- .../v1_9_R2/VersionClickableNMSPacketEntity.java | 8 +++++--- .../nms/v1_9_R2/VersionItemNMSPacketEntity.java | 8 +++++--- .../nms/v1_9_R2/VersionTextNMSPacketEntity.java | 11 +++++++---- .../plugin/hologram/base/BaseItemLine.java | 3 ++- .../plugin/hologram/base/BaseTextLine.java | 3 ++- .../hologram/tracking/ClickableLineTracker.java | 4 +--- .../plugin/hologram/tracking/ItemLineTracker.java | 10 +++------- .../plugin/hologram/tracking/TextLineTracker.java | 15 ++++----------- 44 files changed, 224 insertions(+), 143 deletions(-) diff --git a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ClickableNMSPacketEntity.java b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ClickableNMSPacketEntity.java index 49e4cb00..e2c50e4e 100644 --- a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ClickableNMSPacketEntity.java +++ b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ClickableNMSPacketEntity.java @@ -10,6 +10,9 @@ import me.filoghost.holographicdisplays.common.nms.NMSPacketList; public interface ClickableNMSPacketEntity extends NMSPacketEntity { + double SLIME_Y_OFFSET = 0; + double SLIME_HEIGHT = 0.5; + EntityID getID(); void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ); diff --git a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ItemNMSPacketEntity.java b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ItemNMSPacketEntity.java index bed5be04..14d8c179 100644 --- a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ItemNMSPacketEntity.java +++ b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/ItemNMSPacketEntity.java @@ -10,6 +10,9 @@ import org.bukkit.inventory.ItemStack; public interface ItemNMSPacketEntity extends NMSPacketEntity { + double ITEM_Y_OFFSET = 0; + double ITEM_HEIGHT = 0.7; + void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack); void addChangePackets(NMSPacketList packetList, ItemStack itemStack); diff --git a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/TextNMSPacketEntity.java b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/TextNMSPacketEntity.java index 714f8936..f3698781 100644 --- a/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/TextNMSPacketEntity.java +++ b/common/src/main/java/me/filoghost/holographicdisplays/common/nms/entity/TextNMSPacketEntity.java @@ -10,6 +10,9 @@ import me.filoghost.holographicdisplays.common.nms.NMSPacketList; public interface TextNMSPacketEntity extends NMSPacketEntity { + double ARMOR_STAND_Y_OFFSET = -0.29; + double ARMOR_STAND_TEXT_HEIGHT = 0.23; + void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ); void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text); diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionClickableNMSPacketEntity.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionClickableNMSPacketEntity.java index f1130a33..a477d3c4 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionItemNMSPacketEntity.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionItemNMSPacketEntity.java index d74c9165..cd91e3ba 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionTextNMSPacketEntity.java b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionTextNMSPacketEntity.java index 8dda1cec..de27eb9b 100644 --- a/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_10_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_10_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionClickableNMSPacketEntity.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionClickableNMSPacketEntity.java index 5e12cdf8..d18ea9fd 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionItemNMSPacketEntity.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionItemNMSPacketEntity.java index 5ae1bd01..d66795a3 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionTextNMSPacketEntity.java b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionTextNMSPacketEntity.java index 8c01d972..caf3cf52 100644 --- a/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_11_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_11_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionClickableNMSPacketEntity.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionClickableNMSPacketEntity.java index f1de457f..f5f2a14f 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionItemNMSPacketEntity.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionItemNMSPacketEntity.java index 2dcbc096..61b70a20 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionTextNMSPacketEntity.java b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionTextNMSPacketEntity.java index 9d6f278d..c2194fb1 100644 --- a/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_12_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_12_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionClickableNMSPacketEntity.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionClickableNMSPacketEntity.java index 6ce2b64e..8fde7d6b 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionClickableNMSPacketEntity.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionItemNMSPacketEntity.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionItemNMSPacketEntity.java index ec135126..a9bf0767 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionItemNMSPacketEntity.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionTextNMSPacketEntity.java b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionTextNMSPacketEntity.java index 31b490c5..4c45dc58 100644 --- a/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionTextNMSPacketEntity.java +++ b/nms/v1_13_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_13_R2/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionClickableNMSPacketEntity.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionClickableNMSPacketEntity.java index 8d6e2098..1cb75e32 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionClickableNMSPacketEntity.java @@ -26,11 +26,13 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(EntityLivingSpawnNMSPacket.builder(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -40,7 +42,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionItemNMSPacketEntity.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionItemNMSPacketEntity.java index c47fdf17..8667d469 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionItemNMSPacketEntity.java @@ -22,11 +22,13 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(EntityLivingSpawnNMSPacket.builder(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -44,7 +46,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionTextNMSPacketEntity.java b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionTextNMSPacketEntity.java index 585f42da..0ea86bd6 100644 --- a/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_14_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_14_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(EntityLivingSpawnNMSPacket.builder(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ) .setArmorStandMarker() .build() ); @@ -29,7 +30,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(EntityLivingSpawnNMSPacket.builder(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ) .setArmorStandMarker() .setCustomName(text) .build() @@ -40,7 +42,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { packetList.add(new IndividualNMSPacket(player -> EntityLivingSpawnNMSPacket.builder( - armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ) + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ) .setArmorStandMarker() .setCustomName(individualText.get(player)) .build() @@ -65,7 +67,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionClickableNMSPacketEntity.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionClickableNMSPacketEntity.java index bf85a1d7..a22f01e3 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntityLivingSpawnNMSPacket(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(slimeID) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box @@ -42,7 +44,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionItemNMSPacketEntity.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionItemNMSPacketEntity.java index 9922f4f5..92c55414 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionTextNMSPacketEntity.java b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionTextNMSPacketEntity.java index 8a8b5627..d0c71d62 100644 --- a/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_15_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_15_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionClickableNMSPacketEntity.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionClickableNMSPacketEntity.java index 14b0c048..0af429a5 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntityLivingSpawnNMSPacket(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(slimeID) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box @@ -42,7 +44,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionItemNMSPacketEntity.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionItemNMSPacketEntity.java index f23b5182..67ee95fe 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionTextNMSPacketEntity.java b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionTextNMSPacketEntity.java index a2130f3a..52613593 100644 --- a/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_16_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionClickableNMSPacketEntity.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionClickableNMSPacketEntity.java index 3e259270..a9ca4a14 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionClickableNMSPacketEntity.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntityLivingSpawnNMSPacket(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(slimeID) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box @@ -42,7 +44,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionItemNMSPacketEntity.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionItemNMSPacketEntity.java index c929cd3b..21b4c5fc 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionItemNMSPacketEntity.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionTextNMSPacketEntity.java b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionTextNMSPacketEntity.java index db0eb2bc..199db0c5 100644 --- a/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionTextNMSPacketEntity.java +++ b/nms/v1_16_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R2/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionClickableNMSPacketEntity.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionClickableNMSPacketEntity.java index f62246ce..db5ed16d 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionClickableNMSPacketEntity.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntityLivingSpawnNMSPacket(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(slimeID) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box @@ -42,7 +44,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionItemNMSPacketEntity.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionItemNMSPacketEntity.java index ca881740..0e2d8e5a 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionItemNMSPacketEntity.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionTextNMSPacketEntity.java b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionTextNMSPacketEntity.java index 7c4fb151..11532ee8 100644 --- a/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionTextNMSPacketEntity.java +++ b/nms/v1_16_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_16_R3/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionClickableNMSPacketEntity.java b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionClickableNMSPacketEntity.java index 3915f6c5..f1fd8d5a 100644 --- a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionClickableNMSPacketEntity.java +++ b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntityLivingSpawnNMSPacket(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(slimeID) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box @@ -42,7 +44,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionItemNMSPacketEntity.java b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionItemNMSPacketEntity.java index 3a6673ff..85ce85c9 100644 --- a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionItemNMSPacketEntity.java +++ b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntityLivingSpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionTextNMSPacketEntity.java b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionTextNMSPacketEntity.java index de071cb7..1bfeae47 100644 --- a/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionTextNMSPacketEntity.java +++ b/nms/v1_17_r1/src/main/java/me/filoghost/holographicdisplays/nms/v1_17_R1/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntityLivingSpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntityLivingSpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionClickableNMSPacketEntity.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionClickableNMSPacketEntity.java index 2a3603de..6e35e488 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionClickableNMSPacketEntity.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionItemNMSPacketEntity.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionItemNMSPacketEntity.java index 96827b60..908235fb 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionItemNMSPacketEntity.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionTextNMSPacketEntity.java b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionTextNMSPacketEntity.java index 3f10abfd..87905f85 100644 --- a/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionTextNMSPacketEntity.java +++ b/nms/v1_8_r3/src/main/java/me/filoghost/holographicdisplays/nms/v1_8_R3/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionClickableNMSPacketEntity.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionClickableNMSPacketEntity.java index e1cd6ecb..e7c08bc0 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionClickableNMSPacketEntity.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionClickableNMSPacketEntity.java @@ -26,12 +26,14 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + SLIME_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(EntityLivingSpawnNMSPacket.builder(slimeID, EntityTypeID.SLIME, positionX, positionY, positionZ) + packetList.add(EntityLivingSpawnNMSPacket.builder( + slimeID, EntityTypeID.SLIME, positionX, positionY + SLIME_Y_OFFSET, positionZ) .setInvisible() .setSlimeSmall() // Required for a correct client-side collision box .build() @@ -41,7 +43,7 @@ public class VersionClickableNMSPacketEntity implements ClickableNMSPacketEntity @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + SLIME_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionItemNMSPacketEntity.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionItemNMSPacketEntity.java index 344da636..4d7cc9ea 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionItemNMSPacketEntity.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionItemNMSPacketEntity.java @@ -22,12 +22,14 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, ItemStack itemStack) { - packetList.add(new EntitySpawnNMSPacket(vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + vehicleID, EntityTypeID.ARMOR_STAND, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(vehicleID) .setArmorStandMarker() .build() ); - packetList.add(new EntitySpawnNMSPacket(itemID, EntityTypeID.ITEM, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + itemID, EntityTypeID.ITEM, positionX, positionY + ITEM_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(itemID) .setItemStack(itemStack) .build() @@ -45,7 +47,7 @@ public class VersionItemNMSPacketEntity implements ItemNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(vehicleID, positionX, positionY + ITEM_Y_OFFSET, positionZ)); } @Override diff --git a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionTextNMSPacketEntity.java b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionTextNMSPacketEntity.java index 5fa61273..0baf9ceb 100644 --- a/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionTextNMSPacketEntity.java +++ b/nms/v1_9_r2/src/main/java/me/filoghost/holographicdisplays/nms/v1_9_R2/VersionTextNMSPacketEntity.java @@ -21,7 +21,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .build() @@ -30,7 +31,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ, String text) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(text) @@ -41,7 +43,8 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addSpawnPackets( NMSPacketList packetList, double positionX, double positionY, double positionZ, IndividualText individualText) { - packetList.add(new EntitySpawnNMSPacket(armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY, positionZ)); + packetList.add(new EntitySpawnNMSPacket( + armorStandID, EntityTypeID.ARMOR_STAND, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); packetList.add(new IndividualNMSPacket(player -> EntityMetadataNMSPacket.builder(armorStandID) .setArmorStandMarker() .setCustomName(individualText.get(player)) @@ -67,7 +70,7 @@ class VersionTextNMSPacketEntity implements TextNMSPacketEntity { @Override public void addTeleportPackets(NMSPacketList packetList, double positionX, double positionY, double positionZ) { - packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY, positionZ)); + packetList.add(new EntityTeleportNMSPacket(armorStandID, positionX, positionY + ARMOR_STAND_Y_OFFSET, positionZ)); } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseItemLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseItemLine.java index 81ef63a1..c5b9e89d 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseItemLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseItemLine.java @@ -8,6 +8,7 @@ package me.filoghost.holographicdisplays.plugin.hologram.base; import me.filoghost.fcommons.Preconditions; import me.filoghost.fcommons.logging.Log; import me.filoghost.holographicdisplays.api.hologram.PickupListener; +import me.filoghost.holographicdisplays.common.nms.entity.ItemNMSPacketEntity; import me.filoghost.holographicdisplays.plugin.hologram.tracking.ItemLineTracker; import me.filoghost.holographicdisplays.plugin.hologram.tracking.LineTrackerManager; import org.bukkit.entity.Player; @@ -75,7 +76,7 @@ public abstract class BaseItemLine extends BaseClickableLine { @Override public double getHeight() { - return 0.7; + return ItemNMSPacketEntity.ITEM_HEIGHT; } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseTextLine.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseTextLine.java index 3f841a59..dfe36c7f 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseTextLine.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/base/BaseTextLine.java @@ -5,6 +5,7 @@ */ package me.filoghost.holographicdisplays.plugin.hologram.base; +import me.filoghost.holographicdisplays.common.nms.entity.TextNMSPacketEntity; import me.filoghost.holographicdisplays.plugin.hologram.tracking.LineTrackerManager; import me.filoghost.holographicdisplays.plugin.hologram.tracking.TextLineTracker; import org.jetbrains.annotations.Nullable; @@ -38,7 +39,7 @@ public abstract class BaseTextLine extends BaseClickableLine { @Override public double getHeight() { - return 0.23; + return TextNMSPacketEntity.ARMOR_STAND_TEXT_HEIGHT; } @Override diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ClickableLineTracker.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ClickableLineTracker.java index b101d3d9..dc9fdc88 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ClickableLineTracker.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ClickableLineTracker.java @@ -14,8 +14,6 @@ import org.jetbrains.annotations.MustBeInvokedByOverriders; public abstract class ClickableLineTracker extends PositionBasedLineTracker { - private static final double CLICKABLE_ENTITY_HEIGHT = 0.5; - private final ClickableNMSPacketEntity clickableEntity; private final LineClickListener lineClickListener; @@ -98,7 +96,7 @@ public abstract class ClickableLineTracker extends } private double getClickablePositionY() { - return positionY + ((line.getHeight() - CLICKABLE_ENTITY_HEIGHT) / 2); + return positionY + ((line.getHeight() - ClickableNMSPacketEntity.SLIME_HEIGHT) / 2); } } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ItemLineTracker.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ItemLineTracker.java index f7eec2f2..d157c1da 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ItemLineTracker.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/ItemLineTracker.java @@ -83,7 +83,7 @@ public class ItemLineTracker extends ClickableLineTracker { super.addSpawnPackets(packetList); if (spawnItemEntity) { - itemEntity.addSpawnPackets(packetList, positionX, getItemPositionY(), positionZ, itemStack); + itemEntity.addSpawnPackets(packetList, positionX, positionY, positionZ, itemStack); } } @@ -104,7 +104,7 @@ public class ItemLineTracker extends ClickableLineTracker { if (spawnItemEntityChanged) { if (spawnItemEntity) { - itemEntity.addSpawnPackets(packetList, positionX, getItemPositionY(), positionZ, itemStack); + itemEntity.addSpawnPackets(packetList, positionX, positionY, positionZ, itemStack); } else { itemEntity.addDestroyPackets(packetList); } @@ -120,12 +120,8 @@ public class ItemLineTracker extends ClickableLineTracker { super.addPositionChangePackets(packetList); if (spawnItemEntity) { - itemEntity.addTeleportPackets(packetList, positionX, getItemPositionY(), positionZ); + itemEntity.addTeleportPackets(packetList, positionX, positionY, positionZ); } } - private double getItemPositionY() { - return positionY; - } - } diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/TextLineTracker.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/TextLineTracker.java index 137cef5c..a02efd5c 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/TextLineTracker.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/hologram/tracking/TextLineTracker.java @@ -77,14 +77,11 @@ public class TextLineTracker extends ClickableLineTracker { super.addSpawnPackets(packetList); if (!allowPlaceholders) { - textEntity.addSpawnPackets( - packetList, positionX, getTextPositionY(), positionZ, displayText.getWithoutReplacements()); + textEntity.addSpawnPackets(packetList, positionX, positionY, positionZ, displayText.getWithoutReplacements()); } else if (displayText.containsIndividualPlaceholders()) { - textEntity.addSpawnPackets( - packetList, positionX, getTextPositionY(), positionZ, displayText::getWithIndividualReplacements); + textEntity.addSpawnPackets(packetList, positionX, positionY, positionZ, displayText::getWithIndividualReplacements); } else { - textEntity.addSpawnPackets( - packetList, positionX, getTextPositionY(), positionZ, displayText.getWithGlobalReplacements()); + textEntity.addSpawnPackets(packetList, positionX, positionY, positionZ, displayText.getWithGlobalReplacements()); } } @@ -114,11 +111,7 @@ public class TextLineTracker extends ClickableLineTracker { @Override protected void addPositionChangePackets(NMSPacketList packetList) { super.addPositionChangePackets(packetList); - textEntity.addTeleportPackets(packetList, positionX, getTextPositionY(), positionZ); - } - - private double getTextPositionY() { - return positionY - 0.29; + textEntity.addTeleportPackets(packetList, positionX, positionY, positionZ); } }