Move valid check higher up, no need to set additional metadata

This commit is contained in:
Shane Freeder 2019-12-31 12:17:03 +00:00
parent 8fd1af4cbf
commit 3cbbf1bee0
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C

View File

@ -44,6 +44,11 @@ public final class MobHealthbarUtils {
return; return;
} }
// Don't mangle invalid entities, they're not going to be rendered anyways
if (!target.isValid()) {
return;
}
String originalName = target.getName(); String originalName = target.getName();
String oldName = target.getCustomName(); String oldName = target.getCustomName();
@ -60,10 +65,6 @@ public final class MobHealthbarUtils {
return; return;
} }
// Don't mangle invalid entities, they're not going to be rendered anyways
if (!target.isValid()) {
return;
}
boolean oldNameVisible = target.isCustomNameVisible(); boolean oldNameVisible = target.isCustomNameVisible();
String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage); String newName = createHealthDisplay(Config.getInstance().getMobHealthbarDefault(), target, damage);