#1238: Remove unnecessary sign ticking

By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2023-12-17 09:29:48 +11:00
parent 6f023adfe9
commit bbb64e5e0e
4 changed files with 39 additions and 1 deletions

View file

@ -25,3 +25,11 @@
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
}
}

View file

@ -0,0 +1,10 @@
--- a/net/minecraft/world/level/block/CeilingHangingSignBlock.java
+++ b/net/minecraft/world/level/block/CeilingHangingSignBlock.java
@@ -161,6 +161,6 @@
@Nullable
@Override
public <T extends TileEntity> BlockEntityTicker<T> getTicker(World world, IBlockData iblockdata, TileEntityTypes<T> tileentitytypes) {
- return createTickerHelper(tileentitytypes, TileEntityTypes.HANGING_SIGN, TileEntitySign::tick);
+ return null; // Craftbukkit - remove unnecessary sign ticking
}
}

View file

@ -0,0 +1,10 @@
--- a/net/minecraft/world/level/block/WallHangingSignBlock.java
+++ b/net/minecraft/world/level/block/WallHangingSignBlock.java
@@ -186,6 +186,6 @@
@Nullable
@Override
public <T extends TileEntity> BlockEntityTicker<T> getTicker(World world, IBlockData iblockdata, TileEntityTypes<T> tileentitytypes) {
- return createTickerHelper(tileentitytypes, TileEntityTypes.HANGING_SIGN, TileEntitySign::tick);
+ return null; // Craftbukkit - remove unnecessary sign ticking
}
}

View file

@ -132,7 +132,17 @@
}
@Override
@@ -281,7 +342,7 @@
@@ -276,12 +337,17 @@
@Nullable
public UUID getPlayerWhoMayEdit() {
+ // CraftBukkit start - unnecessary sign ticking removed, so do this lazily
+ if (this.level != null && this.playerWhoMayEdit != null) {
+ clearInvalidPlayerWhoMayEdit(this, this.level, this.playerWhoMayEdit);
+ }
+ // CraftBukkit end
return this.playerWhoMayEdit;
}
private void markUpdated() {
this.setChanged();