From c9747fbda3444e2c8c7a58e863e3af3747be461c Mon Sep 17 00:00:00 2001 From: William Blake Galbreath Date: Fri, 24 May 2019 03:29:59 -0500 Subject: [PATCH] Right click to open sign editor --- docs/source/configuration.rst | 7 ++- ...0022-Right-click-to-open-sign-editor.patch | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 patches/server/0022-Right-click-to-open-sign-editor.patch diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst index ce34090ed..4a9ef281d 100644 --- a/docs/source/configuration.rst +++ b/docs/source/configuration.rst @@ -88,8 +88,13 @@ World Settings World settings are on a per-world basis. The child-node `default` is used for all worlds that do not have their own specific settings. +editable-signs +~~~~~~~~~~~~~~ +* **default**: true +* **description**: Ability to edit signs by right clicking them with another sign in hand + campfire-obeys-gravity -~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~ * **default**: true * **description**: When true, campfires will fall to the ground (like anvils do) instead of floating in the air diff --git a/patches/server/0022-Right-click-to-open-sign-editor.patch b/patches/server/0022-Right-click-to-open-sign-editor.patch new file mode 100644 index 000000000..4d10e1529 --- /dev/null +++ b/patches/server/0022-Right-click-to-open-sign-editor.patch @@ -0,0 +1,50 @@ +From fe717237720589ce53c2584f68295a06da571d5a Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath +Date: Fri, 24 May 2019 02:39:25 -0500 +Subject: [PATCH] Right click to open sign editor + +--- + src/main/java/net/minecraft/server/BlockSign.java | 10 ++++++++++ + src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++ + 2 files changed, 15 insertions(+) + +diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java +index b6d7689d5..746709025 100644 +--- a/src/main/java/net/minecraft/server/BlockSign.java ++++ b/src/main/java/net/minecraft/server/BlockSign.java +@@ -52,6 +52,16 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo + } + } + ++ // Purpur start - right click to open sign editor ++ if (world.purpurConfig.editableSigns && itemstack.getItem() instanceof ItemSign && ++ !entityhuman.isSneaking() && entityhuman.abilities.mayBuild) { ++ tileentitysign.isEditable = true; ++ tileentitysign.a(entityhuman); ++ entityhuman.openSign(tileentitysign); ++ return true; ++ } ++ // Purpur end ++ + return tileentitysign.b(entityhuman); + } else { + return false; +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index e598099dd..b0d7c6bd2 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -61,6 +61,11 @@ public class PurpurWorldConfig { + return config.getString("world-settings." + worldName + "." + path, config.getString("world-settings.default." + path)); + } + ++ public boolean editableSigns = true; ++ private void editableSigns() { ++ editableSigns = getBoolean("editable-signs", editableSigns); ++ } ++ + public boolean campfireObeysGravity = true; + private void campfireObeysGravity() { + campfireObeysGravity = getBoolean("campfire-obeys-gravity", campfireObeysGravity); +-- +2.20.1 +