From 5cffeca21fcb6266999d8b5fbda443eee58d996f Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 24 Sep 2018 15:01:10 +1000 Subject: SPIGOT-4391: Sign editable API --- src/main/java/org/bukkit/craftbukkit/block/CraftSign.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java index 7a8d4452..e6f86cc4 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -11,6 +11,7 @@ import org.bukkit.craftbukkit.util.CraftChatMessage; public class CraftSign extends CraftBlockEntityState implements Sign { private String[] lines; + private boolean editable; public CraftSign(final Block block) { super(block, TileEntitySign.class); @@ -26,6 +27,7 @@ public class CraftSign extends CraftBlockEntityState implements lines = new String[sign.lines.length]; System.arraycopy(revertComponents(sign.lines), 0, lines, 0, lines.length); + editable = sign.isEditable; } @Override @@ -43,12 +45,23 @@ public class CraftSign extends CraftBlockEntityState implements lines[index] = line; } + @Override + public boolean isEditable() { + return this.editable; + } + + @Override + public void setEditable(boolean editable) { + this.editable = editable; + } + @Override public void applyTo(TileEntitySign sign) { super.applyTo(sign); IChatBaseComponent[] newLines = sanitizeLines(lines); System.arraycopy(newLines, 0, sign.lines, 0, 4); + sign.isEditable = editable; } public static IChatBaseComponent[] sanitizeLines(String[] lines) { -- cgit v1.2.3