mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-19 23:37:33 +01:00
Refactoring
This commit is contained in:
parent
903c94657b
commit
ec5cf3ca94
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -14,8 +14,6 @@ import org.jetbrains.annotations.MustBeInvokedByOverriders;
|
||||
|
||||
public abstract class ClickableLineTracker<T extends BaseClickableLine> extends PositionBasedLineTracker<T> {
|
||||
|
||||
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<T extends BaseClickableLine> extends
|
||||
}
|
||||
|
||||
private double getClickablePositionY() {
|
||||
return positionY + ((line.getHeight() - CLICKABLE_ENTITY_HEIGHT) / 2);
|
||||
return positionY + ((line.getHeight() - ClickableNMSPacketEntity.SLIME_HEIGHT) / 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ public class ItemLineTracker extends ClickableLineTracker<BaseItemLine> {
|
||||
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<BaseItemLine> {
|
||||
|
||||
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<BaseItemLine> {
|
||||
super.addPositionChangePackets(packetList);
|
||||
|
||||
if (spawnItemEntity) {
|
||||
itemEntity.addTeleportPackets(packetList, positionX, getItemPositionY(), positionZ);
|
||||
itemEntity.addTeleportPackets(packetList, positionX, positionY, positionZ);
|
||||
}
|
||||
}
|
||||
|
||||
private double getItemPositionY() {
|
||||
return positionY;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -77,14 +77,11 @@ public class TextLineTracker extends ClickableLineTracker<BaseTextLine> {
|
||||
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<BaseTextLine> {
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user