From 1f32455e06696f1fb865b6a440e3c2ec17c335ca Mon Sep 17 00:00:00 2001 From: Steven Lawson Date: Fri, 23 Aug 2013 16:59:31 -0400 Subject: [PATCH] A few more adminworld checks. --- .../Commands/Command_adminworld.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminworld.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminworld.java index 391241c2..8890a9ee 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminworld.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_adminworld.java @@ -54,6 +54,11 @@ public class Command_adminworld extends TFM_Command { case TELEPORT: { + if (!(sender instanceof Player) || sender_p == null) + { + return true; + } + World adminWorld = null; try { @@ -70,8 +75,15 @@ public class Command_adminworld extends TFM_Command } else { - playerMsg("Going to the AdminWorld."); - TFM_AdminWorld.getInstance().sendToWorld(sender_p); + if (TFM_AdminWorld.getInstance().canAccessWorld(sender_p)) + { + playerMsg("Going to the AdminWorld."); + TFM_AdminWorld.getInstance().sendToWorld(sender_p); + } + else + { + playerMsg("You don't have permission to access the AdminWorld."); + } } break;