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/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
index 1844ea93f8cea420f01937f85ed17c0ec1bb8bf0..9e80ba8970cad91ea22ac701f76e1413551a591f 100644
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
@@ -14,6 +14,7 @@ import net.minecraft.world.item.DyeItem;
 import net.minecraft.world.item.Item;
 import net.minecraft.world.item.ItemStack;
 import net.minecraft.world.item.Items;
+import net.minecraft.world.item.SignItem;
 import net.minecraft.world.level.BlockGetter;
 import net.minecraft.world.level.Level;
 import net.minecraft.world.level.LevelAccessor;
@@ -108,6 +109,17 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
                         }
                     }
 
+                    // Purpur start - right click to open sign editor
+                    if (world.purpurConfig.signRightClickEdit && itemStack.getItem() instanceof SignItem &&
+                        !player.isCrouching() && player.getAbilities().mayBuild &&
+                        player.getBukkitEntity().hasPermission("purpur.sign.edit")) {
+                        signBlockEntity.setEditable(true);
+                        signBlockEntity.setAllowedPlayerEditor(player.getUUID());
+                        player.openTextEdit(signBlockEntity);
+                        return InteractionResult.SUCCESS;
+                    }
+                    // Purpur end
+
                     return signBlockEntity.executeClickCommands((ServerPlayer)player) ? InteractionResult.SUCCESS : InteractionResult.PASS;
                 } else {
                     return InteractionResult.PASS;
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index edc6dcba5e3f9331e0e451aafb8a6053e804c3d6..af8cee33ea6780c2447361354497fbb6d5ad4501 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -140,6 +140,11 @@ public class PurpurWorldConfig {
         });
     }
 
+    public boolean signRightClickEdit = false;
+    private void signSettings() {
+        signRightClickEdit = getBoolean("blocks.sign.right-click-edit", signRightClickEdit);
+    }
+
     public boolean babiesAreRidable = true;
     public boolean untamedTamablesAreRidable = true;
     public boolean useNightVisionWhenRiding = false;
