summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-09-24 15:01:10 +1000
committermd_5 <git@md-5.net>2018-09-24 15:01:10 +1000
commit5cffeca21fcb6266999d8b5fbda443eee58d996f (patch)
tree4ce8020cec9485a3889ea22ab407e43d24a0dc93
parentdcb43ef83dd0dc8b26e9923eaeed82b659ab5780 (diff)
downloadcraftbukkit-5cffeca21fcb6266999d8b5fbda443eee58d996f.tar
craftbukkit-5cffeca21fcb6266999d8b5fbda443eee58d996f.tar.gz
craftbukkit-5cffeca21fcb6266999d8b5fbda443eee58d996f.tar.lz
craftbukkit-5cffeca21fcb6266999d8b5fbda443eee58d996f.tar.xz
craftbukkit-5cffeca21fcb6266999d8b5fbda443eee58d996f.zip
SPIGOT-4391: Sign editable API
-rw-r--r--src/main/java/org/bukkit/craftbukkit/block/CraftSign.java13
1 files changed, 13 insertions, 0 deletions
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<TileEntitySign> 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<TileEntitySign> implements
lines = new String[sign.lines.length];
System.arraycopy(revertComponents(sign.lines), 0, lines, 0, lines.length);
+ editable = sign.isEditable;
}
@Override
@@ -44,11 +46,22 @@ public class CraftSign extends CraftBlockEntityState<TileEntitySign> implements
}
@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) {