aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-06-09 11:32:20 -0700
committerGitHub <[email protected]>2023-06-09 20:32:20 +0200
commit0284b272d323cd056816b2e34d7e7dad53e70b84 (patch)
tree85f34c84b01a8cf39eb372a44d9314d4eaebeb0f
parent648c000fb2330ca1f9b7833a275e70f06c1fce83 (diff)
downloadPaper-0284b272d323cd056816b2e34d7e7dad53e70b84.tar.gz
Paper-0284b272d323cd056816b2e34d7e7dad53e70b84.zip
Add API for waxed signs (#9291)
-rw-r--r--patches/api/0417-Add-API-for-waxed-signs.patch48
-rw-r--r--patches/server/0975-Add-API-for-waxed-signs.patch29
2 files changed, 77 insertions, 0 deletions
diff --git a/patches/api/0417-Add-API-for-waxed-signs.patch b/patches/api/0417-Add-API-for-waxed-signs.patch
new file mode 100644
index 0000000000..38a844fdb2
--- /dev/null
+++ b/patches/api/0417-Add-API-for-waxed-signs.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Thu, 8 Jun 2023 23:22:31 -0700
+Subject: [PATCH] Add API for waxed signs
+
+
+diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java
+index abefc7a96528c52434bd7d4eef3be63c5e31e770..dd4d8f24e684a9c3cb1e41e8d0bf615111a17ba3 100644
+--- a/src/main/java/org/bukkit/block/Sign.java
++++ b/src/main/java/org/bukkit/block/Sign.java
+@@ -95,7 +95,9 @@ public interface Sign extends TileState, Colorable {
+ * outside of this event is undefined.
+ *
+ * @return if this sign is currently editable
++ * @deprecated use {@link #isWaxed()}
+ */
++ @Deprecated // Paper
+ public boolean isEditable();
+
+ /**
+@@ -106,9 +108,27 @@ public interface Sign extends TileState, Colorable {
+ * outside of this event is undefined.
+ *
+ * @param editable if this sign is currently editable
++ * @deprecated use {@link #setWaxed(boolean)}
+ */
++ @Deprecated // Paper
+ public void setEditable(boolean editable);
+
++ // Paper start
++ /**
++ * Gets whether the sign has been waxed and therefore prevents editing.
++ *
++ * @return true if waxed
++ */
++ boolean isWaxed();
++
++ /**
++ * Sets whether the sign is waxed.
++ *
++ * @param waxed true to wax and therefore prevent editing
++ */
++ void setWaxed(boolean waxed);
++ // Paper end
++
+ /**
+ * Gets whether this sign has glowing text. Only affects the {@link Side#FRONT}.
+ *
diff --git a/patches/server/0975-Add-API-for-waxed-signs.patch b/patches/server/0975-Add-API-for-waxed-signs.patch
new file mode 100644
index 0000000000..70908f9bbb
--- /dev/null
+++ b/patches/server/0975-Add-API-for-waxed-signs.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Thu, 8 Jun 2023 23:22:36 -0700
+Subject: [PATCH] Add API for waxed signs
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+index 78b57aa3120f8526b4bff2ca90d7735845a87b41..3114baf15425129aae9eb3376bb2a727729d378e 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java
+@@ -67,6 +67,18 @@ public class CraftSign<T extends SignBlockEntity> extends CraftBlockEntityState<
+ getSnapshot().setWaxed(!editable);
+ }
+
++ // Paper start
++ @Override
++ public boolean isWaxed() {
++ return this.getSnapshot().isWaxed();
++ }
++
++ @Override
++ public void setWaxed(final boolean waxed) {
++ this.getSnapshot().setWaxed(waxed);
++ }
++ // Paper end
++
+ @Override
+ public boolean isGlowingText() {
+ return this.front.isGlowingText();