Skip to content

Commit

Permalink
Merge pull request CloudburstMC#1087 from PowerNukkit/v1.4/death/mess…
Browse files Browse the repository at this point in the history
…ages

Fixes CloudburstMC#981 magma, lava, and starvation death messages
  • Loading branch information
joserobjr authored May 26, 2021
2 parents bf36ff7 + bceae02 commit 50e35a9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/main/java/cn/nukkit/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -4488,10 +4488,20 @@ public void kill() {
case LAVA:
Block block = this.level.getBlock(new Vector3(this.x, this.y - 1, this.z));
if (block.getId() == Block.MAGMA) {
message = "death.attack.lava.magma";
break;
message = "death.attack.magma";
} else {
message = "death.attack.lava";
}
if (killer instanceof EntityProjectile) {
Entity shooter = ((EntityProjectile) killer).shootingEntity;
if (shooter != null) {
killer = shooter;
}
if (killer instanceof EntityHuman) {
message += ".player";
params.add(!Objects.equals(shooter.getNameTag(), "") ? shooter.getNameTag() : shooter.getName());
}
}
message = "death.attack.lava";
break;

case FIRE:
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/lang

0 comments on commit 50e35a9

Please sign in to comment.