From ed10a036294d22948ae3e7c6c1ac5e2a1f28a01c Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Sat, 21 Mar 2020 17:17:33 +0100 Subject: [PATCH] Use messages game rule for hologram signs --- .../erethon/dungeonsxl/sign/passive/HologramSign.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/sign/passive/HologramSign.java b/core/src/main/java/de/erethon/dungeonsxl/sign/passive/HologramSign.java index 46d855a8..00bc38ff 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/sign/passive/HologramSign.java +++ b/core/src/main/java/de/erethon/dungeonsxl/sign/passive/HologramSign.java @@ -21,6 +21,7 @@ import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; import de.erethon.caliburn.item.ExItem; import de.erethon.commons.misc.NumberUtil; import de.erethon.dungeonsxl.api.DungeonsAPI; +import de.erethon.dungeonsxl.api.dungeon.GameRule; import de.erethon.dungeonsxl.api.sign.Passive; import de.erethon.dungeonsxl.api.world.InstanceWorld; import de.erethon.dungeonsxl.player.DPermission; @@ -63,7 +64,7 @@ public class HologramSign extends Passive { @Override public boolean isSetToAir() { - return false; + return true; } @Override @@ -77,7 +78,12 @@ public class HologramSign extends Passive { @Override public void initialize() { - String[] holoLines = getLine(1).split("/"); + String text = getGameWorld().getDungeon().getRules().getState(GameRule.MESSAGES).get(NumberUtil.parseInt(getLine(1))); + if (text == null) { + markAsErroneous("Unknown message, ID: " + getLine(1)); + return; + } + String[] holoLines = text.split("/"); Location location = getSign().getLocation(); location = location.add(0.5, NumberUtil.parseDouble(getLine(2)), 0.5);