Allow portal rescue feature to work regardless if claims are enabled in the world

Seems like this check was intended for the
"portalCreationRequiresPermission," so when he threw in the portal trap
check, he didn't account for this check possibly breaking in worlds
where claims aren't enabled.
This commit is contained in:
RoboMWM 2016-10-02 01:59:30 -07:00
parent c4fcc327fa
commit b7162823e8
2 changed files with 6 additions and 6 deletions

View File

@ -3658,8 +3658,8 @@ public class GriefPrevention extends JavaPlugin
//Cancel existing rescue task //Cancel existing rescue task
if (portalReturnTaskMap.containsKey(player.getUniqueId())) if (portalReturnTaskMap.containsKey(player.getUniqueId()))
portalReturnTaskMap.get(player.getUniqueId()).cancel(); portalReturnTaskMap.put(player.getUniqueId(), task).cancel();
else
portalReturnTaskMap.put(player.getUniqueId(), task); portalReturnTaskMap.put(player.getUniqueId(), task);
} }
} }

View File

@ -974,14 +974,14 @@ class PlayerEventHandler implements Listener
//if the player isn't going anywhere, take no action //if the player isn't going anywhere, take no action
if(event.getTo() == null || event.getTo().getWorld() == null) return; if(event.getTo() == null || event.getTo().getWorld() == null) return;
//don't track in worlds where claims are not enabled
if(!GriefPrevention.instance.claimsEnabledForWorld(event.getTo().getWorld())) return;
Player player = event.getPlayer(); Player player = event.getPlayer();
if(event.getCause() == TeleportCause.NETHER_PORTAL) if(event.getCause() == TeleportCause.NETHER_PORTAL)
{ {
//FEATURE: when players get trapped in a nether portal, send them back through to the other side //FEATURE: when players get trapped in a nether portal, send them back through to the other side
instance.startRescueTask(player); instance.startRescueTask(player);
//don't track in worlds where claims are not enabled
if(!GriefPrevention.instance.claimsEnabledForWorld(event.getTo().getWorld())) return;
//FEATURE: if the player teleporting doesn't have permission to build a nether portal and none already exists at the destination, cancel the teleportation //FEATURE: if the player teleporting doesn't have permission to build a nether portal and none already exists at the destination, cancel the teleportation
if(GriefPrevention.instance.config_claims_portalsRequirePermission) if(GriefPrevention.instance.config_claims_portalsRequirePermission)