From 436b4eba76ca2bdf0ea553e98f8aae75576f50cf Mon Sep 17 00:00:00 2001 From: mcmonkey Date: Fri, 4 Jan 2019 13:24:52 -0800 Subject: [PATCH] reduce code dup and misplacement issues with SittingTrait --- .../net/aufdemrand/denizen/npc/traits/SittingTrait.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/plugin/src/main/java/net/aufdemrand/denizen/npc/traits/SittingTrait.java b/plugin/src/main/java/net/aufdemrand/denizen/npc/traits/SittingTrait.java index 29bf833045..fb2c687a1a 100644 --- a/plugin/src/main/java/net/aufdemrand/denizen/npc/traits/SittingTrait.java +++ b/plugin/src/main/java/net/aufdemrand/denizen/npc/traits/SittingTrait.java @@ -78,14 +78,13 @@ public void onDespawn() { * Makes the NPC sit */ public void sit() { - if (!npc.isSpawned() || npc.getEntity().getType() != EntityType.PLAYER) { + if (!npc.isSpawned()) { return; } DenizenAPI.getDenizenNPC(npc).action("sit", null); - chairLocation = npc.getEntity().getLocation().clone(); - sitInternal(); + sit(npc.getEntity().getLocation()); } private void sitInternal() { @@ -120,10 +119,6 @@ private void standInternal() { public void sitInternal(Location location) { DenizenAPI.getDenizenNPC(npc).action("sit", null); - if (npc.getEntity().getType() != EntityType.PLAYER) { - return; - } - /* * Teleport NPC to the location before * sending the sit packet to the clients.