mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Revisions to how onDamage works
This commit is contained in:
parent
f26f5cca73
commit
aa3cb69fe8
@ -109,6 +109,9 @@ public class vMinecraftListener extends PluginListener {
|
||||
vMinecraftUsers.addUser(player);
|
||||
}
|
||||
public boolean onDamage(PluginLoader.DamageType type, BaseEntity attacker, BaseEntity defender, int amount) {
|
||||
Player player;
|
||||
for(Player p : etc.getServer().getPlayerList()){
|
||||
if (p.getId() == defender.getId() && p.getHealth() < 1){
|
||||
if(type == type.CREEPER_EXPLOSION){
|
||||
damagetype = 1; //Creeper
|
||||
} else if(type == type.FALL){
|
||||
@ -122,6 +125,8 @@ public class vMinecraftListener extends PluginListener {
|
||||
} else if (type == type.WATER){
|
||||
damagetype = 6; //Water
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user