From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Fri, 24 May 2019 02:39:25 -0500
Subject: [PATCH] Signs editable on right click


diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
index 3585fd82c14338a82302ca403e91e6cfe65e1c19..770ad5edfb44acb69e7da33226ca6bf7c01a77b7 100644
--- a/src/main/java/net/minecraft/server/BlockSign.java
+++ b/src/main/java/net/minecraft/server/BlockSign.java
@@ -56,6 +56,17 @@ public abstract class BlockSign extends BlockTileEntity implements IBlockWaterlo
                     }
                 }
 
+                // Purpur start - right click to open sign editor
+                if (world.purpurConfig.signRightClickEdit && itemstack.getItem() instanceof ItemSign &&
+                        !entityhuman.isSneaking() && entityhuman.abilities.mayBuild &&
+                        entityhuman.getBukkitEntity().hasPermission("purpur.sign.edit")) {
+                    tileentitysign.isEditable = true;
+                    tileentitysign.a(entityhuman);
+                    entityhuman.openSign(tileentitysign);
+                    return EnumInteractionResult.SUCCESS;
+                }
+                // Purpur end
+
                 return tileentitysign.b(entityhuman) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
             } else {
                 return EnumInteractionResult.PASS;
diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java
index 3c7847b1156a486e253a0e9f74a857e841d90619..1e6bb566c0a718bba289b2e727a832e0aa6b7f15 100644
--- a/src/main/java/net/minecraft/server/TileEntitySign.java
+++ b/src/main/java/net/minecraft/server/TileEntitySign.java
@@ -112,6 +112,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { //
         return this.isEditable;
     }
 
+    public void setEditor(EntityHuman entityhuman) { a(entityhuman); } // Purpur - OBFHELPER
     public void a(EntityHuman entityhuman) {
         // Paper start
         //this.c = entityhuman;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 66c0725c3dc28e49387d2b9f1a15aa0758763c08..8393a0253ac16a8f15f78288d6cc31f8688c403c 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -109,6 +109,11 @@ public class PurpurWorldConfig {
         });
     }
 
+    public boolean signRightClickEdit = false;
+    private void signSettings() {
+        signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
+    }
+
     public boolean turtleEggsBreakFromExpOrbs = true;
     public boolean turtleEggsBreakFromItems = true;
     public boolean turtleEggsBreakFromMinecarts = true;
