mirror of
https://github.com/taoneill/war.git
synced 2025-01-07 00:08:25 +01:00
Fixes NPE when deadly adjectives is empty
For example with russian translation
This commit is contained in:
parent
1ad05dd5f3
commit
367f5d1a73
@ -149,8 +149,8 @@ public class WarEntityListener implements Listener {
|
|||||||
} else if (event.getDamager() instanceof Projectile) {
|
} else if (event.getDamager() instanceof Projectile) {
|
||||||
weaponString = War.war.getString("pvp.kill.weapon.aim");
|
weaponString = War.war.getString("pvp.kill.weapon.aim");
|
||||||
}
|
}
|
||||||
String adjectiveString = War.war.getDeadlyAdjectives().get(this.killSeed.nextInt(War.war.getDeadlyAdjectives().size()));
|
String adjectiveString = War.war.getDeadlyAdjectives().isEmpty() ? "" : War.war.getDeadlyAdjectives().get(this.killSeed.nextInt(War.war.getDeadlyAdjectives().size()));
|
||||||
String verbString = War.war.getKillerVerbs().get(this.killSeed.nextInt(War.war.getKillerVerbs().size()));
|
String verbString = War.war.getKillerVerbs().isEmpty() ? "" : War.war.getKillerVerbs().get(this.killSeed.nextInt(War.war.getKillerVerbs().size()));
|
||||||
defenderWarzone.broadcast("pvp.kill.format", attackerString + ChatColor.WHITE, adjectiveString,
|
defenderWarzone.broadcast("pvp.kill.format", attackerString + ChatColor.WHITE, adjectiveString,
|
||||||
weaponString.toLowerCase().replace('_', ' '), verbString, defenderString);
|
weaponString.toLowerCase().replace('_', ' '), verbString, defenderString);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user