Fix the unjailing not working, was messed up when we switch to UUIDs

This commit is contained in:
graywolf336 2014-07-14 21:55:01 -05:00
parent b83d1245f8
commit 5c4122ee92
3 changed files with 5 additions and 3 deletions

View File

@ -179,6 +179,7 @@ public class JailManager {
* @return The same object given
*/
public CachePrisoner addCacheObject(CachePrisoner cache) {
plugin.debug("Adding " + cache.getPrisoner().getUUID().toString() + " to the cache.");
this.cache.put(cache.getPrisoner().getUUID(), cache);
return cache;
}
@ -209,6 +210,7 @@ public class JailManager {
* @param uuid of the prisoner to remove
*/
public void removeCacheObject(UUID uuid) {
plugin.debug("Removing " + uuid.toString() + " from the cache.");
this.cache.remove(uuid);
}

View File

@ -139,7 +139,7 @@ public class Jail {
/** Removes a prisoner from this jail, doesn't remove it from the cell. */
public void removePrisoner(Prisoner p) {
this.nocellPrisoners.remove(p);
this.nocellPrisoners.remove(p.getUUID());
}
/** Adds a cell to the Jail. */

View File

@ -29,8 +29,8 @@ public class MoveProtectionListener implements Listener {
if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {
//Let's be sure the player we're dealing with is in jail
CachePrisoner cp = pl.getJailManager().getCacheObject(event.getPlayer().getUniqueId());
if(cp != null) {
if(pl.getJailManager().inCache(event.getPlayer().getUniqueId())) {
CachePrisoner cp = pl.getJailManager().getCacheObject(event.getPlayer().getUniqueId());
Jail j = cp.getJail();
Prisoner p = cp.getPrisoner();