From 53614d174ebf3edf2daa02c89271a9c4859f429a Mon Sep 17 00:00:00 2001 From: Jerom van der Sar Date: Sat, 13 Jul 2013 12:49:53 +0200 Subject: [PATCH 1/7] Dry - Fixed all commands having a default '/' alias. --- appinfo.properties | 6 +++--- buildnumber.properties | 4 ++-- .../TotalFreedomMod/Commands/TFM_CommandLoader.java | 2 +- src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java | 8 +------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/appinfo.properties b/appinfo.properties index 0eae0baf..56169aee 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,6 +1,6 @@ -#Wed, 10 Jul 2013 23:58:09 +0200 +#Sat, 13 Jul 2013 12:48:46 +0200 program.VERSION=2.21 -program.BUILDNUM=301 -program.BUILDDATE=07/10/2013 11\:58 PM +program.BUILDNUM=306 +program.BUILDDATE=07/13/2013 12\:48 PM diff --git a/buildnumber.properties b/buildnumber.properties index 624e87d0..39e88ced 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Wed Jul 10 23:58:09 CEST 2013 -build.number=302 +#Sat Jul 13 12:48:46 CEST 2013 +build.number=307 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_CommandLoader.java b/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_CommandLoader.java index 2f874683..2c26cdea 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_CommandLoader.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/TFM_CommandLoader.java @@ -139,7 +139,7 @@ public class TFM_CommandLoader this.blockHostConsole = blockHostConsole; this.description = description; this.usage = usage; - this.aliases = Arrays.asList(aliases.split(",")); + this.aliases = ("".equals(aliases) ? new ArrayList() : Arrays.asList(aliases.split(","))); } public List getAliases() diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index a526932b..9f8205b4 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -126,7 +126,7 @@ public class TotalFreedomMod extends JavaPlugin public void onDisable() { server.getScheduler().cancelTasks(this); - TFM_Log.info("Plugin Disabled"); + TFM_Log.info("Plugin disabled"); } @Override @@ -153,11 +153,6 @@ public class TotalFreedomMod extends JavaPlugin commandLabel, StringUtils.join(args, " ")), true); } - - if ("".equals(commandLabel)) - { - return false; - } TFM_Command dispatcher; try @@ -189,7 +184,6 @@ public class TotalFreedomMod extends JavaPlugin TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(ex)); } - dispatcher = null; } catch (Throwable ex) { From ef2e17c33f59567d19489dadf873efad267b3044 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Sat, 13 Jul 2013 11:43:23 -0700 Subject: [PATCH 2/7] Blocked /ban-ip and /pardon-ip --- src/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/config.yml b/src/config.yml index a582ff69..83c841bf 100644 --- a/src/config.yml +++ b/src/config.yml @@ -54,6 +54,8 @@ blocked_commands: - n:b:/md:This server now uses DisguiseCraft instead of MobDisguise. Type /d to disguise and /u to undisguise. - n:b:/gamemode:Use /creative and /survival to set your gamemode. - n:b:/ban:_ + - n:b:/ban-ip:_ + - n:b:/pardon-ip_ - n:b:/pardon:_ - n:b:/toggledownfall:_ From 4caa984cef59083ff973e35059add1b8be079094 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Sat, 13 Jul 2013 11:45:19 -0700 Subject: [PATCH 3/7] oops --- src/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.yml b/src/config.yml index 83c841bf..ef89fd90 100644 --- a/src/config.yml +++ b/src/config.yml @@ -54,8 +54,6 @@ blocked_commands: - n:b:/md:This server now uses DisguiseCraft instead of MobDisguise. Type /d to disguise and /u to undisguise. - n:b:/gamemode:Use /creative and /survival to set your gamemode. - n:b:/ban:_ - - n:b:/ban-ip:_ - - n:b:/pardon-ip_ - n:b:/pardon:_ - n:b:/toggledownfall:_ @@ -70,6 +68,8 @@ blocked_commands: - s:a:/save-all - s:a:/save-on - s:a:/save-off + - s:a:/ban-ip + - s:a:/pardon-ip # Automatically wipe dropped objects: auto_wipe: true From dbed7b7f8308178559a4746c46753615a064f6c5 Mon Sep 17 00:00:00 2001 From: Steven Lawson Date: Sat, 13 Jul 2013 14:56:47 -0400 Subject: [PATCH 4/7] We don't want those commands used at all. --- src/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/config.yml b/src/config.yml index ef89fd90..79fdd9b2 100644 --- a/src/config.yml +++ b/src/config.yml @@ -56,20 +56,20 @@ blocked_commands: - n:b:/ban:_ - n:b:/pardon:_ - n:b:/toggledownfall:_ + - n:b:/ban-ip:_ + - n:b:/pardon-ip:_ # Superadmin commands - s:b:/kick:_ - s:b:/socialspy:_ - s:b:/kill:_ - s:b:/clearhistory:_ - - s:a:/stop - - s:a:/reload - - s:a:/nuke - - s:a:/save-all - - s:a:/save-on - - s:a:/save-off - - s:a:/ban-ip - - s:a:/pardon-ip + - s:a:/stop:_ + - s:a:/reload:_ + - s:a:/nuke:_ + - s:a:/save-all:_ + - s:a:/save-on:_ + - s:a:/save-off:_ # Automatically wipe dropped objects: auto_wipe: true From f3087f0dcaa98fe0af5ebf403a3560d5e178bbfa Mon Sep 17 00:00:00 2001 From: Jerom van der Sar Date: Sat, 13 Jul 2013 21:39:10 +0200 Subject: [PATCH 5/7] Capitalism. --- LICENSE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE.md b/LICENSE.md index 8d652832..9f18e768 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -4,7 +4,7 @@ TotalFreedomMod is primarily derived from the Bukkit and CraftBukkit library and We do, however, ask that you comply by several restrictions. These restrictions are in place to make sure that credit is given to the original authors, who remain the maintainers of the plugin and its source code. * A un-edited copy of this LICENSE.md shall always be included with this source code. * TotalFreedomMod source code and its derivations shall be freely distributable between anyone who chooses to download it. -* You shall not remove the keywords "Madgeek1450", "StevenLawson", "DarthSalamon" or "jeromsar" from any part of the source code. +* You shall not remove the keywords "Madgeek1450", "StevenLawson", "DarthSalamon" or "JeromSar" from any part of the source code. * Compiled binaries (*.jar's) shall not to be distributed. * If you wish to obtain a copy of TotalFreedomMod you must compile the original source code or it's derivations yourself. * The primary developers, StevenLawson (Madgeek1450) and Jerom van der Sar (DarthSalamon), may choose to provide official binaries on a discretionary basis. From e56c273457aa4e7bb09235d6307c0f0afffb54ab Mon Sep 17 00:00:00 2001 From: Jerome van der Sar Date: Sat, 13 Jul 2013 22:11:13 +0200 Subject: [PATCH 6/7] Moved TotalFreedomMod-related information to /tfm --- appinfo.properties | 6 ++--- buildnumber.properties | 4 ++-- .../Commands/Command_status.java | 4 +--- .../TotalFreedomMod/Commands/Command_tfm.java | 24 +++++++++++++++++++ 4 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java diff --git a/appinfo.properties b/appinfo.properties index 56169aee..f9a32946 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,6 +1,6 @@ -#Sat, 13 Jul 2013 12:48:46 +0200 +#Sat, 13 Jul 2013 22:09:24 +0200 program.VERSION=2.21 -program.BUILDNUM=306 -program.BUILDDATE=07/13/2013 12\:48 PM +program.BUILDNUM=309 +program.BUILDDATE=07/13/2013 10\:09 PM diff --git a/buildnumber.properties b/buildnumber.properties index 39e88ced..c3e85e45 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sat Jul 13 12:48:46 CEST 2013 -build.number=307 +#Sat Jul 13 22:09:24 CEST 2013 +build.number=310 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java index 83ec0ff6..b964f18d 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_status.java @@ -40,11 +40,9 @@ public class Command_status extends TFM_Command @Override public boolean run(final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { - playerMsg(String.format("Total Freedom Mod v%s.%s, built %s.", TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber, TotalFreedomMod.buildDate), ChatColor.GOLD); - playerMsg("TotalFreedomMod was created by Madgeek1450 and DarthSalamon.", ChatColor.GOLD); + playerMsg("For information about TotalFreedomMod, try /tfm", ChatColor.GREEN); // Temporary playerMsg("Server is currently running with 'online-mode=" + (server.getOnlineMode() ? "true" : "false") + "'.", ChatColor.YELLOW); - playerMsg("Loaded worlds:", ChatColor.BLUE); int i = 0; for (World world : server.getWorlds()) diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java new file mode 100644 index 00000000..937a43ff --- /dev/null +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java @@ -0,0 +1,24 @@ +package me.StevenLawson.TotalFreedomMod.Commands; + +import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; +import org.bukkit.ChatColor; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH) +@CommandParameters(description = "Shows information about TotalFreedomMod", usage = "/") +public class Command_tfm extends TFM_Command { + + @Override + public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) + { + playerMsg("TotalFreedomMod for 'TotalFreedom', the original all-op server.", ChatColor.GOLD); + playerMsg(String.format("Version " + ChatColor.BLUE + "%s.%s" + ChatColor.BLUE + ", built %s.", TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber, TotalFreedomMod.buildDate), ChatColor.GOLD); + playerMsg("Created by Madgeek1450 and DarthSalamon.", ChatColor.GOLD); + playerMsg("Visit " + ChatColor.AQUA + "http://totalfreedom.me/" + ChatColor.GREEN + " for more information.", ChatColor.DARK_GREEN); + + return true; + } + +} From fdfa30b3495a2508f5133315970b5c5a9ea80934 Mon Sep 17 00:00:00 2001 From: Jerome van der Sar Date: Sun, 14 Jul 2013 14:10:29 +0200 Subject: [PATCH 7/7] How do I allman? --- appinfo.properties | 6 +++--- buildnumber.properties | 4 ++-- .../StevenLawson/TotalFreedomMod/Commands/Command_tfm.java | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/appinfo.properties b/appinfo.properties index f9a32946..6f4f07f0 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,6 +1,6 @@ -#Sat, 13 Jul 2013 22:09:24 +0200 +#Sun, 14 Jul 2013 14:08:44 +0200 program.VERSION=2.21 -program.BUILDNUM=309 -program.BUILDDATE=07/13/2013 10\:09 PM +program.BUILDNUM=311 +program.BUILDDATE=07/14/2013 02\:08 PM diff --git a/buildnumber.properties b/buildnumber.properties index c3e85e45..a2c04d0d 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sat Jul 13 22:09:24 CEST 2013 -build.number=310 +#Sun Jul 14 14:08:44 CEST 2013 +build.number=312 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java index 937a43ff..510bf3a7 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_tfm.java @@ -8,8 +8,8 @@ import org.bukkit.entity.Player; @CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH) @CommandParameters(description = "Shows information about TotalFreedomMod", usage = "/") -public class Command_tfm extends TFM_Command { - +public class Command_tfm extends TFM_Command +{ @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { @@ -20,5 +20,5 @@ public class Command_tfm extends TFM_Command { return true; } - + }