From 039de8ba8809e609656441e32013b3ae3028219e Mon Sep 17 00:00:00 2001 From: Jerome van der Sar Date: Mon, 6 May 2013 22:04:10 +0200 Subject: [PATCH] Update to Minecraft 1.5.2 Added dev prefixes, Fixed Twitterbot bug --- appinfo.properties | 6 ++--- buildnumber.properties | 4 +-- .../Commands/Command_saconfig.java | 7 ++++- .../TotalFreedomMod/TFM_ServerInterface.java | 10 +++---- .../TotalFreedomMod/TFM_Util.java | 26 ++++++++++++++++--- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/appinfo.properties b/appinfo.properties index 07c68ff6..12d186a4 100644 --- a/appinfo.properties +++ b/appinfo.properties @@ -1,5 +1,5 @@ -#Tue, 09 Apr 2013 22:30:34 -0400 +#Mon, 06 May 2013 21:59:49 +0200 program.VERSION=2.13 -program.BUILDNUM=157 -program.BUILDDATE=04/09/2013 10\:30 PM +program.BUILDNUM=160 +program.BUILDDATE=05/06/2013 09\:59 PM diff --git a/buildnumber.properties b/buildnumber.properties index 5dcf3529..8beba18b 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Tue Apr 09 22:30:34 EDT 2013 -build.number=158 +#Mon May 06 21:59:49 CEST 2013 +build.number=161 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java index aa8d2454..bf51d1f6 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java @@ -149,7 +149,12 @@ public class Command_saconfig extends TFM_Command TFM_Util.adminAction(sender.getName(), "Removing " + target_name + " from the superadmin list", true); TFM_SuperadminList.removeSuperadmin(target_name); - + + if (!TotalFreedomMod.twitterbotEnabled) + { + return true; + } + // Twitterbot TFM_TwitterHandler twitterbot = TFM_TwitterHandler.getInstance(plugin); String reply = twitterbot.delTwitter(target_name); diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java b/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java index a0eca2d0..e8ed4703 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_ServerInterface.java @@ -5,11 +5,11 @@ import java.util.Date; import java.util.Iterator; import java.util.Set; import java.util.regex.Pattern; -import net.minecraft.server.v1_5_R2.BanEntry; -import net.minecraft.server.v1_5_R2.BanList; -import net.minecraft.server.v1_5_R2.MinecraftServer; -import net.minecraft.server.v1_5_R2.PlayerList; -import net.minecraft.server.v1_5_R2.PropertyManager; +import net.minecraft.server.v1_5_R3.BanEntry; +import net.minecraft.server.v1_5_R3.BanList; +import net.minecraft.server.v1_5_R3.MinecraftServer; +import net.minecraft.server.v1_5_R3.PlayerList; +import net.minecraft.server.v1_5_R3.PropertyManager; import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.entity.Player; diff --git a/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java b/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java index 01e0474b..3746910f 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java +++ b/src/me/StevenLawson/TotalFreedomMod/TFM_Util.java @@ -961,8 +961,7 @@ public class TFM_Util public static void adminChatMessage(CommandSender sender, String message, boolean senderIsConsole) { - String name = sender.getName() + (senderIsConsole ? ChatColor.DARK_PURPLE + " (Console)" : (TFM_SuperadminList.isSeniorAdmin(sender) ? ChatColor.LIGHT_PURPLE + " (SrA)" : ChatColor.GOLD + " (SA)")); - + String name = sender.getName() + " " + getPrefix(sender, senderIsConsole); TFM_Log.info("[ADMIN] " + name + ": " + message); for (Player p : Bukkit.getOnlinePlayers()) @@ -973,6 +972,27 @@ public class TFM_Util } } } + + public static String getPrefix(CommandSender sender, boolean senderIsConsole) + { + String prefix; + if (senderIsConsole) { + prefix = ChatColor.BLUE + "(Console)"; + } else { + if (TFM_SuperadminList.isSeniorAdmin(sender)) + { + prefix = ChatColor.LIGHT_PURPLE + "(SrA)"; + } else + { + prefix = ChatColor.GOLD + "(SA)"; + } + if (sender.getName().equals("Madgeek1450") || sender.getName().equals("DarthSalamon")) + { + prefix = ChatColor.DARK_PURPLE + "(Dev)"; + } + } + return prefix + ChatColor.WHITE; + } public static String inputStreamToString(InputStream is, boolean preserveNewlines) throws IOException { @@ -981,7 +1001,7 @@ public class TFM_Util String line; while ((line = br.readLine()) != null) { - sb.append(line).append(preserveNewlines ? System.lineSeparator() : ""); + sb.append(line).append(preserveNewlines ? System.getProperty("line.separator") : ""); } return sb.toString(); }