Fix for ezmodo, removed ezHealth

This commit is contained in:
nossr50 2010-12-02 14:13:23 -08:00
parent 3a85abadfa
commit 83f1ed4a8f
4 changed files with 7 additions and 10 deletions

View File

@ -489,7 +489,6 @@ public class vMinecraftCommands{
player.sendMessage(Colors.LightBlue + "Easy Mode ga yurusareru no wa shougakusei made dayo ne"); player.sendMessage(Colors.LightBlue + "Easy Mode ga yurusareru no wa shougakusei made dayo ne");
player.sendMessage(Colors.Red + "**Laughter**"); player.sendMessage(Colors.Red + "**Laughter**");
vMinecraftSettings.getInstance().addEzModo(player.getName()); vMinecraftSettings.getInstance().addEzModo(player.getName());
player.setHealth(vMinecraftSettings.getInstance().ezModoHealth());
} }
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -80,10 +80,8 @@ public class vMinecraftListener extends PluginListener {
//Use: Checks for exploits and runs the commands //Use: Checks for exploits and runs the commands
//===================================================================== //=====================================================================
public boolean onHealthChange(Player player,int oldValue,int newValue){ public boolean onHealthChange(Player player,int oldValue,int newValue){
if (player.getHealth() != vMinecraftSettings.getInstance().ezModoHealth() if (vMinecraftSettings.getInstance().isEzModo(player.getName())) {
&& vMinecraftSettings.getInstance().isEzModo(player.getName())) { return oldValue > newValue;
player.setHealth(vMinecraftSettings.getInstance().ezModoHealth());
} }
else if (vMinecraftSettings.getInstance().globalmessages() && player.getHealth() < 1) { else if (vMinecraftSettings.getInstance().globalmessages() && player.getHealth() < 1) {
vMinecraftChat.gmsg(player, Colors.Gray + player.getName() + " " + vMinecraftSettings.randomDeathMsg()); vMinecraftChat.gmsg(player, Colors.Gray + player.getName() + " " + vMinecraftSettings.randomDeathMsg());

View File

@ -40,8 +40,7 @@ public class vMinecraftSettings {
static ArrayList<String> ezModo = new ArrayList<String>(); static ArrayList<String> ezModo = new ArrayList<String>();
//An array of players currently toggled for admin chat //An array of players currently toggled for admin chat
static ArrayList<String> adminChatList = new ArrayList<String>(); static ArrayList<String> adminChatList = new ArrayList<String>();
//The max health for ezModo
static int ezHealth = 30;
private PropertiesFile properties; private PropertiesFile properties;
String file = "vminecraft.properties"; String file = "vminecraft.properties";
@ -144,7 +143,7 @@ public class vMinecraftSettings {
for(String ezName : tempEz) for(String ezName : tempEz)
ezModo.add(ezName); ezModo.add(ezName);
ezHealth = properties.getInt("ezHealth");
log.log(Level.INFO, "vminecraft plugin successfully loaded"); log.log(Level.INFO, "vminecraft plugin successfully loaded");
@ -192,7 +191,6 @@ public class vMinecraftSettings {
public void removeAdminToggled(String playerName) {adminChatList.remove(adminChatList.indexOf(playerName));} public void removeAdminToggled(String playerName) {adminChatList.remove(adminChatList.indexOf(playerName));}
public void addEzModo(String playerName) {ezModo.add(playerName);} public void addEzModo(String playerName) {ezModo.add(playerName);}
public void addAdminToggled(String playerName) {adminChatList.add(playerName);} public void addAdminToggled(String playerName) {adminChatList.add(playerName);}
public int ezModoHealth() {return ezHealth;}
public String ezModoList() {return ezModo.toString();} public String ezModoList() {return ezModo.toString();}
//Random death message method //Random death message method

View File

@ -264,6 +264,7 @@ class PlayerList
} }
} }
//===================================================================== //=====================================================================
//Function: getPlayer //Function: getPlayer
//Input: None //Input: None
@ -368,3 +369,4 @@ class PlayerList
} }
} }