From 30e1ccabb6b048870cd1a78cab54d5374c91064d Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 10 Dec 2019 18:47:05 -0500 Subject: [PATCH 1/3] Fixed issue with improper casting. --- .../com/songoda/epicbosses/mechanics/boss/HealthMechanic.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java index b0d5d9d..059360e 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/mechanics/boss/HealthMechanic.java @@ -20,7 +20,9 @@ public class HealthMechanic implements IBossMechanic { public boolean applyMechanic(BossEntity bossEntity, ActiveBossHolder activeBossHolder) { if (activeBossHolder.getLivingEntityMap().getOrDefault(1, null) == null) return false; - double maxHealthSetting = (double) SpigotYmlReader.get().getObject("settings.attribute.maxHealth.max"); + Object o = SpigotYmlReader.get().getObject("settings.attribute.maxHealth.max"); + + double maxHealthSetting = o instanceof Double ? (double) o : (double) (int) o; for (EntityStatsElement entityStatsElement : bossEntity.getEntityStats()) { MainStatsElement mainStatsElement = entityStatsElement.getMainStats(); From 61869ed80a934fc252c7cd33d464e27c37bd8744 Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 10 Dec 2019 18:57:34 -0500 Subject: [PATCH 2/3] Fixed worldguard problem. --- .../epicbosses/managers/BossLocationManager.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java index 4dde9cd..c3f387f 100644 --- a/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java +++ b/plugin-modules/Core/src/com/songoda/epicbosses/managers/BossLocationManager.java @@ -58,11 +58,11 @@ public class BossLocationManager implements IReloadable { } } - if (WorldGuardHook.isEnabled()) { - if (WorldGuardHook.getBooleanFlag(location, "boss-blocked-region")) { - ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region having the 'boss-blocked-region' flag"); - return false; - } + + Boolean flag; + if ((flag = WorldGuardHook.getBooleanFlag(location, "boss-blocked-region")) != null && flag) { + ServerUtils.get().logDebug("Unable to spawn boss due to worldguard region having the 'boss-blocked-region' flag"); + return false; } if (this.bossHookManager.isFactionsEnabled() && this.bossHookManager.getFactionHelper() != null) { From b491a561127b470c4f3d09ffc3e9cd5ba383fcff Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 10 Dec 2019 19:27:08 -0500 Subject: [PATCH 3/3] version 1.2.4 --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 783b985..6c1ad30 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,7 @@ stages: variables: name: "EpicBosses" path: "/builds/$CI_PROJECT_PATH" - version: "1.2.3" + version: "1.2.4" build: stage: build