From e4bb1ef6aaf6abadc18ad7a1af103fcc8a979e51 Mon Sep 17 00:00:00 2001 From: Wilee999 Date: Thu, 15 May 2014 18:57:34 -0700 Subject: [PATCH 1/2] Auto-freeze on imposter login; adds: http://www.totalfreedom.boards.net/thread/12123 --- .../TotalFreedomMod/Listener/TFM_PlayerListener.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java index 36105879..e9337268 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java @@ -747,6 +747,7 @@ public class TFM_PlayerListener implements Listener player.getInventory().clear(); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); + TFM_PlayerData.getPlayerData().setFrozen(true); } else if (TFM_AdminList.isSuperAdmin(player) || TFM_Util.DEVELOPERS.contains(player.getName())) { From cdf03b435341280e1e88e6c71600f25386557c7a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Jun 2014 17:12:30 +0200 Subject: [PATCH 2/2] Perform suggested changes. Fixes #184 --- buildnumber.properties | 4 ++-- .../TotalFreedomMod/Commands/Command_saconfig.java | 12 ++++++++++++ .../TotalFreedomMod/Listener/TFM_PlayerListener.java | 4 ++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/buildnumber.properties b/buildnumber.properties index d66e30fd..6ce30a85 100644 --- a/buildnumber.properties +++ b/buildnumber.properties @@ -1,3 +1,3 @@ #Build Number for ANT. Do not edit! -#Sun Jun 22 16:53:34 CEST 2014 -build.number=864 +#Sun Jun 22 17:11:19 CEST 2014 +build.number=865 diff --git a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java index a104a8b1..7c13ec74 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java +++ b/src/me/StevenLawson/TotalFreedomMod/Commands/Command_saconfig.java @@ -3,6 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands; import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry; import me.StevenLawson.TotalFreedomMod.TFM_Admin; import me.StevenLawson.TotalFreedomMod.TFM_AdminList; +import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler; import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; @@ -167,6 +168,17 @@ public class Command_saconfig extends TFM_Command TFM_Util.adminAction(sender.getName(), "Adding " + player.getName() + " to the superadmin list", true); TFM_AdminList.addSuperadmin(player); + if (player.isOnline()) + { + final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData((Player) player); + + if (playerdata.isFrozen()) + { + playerdata.setFrozen(false); + TFM_Util.playerMsg((Player) player, "You have been unfrozen."); + } + } + return true; } diff --git a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java index 8c831527..2196f018 100644 --- a/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java +++ b/src/me/StevenLawson/TotalFreedomMod/Listener/TFM_PlayerListener.java @@ -736,12 +736,12 @@ public class TFM_PlayerListener implements Listener // Handle admin impostors if (TFM_AdminList.isAdminImpostor(player)) { - TFM_Util.bcastMsg("Warning: " + player.getName() + " has been flagged as an impostor!", ChatColor.RED); + TFM_Util.bcastMsg("Warning: " + player.getName() + " has been flagged as an impostor and has been frozen!", ChatColor.RED); TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); player.getInventory().clear(); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); - TFM_PlayerData.getPlayerData().setFrozen(true); + TFM_PlayerData.getPlayerData(player).setFrozen(true); } else if (TFM_AdminList.isSuperAdmin(player) || TFM_Util.DEVELOPERS.contains(player.getName())) {