aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/level/block/BlockSign.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/level/block/BlockSign.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/level/block/BlockSign.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/level/block/BlockSign.patch b/patch-remap/og/net/minecraft/world/level/block/BlockSign.patch
new file mode 100644
index 0000000000..3affa3a945
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/level/block/BlockSign.patch
@@ -0,0 +1,35 @@
+--- a/net/minecraft/world/level/block/BlockSign.java
++++ b/net/minecraft/world/level/block/BlockSign.java
+@@ -118,7 +118,7 @@
+ } else if (flag2) {
+ return EnumInteractionResult.SUCCESS;
+ } else if (!this.otherPlayerIsEditingSign(entityhuman, tileentitysign) && entityhuman.mayBuild() && this.hasEditableText(entityhuman, tileentitysign, flag1)) {
+- this.openTextEdit(entityhuman, tileentitysign, flag1);
++ this.openTextEdit(entityhuman, tileentitysign, flag1, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
+ return this.getInteractionResult(flag);
+ } else {
+ return EnumInteractionResult.PASS;
+@@ -171,6 +171,15 @@
+ }
+
+ public void openTextEdit(EntityHuman entityhuman, TileEntitySign tileentitysign, boolean flag) {
++ // Craftbukkit start
++ openTextEdit(entityhuman, tileentitysign, flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause.UNKNOWN);
++ }
++
++ public void openTextEdit(EntityHuman entityhuman, TileEntitySign tileentitysign, boolean flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause cause) {
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerSignOpenEvent(entityhuman, tileentitysign, flag, cause)) {
++ return;
++ }
++ // Craftbukkit end
+ tileentitysign.setAllowedPlayerEditor(entityhuman.getUUID());
+ entityhuman.openTextEdit(tileentitysign, flag);
+ }
+@@ -184,6 +193,6 @@
+ @Nullable
+ @Override
+ public <T extends TileEntity> BlockEntityTicker<T> getTicker(World world, IBlockData iblockdata, TileEntityTypes<T> tileentitytypes) {
+- return createTickerHelper(tileentitytypes, TileEntityTypes.SIGN, TileEntitySign::tick);
++ return null; // Craftbukkit - remove unnecessary sign ticking
+ }
+ }