Another attempt at fixing the health mechanic.

This commit is contained in:
songoda 2020-01-16 21:42:23 -05:00
parent 39be1c2996
commit b29dffc912
1 changed files with 2 additions and 3 deletions

View File

@ -20,9 +20,8 @@ public class HealthMechanic implements IBossMechanic {
public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) {
if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false;
Object o = SpigotYmlReader.get().getObject("settings.attribute.maxHealth.max");
double maxHealthSetting = o instanceof Double ? (double) o : (double) (int) o;
double maxHealthSetting = Double.valueOf( SpigotYmlReader
.get().getObject("settings.attribute.maxHealth.max").toString());
for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) {
MainStatsElement mainStatsElement = entityStatsElement.getMainStats();