From a2a6e39db9a146492ed64125d0753e14e831ca78 Mon Sep 17 00:00:00 2001 From: Jerom van der Sar Date: Mon, 10 Jun 2013 08:24:53 +0200 Subject: [PATCH] Minor changes, added /creative -a, formatting fixes, updated version number --- appinfo.properties | 8 ++-- buildnumber.properties | 4 +- src/config.yml | 2 +- .../Commands/Command_creative.java | 36 ++++++++++++---- .../Commands/Command_survival.java | 42 +++++++++---------- src/permban.yml | 1 + src/plugin.yml | 2 +- src/superadmin.yml | 2 +- 8 files changed, 56 insertions(+), 41 deletions(-) diff --git a/appinfo.properties b/appinfo.properties index 3d401e61..8813518e 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,5 +1,5 @@ -#Mon, 03 Jun 2013 23:06:55 +0200 +#Mon, 03 Jun 2013 23:08:42 +0200 -program.VERSION=2.17 -program.BUILDNUM=214 -program.BUILDDATE=06/03/2013 11\:06 PM +program.VERSION=2.18 +program.BUILDNUM=216 +program.BUILDDATE=06/03/2013 11\:08 PM diff --git a/buildnumber.properties b/buildnumber.properties index 039ae3cf..f9e3d172 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Mon Jun 03 23:06:55 CEST 2013 -build.number=215 +#Mon Jun 03 23:08:42 CEST 2013 +build.number=217 diff --git a/src/config.yml b/src/config.yml index 6059ae9c..a9a2ce17 100644 --- a/src/config.yml +++ b/src/config.yml @@ -1,4 +1,4 @@ -# TotalFreedomMod v2.17 Configuration +# TotalFreedomMod v2.18 Configuration # by Madgeek1450 and DarthSalamon # Block placement prevention: diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java index 057e43fa..1d1fd608 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_creative.java @@ -1,6 +1,8 @@ package me.StevenLawson.TotalFreedomMod.Commands; import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; +import me.StevenLawson.TotalFreedomMod.TFM_Util; +import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; @@ -29,23 +31,39 @@ public class Command_creative extends TFM_Command } else { - if (senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender)) + if (args[0].equalsIgnoreCase("-a")) { - try + if (!TFM_SuperadminList.isUserSuperadmin(sender)) + { + sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); + return true; + } + + for (Player player : server.getOnlinePlayers()) { - p = getPlayer(args[0]); - } - catch (CantFindPlayerException ex) - { - sender.sendMessage(ex.getMessage()); - return true; + player.setGameMode(GameMode.CREATIVE); } + + TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to creative", false); + return true; } - else + + if (!(senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender))) { playerMsg("Only superadmins can change other user's gamemode."); return true; } + + try + { + p = getPlayer(args[0]); + } + catch (CantFindPlayerException ex) + { + sender.sendMessage(ex.getMessage()); + return true; + } + } playerMsg("Setting " + p.getName() + " to game mode 'Creative'."); diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java index 5e36465b..7b835d4f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_survival.java @@ -1,6 +1,7 @@ package me.StevenLawson.TotalFreedomMod.Commands; import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList; +import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -10,7 +11,7 @@ import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @CommandPermissions(level = AdminLevel.OP, source = SourceType.BOTH) -@CommandParameters(description = "Quickly change your own gamemode to survival, or define someone's username to change theirs.", usage = "/ [partialname]") +@CommandParameters(description = "Quickly change your own gamemode to survival, or define someone's username to change theirs.", usage = "/ <[partialname] | -a>") public class Command_survival extends TFM_Command { @Override @@ -26,28 +27,6 @@ public class Command_survival extends TFM_Command } Player p; - p = sender_p; - if (args.length != 0){ - if (args[0].equalsIgnoreCase("-a")) - { - if (!TFM_SuperadminList.isUserSuperadmin(sender)) - { - sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); - return true; - } - - for (Player player : server.getOnlinePlayers()) - { - if(!TFM_SuperadminList.isUserSuperadmin(p)) - { - player.setGameMode(GameMode.SURVIVAL); - } - } - - Bukkit.broadcastMessage(ChatColor.AQUA + sender.getName() + " - Setting all non-admins gamemode to survival."); - return true; - } - } if (args.length == 0) { @@ -55,6 +34,23 @@ public class Command_survival extends TFM_Command } else { + if (args[0].equalsIgnoreCase("-a")) + { + if (!TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole) + { + sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); + return true; + } + + for (Player player : server.getOnlinePlayers()) + { + player.setGameMode(GameMode.SURVIVAL); + } + + TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false); + return true; + } + if (senderIsConsole || TFM_SuperadminList.isUserSuperadmin(sender)) { try diff --git a/src/permban.yml b/src/permban.yml index c763eb1b..329e3dc9 100644 --- a/src/permban.yml +++ b/src/permban.yml @@ -7,3 +7,4 @@ badplayer1: - 321.321.321.321 badplayer2: - 111.111.111.111 +badplayer3: [] diff --git a/src/plugin.yml b/src/plugin.yml index 322dfcc8..db4e3e52 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod -version: 2.17 +version: 2.18 description: Plugin for the Total Freedom server. authors: [StevenLawson / Madgeek1450, JeromSar / DarthSalamon] diff --git a/src/superadmin.yml b/src/superadmin.yml index 02dbfaf3..b98880aa 100644 --- a/src/superadmin.yml +++ b/src/superadmin.yml @@ -15,7 +15,7 @@ superadmins: - 127.0.0.1 - 8.8.8.8 last_login: Sun, 11 Nov 2012 01:09:14 -0500 - custom_login_message: the &5Chief-Developer&b and &6Master-ass-kicker&b. + custom_login_message: the &4Co-Founder&b and &6Master-ass-kicker&b. is_senior_admin: true console_aliases: - madgeek