diff --git a/build.gradle b/build.gradle index 5523be7..c13883d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { } group 'com.simonorj.mc.phantomsmp' -version '1.1-SNAPSHOT' +version '1.0.1' sourceCompatibility = 1.8 diff --git a/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java b/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java index fc9e393..3ef5b19 100644 --- a/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java +++ b/src/main/java/com/simonorj/mc/phantomsmp/PhantomSMP.java @@ -86,17 +86,6 @@ private void addPhantom(Phantom phantom, Player newTarget, Cancellable e) { phantomPlayerMap.put(phantom, p); } - private void removePhantom(Phantom phantom) { - Player p = phantomPlayerMap.remove(phantom); - if (p == null) - return; - - playerPhantomMap.get(p).remove(phantom); - - if (phantom.getCustomName() == null) - phantom.remove(); - } - private void removePlayerPhantom(Player p) { Iterator i = playerPhantomMap.get(p).iterator(); while(i.hasNext()) { @@ -184,7 +173,13 @@ public void phantomDied(EntityDeathEvent e) { if (!(e.getEntity() instanceof Phantom)) return; - removePhantom((Phantom) e.getEntity()); + Phantom phantom = (Phantom) e.getEntity(); + + Player p = phantomPlayerMap.remove(phantom); + if (p == null) + return; + + playerPhantomMap.get(p).remove(phantom); } } }