mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-04-09 21:56:20 +02:00
Fix CITIZENS-454
This commit is contained in:
parent
f523f375b6
commit
b6983ead75
@ -32,8 +32,9 @@ import org.bukkit.plugin.Plugin;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||||
|
private final Location cachedEquipmentLocation = new Location(null, 0, 0, 0);
|
||||||
|
|
||||||
private final CitizensNPC npc;
|
private final CitizensNPC npc;
|
||||||
private final net.minecraft.server.v1_4_R1.ItemStack[] previousEquipment = { null, null, null, null, null };
|
|
||||||
|
|
||||||
public EntityHumanNPC(MinecraftServer minecraftServer, World world, String string,
|
public EntityHumanNPC(MinecraftServer minecraftServer, World world, String string,
|
||||||
PlayerInteractManager playerInteractManager, NPC npc) {
|
PlayerInteractManager playerInteractManager, NPC npc) {
|
||||||
@ -181,13 +182,9 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateEquipment() {
|
private void updateEquipment() {
|
||||||
for (int i = 0; i < previousEquipment.length; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
net.minecraft.server.v1_4_R1.ItemStack previous = previousEquipment[i];
|
NMS.sendPacketNearby(getBukkitEntity().getLocation(cachedEquipmentLocation), new Packet5EntityEquipment(id,
|
||||||
net.minecraft.server.v1_4_R1.ItemStack current = getEquipment(i);
|
i, getEquipment(i)));
|
||||||
if (previous != current) {
|
|
||||||
NMS.sendPacketNearby(getBukkitEntity().getLocation(), new Packet5EntityEquipment(id, i, current));
|
|
||||||
previousEquipment[i] = current;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user