mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
51 lines
2.2 KiB
Diff
51 lines
2.2 KiB
Diff
From e1cb4d184b4548f4895327d7cb1ce9aef6904eaf 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 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 6e6d6defd..7f996591f 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
|
|
|