mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
51 lines
2.2 KiB
Diff
51 lines
2.2 KiB
Diff
From d3ac2ab0ac6e0054d8a0c2fbcf36128e89eb223c 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 | 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 e058a85ba6..b1e0e9435f 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 dc2da586e7..ee92fd26e6 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
|
|
|