Fix the unjailing not working, was messed up when we switch to UUIDs
This commit is contained in:
parent
b83d1245f8
commit
5c4122ee92
@ -179,6 +179,7 @@ public class JailManager {
|
|||||||
* @return The same object given
|
* @return The same object given
|
||||||
*/
|
*/
|
||||||
public CachePrisoner addCacheObject(CachePrisoner cache) {
|
public CachePrisoner addCacheObject(CachePrisoner cache) {
|
||||||
|
plugin.debug("Adding " + cache.getPrisoner().getUUID().toString() + " to the cache.");
|
||||||
this.cache.put(cache.getPrisoner().getUUID(), cache);
|
this.cache.put(cache.getPrisoner().getUUID(), cache);
|
||||||
return cache;
|
return cache;
|
||||||
}
|
}
|
||||||
@ -209,6 +210,7 @@ public class JailManager {
|
|||||||
* @param uuid of the prisoner to remove
|
* @param uuid of the prisoner to remove
|
||||||
*/
|
*/
|
||||||
public void removeCacheObject(UUID uuid) {
|
public void removeCacheObject(UUID uuid) {
|
||||||
|
plugin.debug("Removing " + uuid.toString() + " from the cache.");
|
||||||
this.cache.remove(uuid);
|
this.cache.remove(uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ public class Jail {
|
|||||||
|
|
||||||
/** Removes a prisoner from this jail, doesn't remove it from the cell. */
|
/** Removes a prisoner from this jail, doesn't remove it from the cell. */
|
||||||
public void removePrisoner(Prisoner p) {
|
public void removePrisoner(Prisoner p) {
|
||||||
this.nocellPrisoners.remove(p);
|
this.nocellPrisoners.remove(p.getUUID());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Adds a cell to the Jail. */
|
/** Adds a cell to the Jail. */
|
||||||
|
@ -29,8 +29,8 @@ public class MoveProtectionListener implements Listener {
|
|||||||
if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {
|
if(pl.getConfig().getBoolean(Settings.MOVEPROTECTION.getPath())) {
|
||||||
//Let's be sure the player we're dealing with is in jail
|
//Let's be sure the player we're dealing with is in jail
|
||||||
|
|
||||||
CachePrisoner cp = pl.getJailManager().getCacheObject(event.getPlayer().getUniqueId());
|
if(pl.getJailManager().inCache(event.getPlayer().getUniqueId())) {
|
||||||
if(cp != null) {
|
CachePrisoner cp = pl.getJailManager().getCacheObject(event.getPlayer().getUniqueId());
|
||||||
Jail j = cp.getJail();
|
Jail j = cp.getJail();
|
||||||
Prisoner p = cp.getPrisoner();
|
Prisoner p = cp.getPrisoner();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user