diff --git a/patches/server/Don-t-tick-signs.patch b/patches/server/Don-t-tick-signs.patch new file mode 100644 index 0000000000..450b2434cd --- /dev/null +++ b/patches/server/Don-t-tick-signs.patch @@ -0,0 +1,63 @@ +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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java +@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock { + @Nullable + @Override + public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java +@@ -0,0 +0,0 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo + @Nullable + @Override + public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java +@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock { + @Nullable + @Override + public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 +@@ -0,0 +0,0 @@ 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; + } + diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index d6d85b5332..dc176e1953 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -184,6 +184,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 })); this.byName = Maps.newHashMap(builder.build()); // CraftBukkit RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); +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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java +@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock { + public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + BlockEntity itemStack = world.getBlockEntity(pos); + if (itemStack instanceof SignBlockEntity signBlockEntity) { +- ItemStack itemStack = player.getItemInHand(hand); +- if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack)) { ++ // Paper start - decompile fixes ++ ItemStack itemStack0 = player.getItemInHand(hand); ++ if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack0)) { ++ // Paper end - decompile fixes + return InteractionResult.PASS; + } + } 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/block/SignBlock.java @@ -209,6 +226,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!world.isClientSide) { boolean bl2 = signBlockEntity.isFacingFrontText(player); SignText signText = signBlockEntity.getText(bl2); +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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java +@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock { + public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + BlockEntity itemStack = world.getBlockEntity(pos); + if (itemStack instanceof SignBlockEntity signBlockEntity) { +- ItemStack itemStack = player.getItemInHand(hand); +- if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack)) { ++ // Paper start - decompile fixes ++ ItemStack itemStack0 = player.getItemInHand(hand); ++ if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack0)) { ++ // Paper end + return InteractionResult.PASS; + } + } diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java