feat: remove death message modification
This commit is contained in:
parent
a63b6b48d9
commit
d8ecb3a900
1 changed files with 2 additions and 13 deletions
|
|
@ -213,19 +213,8 @@ public class MiscListener implements Listener {
|
||||||
public void onPlayerDeath(PlayerDeathEvent event) {
|
public void onPlayerDeath(PlayerDeathEvent event) {
|
||||||
if (!event.getKeepInventory() && Egg.hasEgg(event.getEntity().getInventory())) {
|
if (!event.getKeepInventory() && Egg.hasEgg(event.getEntity().getInventory())) {
|
||||||
data.resetEggOwner(false, config);
|
data.resetEggOwner(false, config);
|
||||||
|
|
||||||
//change the death message
|
announce(String.format("%s died and lost the dragon egg!", event.getEntity().getDisplayName()));
|
||||||
String deathmsg = event.getDeathMessage();
|
|
||||||
|
|
||||||
if (deathmsg == null || deathmsg.isBlank()) {
|
|
||||||
announce(String.format("%s died and lost the dragon egg!", event.getEntity().getDisplayName()));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (deathmsg.endsWith(".")) {
|
|
||||||
deathmsg = deathmsg.substring(0, deathmsg.length() - 1);
|
|
||||||
}
|
|
||||||
event.setDeathMessage(String.format("%s and lost the dragon egg!", deathmsg));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue