Fix phantom removal upon their death (no EXP). Relase 1.0.1

No snapshot version 1.1 yet.
This commit is contained in:
Simon Chuu 2018-08-11 03:42:00 -04:00
parent 4efb83aa79
commit 54c03e40db
2 changed files with 8 additions and 13 deletions

View File

@ -5,7 +5,7 @@ plugins {
}
group 'com.simonorj.mc.phantomsmp'
version '1.1-SNAPSHOT'
version '1.0.1'
sourceCompatibility = 1.8

View File

@ -86,17 +86,6 @@ public class PhantomSMP extends JavaPlugin {
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<Phantom> i = playerPhantomMap.get(p).iterator();
while(i.hasNext()) {
@ -184,7 +173,13 @@ public class PhantomSMP extends JavaPlugin {
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);
}
}
}