From 5838eb23ffdff6b654c8100498b3f9a550070817 Mon Sep 17 00:00:00 2001 From: Steven Lawson Date: Sat, 28 Jul 2012 19:08:44 -0400 Subject: [PATCH] Made isUserSuperadmin simpler. --- appinfo.properties | 6 ++-- buildnumber.properties | 4 +-- .../Commands/Command_cage.java | 2 +- .../Commands/Command_cake.java | 2 +- .../Commands/Command_creative.java | 2 +- .../Commands/Command_deopall.java | 2 +- .../Commands/Command_ender.java | 2 +- .../Commands/Command_expel.java | 2 +- .../Commands/Command_explosives.java | 2 +- .../Commands/Command_fireplace.java | 2 +- .../Commands/Command_firespread.java | 2 +- .../Commands/Command_fluidspread.java | 2 +- .../TotalFreedomMod/Commands/Command_fr.java | 2 +- .../Commands/Command_fuckoff.java | 2 +- .../Commands/Command_gadmin.java | 2 +- .../Commands/Command_gcmd.java | 2 +- .../Commands/Command_glist.java | 2 +- .../Commands/Command_gtfo.java | 2 +- .../Commands/Command_kicknoob.java | 2 +- .../Commands/Command_lavadmg.java | 2 +- .../Commands/Command_lavaplace.java | 2 +- .../Commands/Command_nether.java | 2 +- .../Commands/Command_opall.java | 2 +- .../Commands/Command_opme.java | 2 +- .../Commands/Command_orbit.java | 2 +- .../Commands/Command_prelog.java | 2 +- .../Commands/Command_qdeop.java | 2 +- .../TotalFreedomMod/Commands/Command_qop.java | 2 +- .../Commands/Command_setspawnworld.java | 2 +- .../Commands/Command_stop.java | 2 +- .../Commands/Command_survival.java | 2 +- .../Commands/Command_tfbanlist.java | 2 +- .../Commands/Command_tfipbanlist.java | 2 +- .../Commands/Command_waterplace.java | 2 +- .../Commands/Command_wildcard.java | 2 +- .../Listener/TFM_PlayerListener.java | 33 ++++++++++++++++--- .../Listener/TFM_WeatherListener.java | 3 +- .../TotalFreedomMod/TFM_Util.java | 6 ++++ 38 files changed, 75 insertions(+), 43 deletions(-) diff --git a/appinfo.properties b/appinfo.properties index e7f0074..7cccc65 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,5 +1,5 @@ -#Sun, 22 Jul 2012 15:29:37 -0400 +#Sat, 28 Jul 2012 15:17:23 -0400 program.VERSION=2.5 -program.BUILDNUM=68 -program.BUILDDATE=07/22/2012 03\:29 PM +program.BUILDNUM=77 +program.BUILDDATE=07/28/2012 03\:17 PM diff --git a/buildnumber.properties b/buildnumber.properties index f130e8b..bbc1bb6 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jul 22 15:29:37 EDT 2012 -build.number=69 +#Sat Jul 28 15:17:23 EDT 2012 +build.number=78 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java index f89eeb9..ce32621 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cage.java @@ -16,7 +16,7 @@ public class Command_cage extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length == 0) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java index 280f26d..ffd189d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_cake.java @@ -14,7 +14,7 @@ public class Command_cake extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { StringBuilder output = new StringBuilder(); Random randomGenerator = new Random(); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java index 3cce4ba..5472e95 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java @@ -34,7 +34,7 @@ public class Command_creative extends TFM_Command } else { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { try { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java index 02bd84e..c5753f9 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_deopall.java @@ -13,7 +13,7 @@ public class Command_deopall extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (TFM_Util.isUserSuperadmin(sender, plugin) || senderIsConsole) + if (TFM_Util.isUserSuperadmin(sender) || senderIsConsole) { TFM_Util.bcastMsg(String.format("(%s: De-opping all players on server)", sender.getName()), ChatColor.YELLOW); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java index 08d980c..b4b869e 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_ender.java @@ -10,7 +10,7 @@ public class Command_ender extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - TFM_Util.gotoWorld(sender, "the_end"); + TFM_Util.gotoWorld(sender, server.getWorlds().get(0).getName() + "_the_end"); return true; } } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java index b65515a..b863bcc 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_expel.java @@ -17,7 +17,7 @@ public class Command_expel extends TFM_Command { sender.sendMessage(TotalFreedomMod.NOT_FROM_CONSOLE); } - else if (TFM_Util.isUserSuperadmin(sender, plugin)) + else if (TFM_Util.isUserSuperadmin(sender)) { double radius = 50.0; double strength = 100.0; diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java index bcd8a1e..dbbf72b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_explosives.java @@ -11,7 +11,7 @@ public class Command_explosives extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length == 0) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java index 56d47b3..6f29688 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fireplace.java @@ -11,7 +11,7 @@ public class Command_fireplace extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java index 91a0661..d80c209 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_firespread.java @@ -11,7 +11,7 @@ public class Command_firespread extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java index 4bcbf0d..59358e1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fluidspread.java @@ -11,7 +11,7 @@ public class Command_fluidspread extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java index 330d23e..a5c493e 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fr.java @@ -13,7 +13,7 @@ public class Command_fr extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length == 0) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java index 79976c0..84b45a0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_fuckoff.java @@ -18,7 +18,7 @@ public class Command_fuckoff extends TFM_Command return true; } - if (!TFM_Util.isUserSuperadmin(sender, plugin)) + if (!TFM_Util.isUserSuperadmin(sender)) { sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); return true; diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java index 0196dad..a3b2d87 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gadmin.java @@ -20,7 +20,7 @@ public class Command_gadmin extends TFM_Command String mode = args[0].toLowerCase(); - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (mode.equals("list")) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java index faae9bf..fac9b76 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gcmd.java @@ -12,7 +12,7 @@ public class Command_gcmd extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length < 2) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java index d7bb02b..bd651e3 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_glist.java @@ -21,7 +21,7 @@ public class Command_glist extends TFM_Command return false; } - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length == 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java index dea6fff..4a78e5d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_gtfo.java @@ -19,7 +19,7 @@ public class Command_gtfo extends TFM_Command return false; } - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { Player p; try diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java index 77b8362..d668caf 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_kicknoob.java @@ -21,7 +21,7 @@ public class Command_kicknoob extends TFM_Command for (Player p : server.getOnlinePlayers()) { - if (!TFM_Util.isUserSuperadmin(p, plugin)) + if (!TFM_Util.isUserSuperadmin(p)) { p.kickPlayer("Disconnected by admin."); } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java index afa8a22..92c87ea 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavadmg.java @@ -11,7 +11,7 @@ public class Command_lavadmg extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java index b8aa3d1..be5a0e0 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_lavaplace.java @@ -11,7 +11,7 @@ public class Command_lavaplace extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java index aece98b..037be2a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_nether.java @@ -10,7 +10,7 @@ public class Command_nether extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - TFM_Util.gotoWorld(sender, "nether"); + TFM_Util.gotoWorld(sender, server.getWorlds().get(0).getName() + "_nether"); return true; } } diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java index cd99fc3..edfe73a 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opall.java @@ -13,7 +13,7 @@ public class Command_opall extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (TFM_Util.isUserSuperadmin(sender, plugin) || senderIsConsole) + if (TFM_Util.isUserSuperadmin(sender) || senderIsConsole) { TFM_Util.bcastMsg(String.format("(%s: Opping all players on server)", sender.getName()), ChatColor.YELLOW); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java index 354a2ef..6345d4f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_opme.java @@ -16,7 +16,7 @@ public class Command_opme extends TFM_Command { sender.sendMessage(TotalFreedomMod.NOT_FROM_CONSOLE); } - else if (TFM_Util.isUserSuperadmin(sender, plugin)) + else if (TFM_Util.isUserSuperadmin(sender)) { TFM_Util.bcastMsg(String.format("(%s: Opping %s)", sender.getName(), sender.getName()), ChatColor.GRAY); sender.setOp(true); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java index ae69c89..8af074f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_orbit.java @@ -15,7 +15,7 @@ public class Command_orbit extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length == 0) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java index 15fe9b8..9b0a7b1 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_prelog.java @@ -11,7 +11,7 @@ public class Command_prelog extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java index c9c93e9..68680a5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qdeop.java @@ -17,7 +17,7 @@ public class Command_qdeop extends TFM_Command return false; } - if (sender.isOp() || senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (sender.isOp() || senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { boolean matched_player = false; for (Player p : server.matchPlayer(args[0])) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java index f88e779..51c2870 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_qop.java @@ -17,7 +17,7 @@ public class Command_qop extends TFM_Command return false; } - if (sender.isOp() || senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (sender.isOp() || senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { boolean matched_player = false; for (Player p : server.matchPlayer(args[0])) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java index 2bca426..bb35f3e 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_setspawnworld.java @@ -19,7 +19,7 @@ public class Command_setspawnworld extends TFM_Command return true; } - if (!TFM_Util.isUserSuperadmin(sender, plugin)) + if (!TFM_Util.isUserSuperadmin(sender)) { sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); return true; diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java index 7d44d34..c82dd3f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_stop.java @@ -12,7 +12,7 @@ public class Command_stop extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { TFM_Util.bcastMsg("Server is going offline.", ChatColor.GRAY); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java index 119a371..f902bc6 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java @@ -34,7 +34,7 @@ public class Command_survival extends TFM_Command } else { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { try { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java index b3c93b0..daf1a5d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfbanlist.java @@ -16,7 +16,7 @@ public class Command_tfbanlist extends TFM_Command { if (args[0].equalsIgnoreCase("purge")) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { for (OfflinePlayer p : server.getBannedPlayers()) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java index 7ac9d04..d5aff0c 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfipbanlist.java @@ -18,7 +18,7 @@ public class Command_tfipbanlist extends TFM_Command { if (args[0].equalsIgnoreCase("purge")) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { for (String ip : server.getIPBans()) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java index 1806146..7447cb5 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_waterplace.java @@ -11,7 +11,7 @@ public class Command_waterplace extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args.length != 1) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java index 8d291e4..1b807b6 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_wildcard.java @@ -12,7 +12,7 @@ public class Command_wildcard extends TFM_Command @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - if (senderIsConsole || TFM_Util.isUserSuperadmin(sender, plugin)) + if (senderIsConsole || TFM_Util.isUserSuperadmin(sender)) { if (args[0].equals("wildcard")) { diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java index a4b484a..d1dba19 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java @@ -2,6 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Listener; import java.util.Iterator; import java.util.Map.Entry; +import java.util.Random; import java.util.logging.Level; import java.util.logging.Logger; import java.util.regex.Pattern; @@ -24,6 +25,7 @@ public class TFM_PlayerListener implements Listener private final TotalFreedomMod plugin; private static final Logger log = Logger.getLogger("Minecraft"); private final Server server; + private static final Random randomGenerator = new Random(); public TFM_PlayerListener(TotalFreedomMod instance) { @@ -178,7 +180,7 @@ public class TFM_PlayerListener implements Listener boolean do_freeze = false; if (TotalFreedomMod.allPlayersFrozen) { - if (!TFM_Util.isUserSuperadmin(p, plugin)) + if (!TFM_Util.isUserSuperadmin(p)) { do_freeze = true; } @@ -236,6 +238,24 @@ public class TFM_PlayerListener implements Listener } } +// if (p.getItemInHand().getType() == Material.SPECKLED_MELON) +// { +// if (TFM_Util.isUserSuperadmin(p)) +// { +// Location from_pos = event.getFrom().clone(); +// Location to_pos = event.getTo().clone(); +// +// /* +// Block block_pos = user_pos.clone().add(user_pos.getDirection().multiply(-2.0)).getBlock(); +// +// if ((block_pos.isEmpty() || block_pos.isLiquid())) +// { +// block_pos.setTypeIdAndData(Material.WOOL.getId(), DyeColor.values()[randomGenerator.nextInt(DyeColor.values().length)].getData(), false); +// } +// */ +// } +// } + if (TotalFreedomMod.landminesEnabled && TotalFreedomMod.allowExplosions) { Iterator landmines = TFM_LandmineData.landmines.iterator(); @@ -353,21 +373,21 @@ public class TFM_PlayerListener implements Listener //Commands that will auto-kick the user: if (Pattern.compile("^/stop").matcher(command).find()) { - if (!TFM_Util.isUserSuperadmin(p, plugin)) + if (!TFM_Util.isUserSuperadmin(p)) { block_command = true; } } else if (Pattern.compile("^/reload").matcher(command).find()) { - if (!TFM_Util.isUserSuperadmin(p, plugin)) + if (!TFM_Util.isUserSuperadmin(p)) { block_command = true; } } else if (Pattern.compile("^/save-").matcher(command).find()) { - if (!TFM_Util.isUserSuperadmin(p, plugin)) + if (!TFM_Util.isUserSuperadmin(p)) { block_command = true; } @@ -386,6 +406,11 @@ public class TFM_PlayerListener implements Listener p.sendMessage(ChatColor.GRAY + "Server-side time changing is disabled. Please use /ptime to set your own personal time."); block_command = true; } + else if (Pattern.compile("^/md").matcher(command).find()) + { + p.sendMessage(ChatColor.GRAY + "This server now uses DisguiseCraft instead of MobDisguise. Type /d to disguise and /u to undisguise."); + block_command = true; + } } if (block_command) diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_WeatherListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_WeatherListener.java index 78d635c..d4b6c22 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_WeatherListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_WeatherListener.java @@ -5,7 +5,8 @@ import org.bukkit.Server; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.weather.*; +import org.bukkit.event.weather.ThunderChangeEvent; +import org.bukkit.event.weather.WeatherChangeEvent; public class TFM_WeatherListener implements Listener { diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java b/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java index f74ab3f..1cb5c30 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java @@ -246,7 +246,13 @@ public class TFM_Util } } + @Deprecated public static boolean isUserSuperadmin(CommandSender user, TotalFreedomMod tfm) + { + return isUserSuperadmin(user); + } + + public static boolean isUserSuperadmin(CommandSender user) { try {