mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
35 lines
1.8 KiB
Diff
35 lines
1.8 KiB
Diff
--- a/net/minecraft/world/level/block/BlockSign.java
|
|
+++ b/net/minecraft/world/level/block/BlockSign.java
|
|
@@ -142,7 +142,7 @@
|
|
} else if (flag1) {
|
|
return EnumInteractionResult.SUCCESS;
|
|
} else if (!this.otherPlayerIsEditingSign(entityhuman, tileentitysign) && entityhuman.mayBuild() && this.hasEditableText(entityhuman, tileentitysign, flag)) {
|
|
- this.openTextEdit(entityhuman, tileentitysign, flag);
|
|
+ this.openTextEdit(entityhuman, tileentitysign, flag, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
|
return EnumInteractionResult.SUCCESS;
|
|
} else {
|
|
return EnumInteractionResult.PASS;
|
|
@@ -188,6 +188,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);
|
|
}
|
|
@@ -201,6 +210,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
|
|
}
|
|
}
|