Paper/patches/server/0973-Don-t-tick-signs.patch
Jake Potrebic 90fe0d58a5
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9825)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
897a0a23 SPIGOT-5753: Back PotionType by a minecraft registry
255b2aa1 SPIGOT-7080: Add World#locateNearestBiome
ff984826 Remove javadoc.io doc links

CraftBukkit Changes:
71b0135cc SPIGOT-5753: Back PotionType by a minecraft registry
a6bcb8489 SPIGOT-7080: Add World#locateNearestBiome
ad0e57434 SPIGOT-7502: CraftMetaItem - cannot deserialize BlockStateTag
b3efca57a SPIGOT-6400: Use Mockito instead of InvocationHandler
38c599f9d PR-1272: Only allow one entity in CraftItem instead of two
f065271ac SPIGOT-7498: ChunkSnapshot.getBlockEmittedLight() gets 64 blocks upper in Overworld

Spigot Changes:
e0e223fe Remove javadoc.io doc links
2023-10-22 20:12:00 +01:00

64 Zeilen
3.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Date: Wed, 12 Jul 2023 17:38:26 -0400
Subject: [PATCH] Don't tick signs
Minecraft now ticks signs in order to validate the playerWhoMayEdit field. This is a horrible idea, as this means that even waxed signs are ticked for essentially no reason. This moves the logic lazily onto the getter.
== AT ==
private net.minecraft.world.level.block.entity.SignBlockEntity playerWhoMayEdit
diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
index 6c9d163b9f857806461dc72e54713f1a4f3a5c31..0bd8ea3143b2e9755d492af4596622d1dca1afaf 100644
--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
@@ -144,6 +144,6 @@ public class CeilingHangingSignBlock extends SignBlock {
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
+ return null; // Paper
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
index 0c1c6fbcf625da4a28514e0d040deb6c98ba9507..614777d15bcf4141a89d0a0f7bd880526c668ffd 100644
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
@@ -207,6 +207,6 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
- return createTickerHelper(type, BlockEntityType.SIGN, SignBlockEntity::tick);
+ return null; // Paper
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
index d818d3ea6d28aa6ffb62127d4efd585d6f2935d1..ae232311f12c72ff62d3d18f25e3ebf46ce1ace2 100644
--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
@@ -167,6 +167,6 @@ public class WallHangingSignBlock extends SignBlock {
@Nullable
@Override
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
+ return null; // Paper
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
index 9eea2982e92e9bc7a53962dc6b21de60f9e5a4c7..38cde466714e5663cd416b6afd5d2558e139ec09 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
@@ -367,6 +367,12 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
@Nullable
public UUID getPlayerWhoMayEdit() {
+ // Paper start
+ if (this.hasLevel() && this.playerWhoMayEdit != null) {
+ // Manually invalidate the value lazily.
+ this.clearInvalidPlayerWhoMayEdit(this, this.getLevel(), this.playerWhoMayEdit);
+ }
+ // Paper end
return this.playerWhoMayEdit;
}