mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 17:07:43 +01:00
52 lines
2.4 KiB
Diff
52 lines
2.4 KiB
Diff
From 781d16718818af366e999bbc01453d18ee3d820f 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 8a31054a1d..503090e38a 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.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 EnumInteractionResult.SUCCESS;
|
|
+ }
|
|
+ // Purpur end
|
|
+
|
|
return tileentitysign.b(entityhuman) ? EnumInteractionResult.SUCCESS : EnumInteractionResult.PASS;
|
|
} else {
|
|
return EnumInteractionResult.PASS;
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 6a9647367f..6cb887ca8b 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -58,6 +58,11 @@ public class PurpurWorldConfig {
|
|
return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.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.24.0
|
|
|