Remove debug code + Unset phantom target on death/bed usage as opposed to removing them

This commit is contained in:
Simon Chuu 2018-08-11 00:51:19 -04:00
parent 983aa2a3df
commit 728493b9c7

View File

@ -89,8 +89,6 @@ public class PhantomSMP extends JavaPlugin {
// Player rested before // Player rested before
if (!phantomSpawnAllowed(p)) { if (!phantomSpawnAllowed(p)) {
getLogger().info("Removed illegally targeting phantom");
Thread.dumpStack();
if (e != null) if (e != null)
e.setCancelled(true); e.setCancelled(true);
// TODO: Quesiton: Also remove the phantom? // TODO: Quesiton: Also remove the phantom?
@ -119,7 +117,7 @@ public class PhantomSMP extends JavaPlugin {
Phantom phantom = i.next(); Phantom phantom = i.next();
if (phantom.getTarget() == p) { if (phantom.getTarget() == p) {
phantomPlayerMap.remove(phantom); phantomPlayerMap.remove(phantom);
phantom.remove(); phantom.setTarget(null);
} }
i.remove(); i.remove();
} }