From ccb96ead1066f81bd9123cc3404793e6afbc8a09 Mon Sep 17 00:00:00 2001 From: "main()" Date: Sat, 25 Feb 2012 13:11:21 +0100 Subject: [PATCH] Nasty bugs are nasty. --- .../onarandombox/MultiverseCore/listeners/MVPlayerListener.java | 2 +- .../onarandombox/MultiverseCore/test/TestWorldProperties.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java index 9e80440c..5ba5eddc 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java +++ b/src/main/java/com/onarandombox/MultiverseCore/listeners/MVPlayerListener.java @@ -135,7 +135,7 @@ public class MVPlayerListener implements Listener { return; } else { this.plugin.log(Level.FINER, "Player joined AGAIN!"); - if (!this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + p.getWorld(), false)) { + if (!this.plugin.getMVPerms().hasPermission(p, "multiverse.access." + p.getWorld().getName(), false)) { p.sendMessage("[MV] - Sorry you can't be in this world anymore!"); this.sendPlayerToDefaultWorld(p); } diff --git a/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldProperties.java b/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldProperties.java index b53ffeaa..72c3abfa 100644 --- a/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldProperties.java +++ b/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldProperties.java @@ -308,6 +308,7 @@ public class TestWorldProperties { mockPlayer = mock(Player.class); when(mockPlayer.getWorld()).thenReturn(mvWorld.getCBWorld()); when(mockPlayer.hasPlayedBefore()).thenReturn(true); + when(mockPlayer.hasPermission("multiverse.access.world")).thenReturn(true); playerChatEvent = PowerMockito.mock(PlayerChatEvent.class); when(playerChatEvent.getPlayer()).thenReturn(mockPlayer); when(playerChatEvent.getFormat()).thenReturn("format");