Skip to content

Commit

Permalink
Improve lower version compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Nov 15, 2023
1 parent d968639 commit db34734
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/dev/mrshawn/deathmessages/utils/Assets.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public static TextComponent getNaturalDeath(PlayerManager pm, String damageCause
if (msg.contains("%block%") && pm.getLastEntityDamager() instanceof FallingBlock) {
try {
FallingBlock fb = (FallingBlock) pm.getLastEntityDamager();
String material = fb.getBlockData().getMaterial().toString().toLowerCase();
String material = (DeathMessages.majorVersion() > 12) ? fb.getBlockData().getMaterial().toString().toLowerCase() : fb.getMaterial().toString().toLowerCase();
String configValue = Messages.getInstance().getConfig().getString("Blocks." + material);

base.append(convertFromLegacy(msg.replaceAll("%block%", configValue)));
Expand Down

0 comments on commit db34734

Please sign in to comment.