mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
52 lines
2.3 KiB
Diff
52 lines
2.3 KiB
Diff
From cc4bab45ae6d4e889e03196225b538ff245d3fdb 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] Right click to open sign editor
|
|
|
|
---
|
|
src/main/java/net/minecraft/server/BlockSign.java | 11 +++++++++++
|
|
src/main/java/net/pl3x/purpur/PurpurWorldConfig.java | 5 +++++
|
|
2 files changed, 16 insertions(+)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockSign.java b/src/main/java/net/minecraft/server/BlockSign.java
|
|
index e058a85ba..8cf92d7a7 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockSign.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockSign.java
|
|
@@ -52,6 +52,17 @@ 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 &&
|
|
+ entityhuman.getBukkitEntity().hasPermission("purpur.sign.click.opens.editor")) {
|
|
+ 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 8d1f3feb8..8bd887b1c 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 = false;
|
|
+ private void editableSigns() {
|
|
+ editableSigns = getBoolean("editable-signs", editableSigns);
|
|
+ }
|
|
+
|
|
public boolean campfireObeysGravity = true;
|
|
private void campfireObeysGravity() {
|
|
campfireObeysGravity = getBoolean("campfire-obeys-gravity", campfireObeysGravity);
|
|
--
|
|
2.23.0.rc1
|
|
|