Fix loading NPCs from database

This commit is contained in:
Sam 2017-09-02 00:43:14 +01:00
parent 87b977706d
commit 64065f432c
3 changed files with 4 additions and 5 deletions

View File

@ -44,7 +44,6 @@ public class NPCBuilder
npc = new PlayerNPC(
-1,
EntityType.ARMOR_STAND,
_name,
location,
inHand,

View File

@ -62,9 +62,9 @@ class NewNPCRepository extends RepositoryBase
continue;
}
if (skinValue != null && skinSignature != null)
if (entityType == EntityType.PLAYER)
{
npc = new PlayerNPC(id, entityType, name, new Location(world, x, y, z, yaw, pitch), inHand, helmet, chestplate, leggings, boots, metadata, skinValue, skinSignature);
npc = new PlayerNPC(id, name, new Location(world, x, y, z, yaw, pitch), inHand, helmet, chestplate, leggings, boots, metadata, skinValue, skinSignature);
}
else
{

View File

@ -28,9 +28,9 @@ public class PlayerNPC extends NPC
private DisguisePlayer _disguise;
public PlayerNPC(int id, EntityType entityType, String name, Location spawn, Material inHand, Material helmet, Material chestplate, Material leggings, Material boots, String metadata, String skinValue, String skinSignature)
public PlayerNPC(int id, String name, Location spawn, Material inHand, Material helmet, Material chestplate, Material leggings, Material boots, String metadata, String skinValue, String skinSignature)
{
super(id, entityType, name, spawn, inHand, helmet, chestplate, leggings, boots, metadata);
super(id, EntityType.ARMOR_STAND, name, spawn, inHand, helmet, chestplate, leggings, boots, metadata);
_skinData = new SkinData(skinValue, skinSignature);
}