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 b8bbd672..381bf2b8 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java @@ -169,6 +169,25 @@ public class DGameWorld extends DInstanceWorld implements GameWorld { public DungeonSign createDungeonSign(Sign sign, String[] lines) { DungeonSign dSign = super.createDungeonSign(sign, lines); + String[] triggerTypes = lines[3].replaceAll("\\s", "").split(","); + for (String triggerString : triggerTypes) { + if (triggerString.isEmpty()) { + continue; + } + + String id = triggerString.substring(0, 1); + String value = null; + if (triggerString.length() > 1) { + value = triggerString.substring(1); + } + + Trigger trigger = Trigger.getOrCreate(plugin, id, value, dSign); + if (trigger != null) { + trigger.addListener(dSign); + dSign.addTrigger(trigger); + } + } + if (dSign.isOnDungeonInit()) { dSign.initialize(); } diff --git a/core/src/main/java/de/erethon/dungeonsxl/world/DInstanceWorld.java b/core/src/main/java/de/erethon/dungeonsxl/world/DInstanceWorld.java index 77bb2ce4..8caf993f 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DInstanceWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DInstanceWorld.java @@ -27,7 +27,6 @@ import de.erethon.dungeonsxl.api.player.InstancePlayer; import de.erethon.dungeonsxl.api.player.PlayerCache; import de.erethon.dungeonsxl.api.sign.DungeonSign; import de.erethon.dungeonsxl.api.world.InstanceWorld; -import de.erethon.dungeonsxl.trigger.Trigger; import java.io.File; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -118,26 +117,6 @@ public abstract class DInstanceWorld implements InstanceWorld { Constructor constructor = clss.getConstructor(DungeonsAPI.class, Sign.class, String[].class, InstanceWorld.class); DungeonSign dSign = (DungeonSign) constructor.newInstance(plugin, sign, lines, this); signs.put(sign.getBlock(), dSign); - - String[] triggerTypes = lines[3].replaceAll("\\s", "").split(","); - for (String triggerString : triggerTypes) { - if (triggerString.isEmpty()) { - continue; - } - - String id = triggerString.substring(0, 1); - String value = null; - if (triggerString.length() > 1) { - value = triggerString.substring(1); - } - - Trigger trigger = Trigger.getOrCreate(plugin, id, value, dSign); - if (trigger != null) { - trigger.addListener(dSign); - dSign.addTrigger(trigger); - } - } - return dSign; } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException