From 4246149bf2f6b0b8e5d4bbb01169f37292d82bc1 Mon Sep 17 00:00:00 2001 From: dumptruckman Date: Mon, 19 Dec 2011 19:26:32 -0500 Subject: [PATCH] Added checking for gamemode restriction bypass before trying to change gamemode removed unreachable statement. --- .../MultiverseCore/listeners/MVPlayerListener.java | 4 +++- .../onarandombox/MultiverseCore/utils/PermissionTools.java | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 7dcc5f70..f121f556 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -232,7 +232,9 @@ public class MVPlayerListener extends PlayerListener { public void handleGameMode(Player player, MultiverseWorld world) { // We perform this task one tick later to MAKE SURE that the player actually reaches the // destination world, otherwise we'd be changing the player mode if they havent moved anywhere. - this.plugin.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin, new HandleGameMode(player, world), 1L); + if (!this.pt.playerCanIgnoreGameModeRestriction(world, player)) { + Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin, new HandleGameMode(player, world), 1L); + } } private class SpawnNewbie implements Runnable { diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java b/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java index e3471612..b61cac01 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/PermissionTools.java @@ -162,6 +162,5 @@ public class PermissionTools { // or if it was because a world wasn't imported. return true; } - return true; } }