Changed death messages to be random for now, we need to find a better way to do specific death messages. :/

This commit is contained in:
nossr50 2010-12-13 15:22:23 -08:00
parent 4af84c3b94
commit cb87916086

View File

@ -89,8 +89,28 @@ public class vMinecraftListener extends PluginListener {
if (player.getHealth() < 1){ if (player.getHealth() < 1){
senddeath = true; senddeath = true;
deadplayer = player.getName(); deadplayer = player.getName();
vMinecraftChat.gmsg(deadplayer + " " + Colors.Red + vMinecraftSettings.randomDeathMsg());
/* These messages need to be in onHealth because onDamage is only called when a player is hurt, other than
* that I'm a bit clueless on how we should go about trying to fix this. I'll set it to at least show random death messages for now.
if (type == type.CREEPER_EXPLOSION) {
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " was blown to bits by a creeper");
} else if(type == type.FALL){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " fell to death!");
} else if(type == type.FIRE){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " was incinerated");
} else if (type == type.FIRE_TICK){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " Stop drop and roll, not scream, run, and burn ");
} else if (type == type.LAVA){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " drowned in lava");
} else if (type == type.WATER){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " should've attended that swimming class");
} else {
vMinecraftChat.gmsg(Colors.Gray + deadplayer + " " + vMinecraftSettings.randomDeathMsg());
} }
return true; *
*/
}
return false;
} }
public void onLogin(Player player){ public void onLogin(Player player){
@ -114,26 +134,7 @@ public class vMinecraftListener extends PluginListener {
return false; return false;
} }
public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) { public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) {
return false;
if (senddeath == true) {
if (type == type.CREEPER_EXPLOSION) {
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " was blown to bits by a creeper");
} else if(type == type.FALL){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " fell to death!");
} else if(type == type.FIRE){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " was incinerated");
} else if (type == type.FIRE_TICK){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " Stop drop and roll, not scream, run, and burn ");
} else if (type == type.LAVA){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " drowned in lava");
} else if (type == type.WATER){
vMinecraftChat.gmsg(deadplayer + Colors.Rose + " should've attended that swimming class");
} else {
vMinecraftChat.gmsg(Colors.Gray + deadplayer + " " + vMinecraftSettings.randomDeathMsg());
}
senddeath = false;
}
return true;
} }
} }