mirror of
https://github.com/taoneill/war.git
synced 2024-11-26 20:26:29 +01:00
Fixes NPE when deadly adjectives is empty
For example with russian translation
This commit is contained in:
parent
0a80198084
commit
4c65c18aea
@ -149,8 +149,8 @@ public class WarEntityListener implements Listener {
|
||||
} else if (event.getDamager() instanceof Projectile) {
|
||||
weaponString = War.war.getString("pvp.kill.weapon.aim");
|
||||
}
|
||||
String adjectiveString = 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 adjectiveString = War.war.getDeadlyAdjectives().isEmpty() ? "" : War.war.getDeadlyAdjectives().get(this.killSeed.nextInt(War.war.getDeadlyAdjectives().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,
|
||||
weaponString.toLowerCase().replace('_', ' '), verbString, defenderString);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user