Skip to content

Commit

Permalink
Fixes CloudburstMC#981 magma, lava, and starvation death messages
Browse files Browse the repository at this point in the history
  • Loading branch information
joserobjr committed May 26, 2021
1 parent bf36ff7 commit bceae02
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 bceae02

Please sign in to comment.