Skip to content

Commit

Permalink
BlockGrave: use same logic to determine player name as TileEntityGrave (
Browse files Browse the repository at this point in the history
#19)

BlockGrave#getPlayerRelativeBlockHardness now uses EntityPlayer#getGameProfile#getName instead of EntityPlayer#getDisplayName. The latter may change if the player has a "nickname" (see: FTB Utilities), while the former should never change.

Signed-off-by: unilock <unilock@fennet.rentals>
  • Loading branch information
unilock authored Dec 3, 2023
1 parent e3fc2a3 commit 5db51ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/openblocks/common/block/BlockGrave.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public float getPlayerRelativeBlockHardness(EntityPlayer player, World world, in

if (tile instanceof TileEntityGrave) {
TileEntityGrave graveStone = (TileEntityGrave) tile;
if (Objects.equals(graveStone.getUsername(), player.getDisplayName())) return 2.0F;
if (Objects.equals(graveStone.getUsername(), player.getGameProfile().getName())) return 2.0F;
}

return super.getPlayerRelativeBlockHardness(player, world, x, y, z);
Expand Down

0 comments on commit 5db51ba

Please sign in to comment.