From b35000358f171a57dea9a5dec172fd0366468ed0 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Fri, 19 Jun 2020 21:41:32 +0200 Subject: [PATCH] Fix legacy ProgressTrigger references --- .../de/erethon/dungeonsxl/trigger/ProgressTrigger.java | 10 +++++----- .../java/de/erethon/dungeonsxl/world/DGameWorld.java | 5 ++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/trigger/ProgressTrigger.java b/core/src/main/java/de/erethon/dungeonsxl/trigger/ProgressTrigger.java index a7bbf965..ebaa5bea 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/trigger/ProgressTrigger.java +++ b/core/src/main/java/de/erethon/dungeonsxl/trigger/ProgressTrigger.java @@ -29,8 +29,6 @@ import org.bukkit.Bukkit; */ public class ProgressTrigger extends Trigger { - private TriggerType type = TriggerTypeDefault.PROGRESS; - private DResourceWorld floor; private int floorCount; private int waveCount; @@ -102,7 +100,7 @@ public class ProgressTrigger extends Trigger { @Override public TriggerType getType() { - return type; + return TriggerTypeDefault.PRESENCE; } /* Statics */ @@ -126,8 +124,10 @@ public class ProgressTrigger extends Trigger { public static Set getByGameWorld(DGameWorld gameWorld) { Set toReturn = new HashSet<>(); - for (Trigger trigger : gameWorld.getTriggers(TriggerTypeDefault.PROGRESS)) { - toReturn.add((ProgressTrigger) trigger); + for (Trigger trigger : gameWorld.getTriggers()) { + if (trigger instanceof ProgressTrigger) { + toReturn.add((ProgressTrigger) trigger); + } } return toReturn; } diff --git a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java index 37334f94..a16331a5 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java @@ -363,9 +363,8 @@ public class DGameWorld extends DInstanceWorld implements GameWorld { continue; } - for (de.erethon.dungeonsxl.api.Trigger apiTrigger : sign.getTriggers()) { - Trigger trigger = (Trigger) apiTrigger; - if (trigger.getType() == TriggerTypeDefault.PROGRESS) { + for (de.erethon.dungeonsxl.api.Trigger trigger : sign.getTriggers()) { + if (trigger instanceof ProgressTrigger) { if (((ProgressTrigger) trigger).getFloorCount() > getGame().getFloorCount()) { break signs; }