use of net.minecraft.server.v1_12_R1.EnumItemSlot in project Citizens2 by CitizensDev.
the class EntityHumanNPC method updatePackets.
private void updatePackets(boolean navigating) {
if (updateCounter++ <= Setting.PACKET_UPDATE_DELAY.asInt())
return;
updateCounter = 0;
Location current = getBukkitEntity().getLocation(packetLocationCache);
Packet<?>[] packets = new Packet[navigating ? EnumItemSlot.values().length : EnumItemSlot.values().length + 1];
if (!navigating) {
packets[5] = new PacketPlayOutEntityHeadRotation(this, (byte) MathHelper.d(NMSImpl.getHeadYaw(this) * 256.0F / 360.0F));
}
int i = 0;
for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
}
NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
}
use of net.minecraft.server.v1_12_R1.EnumItemSlot in project Citizens2 by CitizensDev.
the class EntityHumanNPC method updatePackets.
private void updatePackets(boolean navigating) {
if (updateCounter++ <= Setting.PACKET_UPDATE_DELAY.asInt())
return;
updateCounter = 0;
Location current = getBukkitEntity().getLocation(packetLocationCache);
Packet<?>[] packets = new Packet[navigating ? EnumItemSlot.values().length : EnumItemSlot.values().length + 1];
if (!navigating) {
packets[5] = new PacketPlayOutEntityHeadRotation(this, (byte) MathHelper.d(NMSImpl.getHeadYaw(this) * 256.0F / 360.0F));
}
int i = 0;
for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
}
NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
}
use of net.minecraft.server.v1_12_R1.EnumItemSlot in project Citizens2 by CitizensDev.
the class EntityHumanNPC method updatePackets.
private void updatePackets(boolean navigating) {
if (updateCounter++ <= Setting.PACKET_UPDATE_DELAY.asInt())
return;
updateCounter = 0;
Location current = getBukkitEntity().getLocation(packetLocationCache);
Packet<?>[] packets = new Packet[navigating ? EnumItemSlot.values().length : EnumItemSlot.values().length + 1];
if (!navigating) {
packets[5] = new PacketPlayOutEntityHeadRotation(this, (byte) MathHelper.d(NMSImpl.getHeadYaw(this) * 256.0F / 360.0F));
}
int i = 0;
for (EnumItemSlot slot : EnumItemSlot.values()) {
packets[i++] = new PacketPlayOutEntityEquipment(getId(), slot, getEquipment(slot));
}
NMSImpl.sendPacketsNearby(getBukkitEntity(), current, packets);
}
Aggregations