[ci skip] add a good chunk of patch identifying comments

This commit is contained in:
granny
2024-12-16 04:03:27 -08:00
parent 73dae7f683
commit 998a4e6973
120 changed files with 3038 additions and 2824 deletions

View File

@@ -5,14 +5,14 @@ Subject: [PATCH] Store placer on Block when placed
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 095c86ea25fc4f385d96d2e92fa67a150e27c489..5964c2e77e9f21c72d9e0655e5f48d2798317779 100644
index 095c86ea25fc4f385d96d2e92fa67a150e27c489..b43a7bf5d8f555f97cc851c2c4c01b8a729396f6 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -508,6 +508,7 @@ public final class ItemStack implements DataComponentHolder {
world.isBlockPlaceCancelled = true; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent
for (BlockState blockstate : blocks) {
blockstate.update(true, false);
+ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur
+ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
}
world.isBlockPlaceCancelled = false; // Paper - prevent calling cleanup logic when undoing a block place upon a cancelled BlockPlaceEvent
world.preventPoiUpdated = false;
@@ -20,12 +20,12 @@ index 095c86ea25fc4f385d96d2e92fa67a150e27c489..5964c2e77e9f21c72d9e0655e5f48d27
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
block.onPlace(world, newblockposition, oldBlock, true, context);
}
+ block.getBlock().forgetPlacer(); // Purpur
+ block.getBlock().forgetPlacer(); // Purpur - Store placer on Block when placed
world.notifyAndUpdatePhysics(newblockposition, null, oldBlock, block, world.getBlockState(newblockposition), updateFlag, 512); // send null chunk as chunk.k() returns false by this point
}
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..17a157e2dcd977c9f7d886f8867056e88962c32e 100644
index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..b88326cc6c54bf38a37f2491bfb2f0e0deb2b1df 100644
--- a/src/main/java/net/minecraft/world/level/block/Block.java
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
@@ -433,7 +433,17 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -33,7 +33,7 @@ index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..17a157e2dcd977c9f7d886f8867056e8
}
- public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {}
+ // Purpur start
+ // Purpur start - Store placer on Block when placed
+ @Nullable protected LivingEntity placer = null;
+
+ public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
@@ -43,7 +43,7 @@ index c0b1f903962b25d8ff6c2b4fcd2be0e45de09b35..17a157e2dcd977c9f7d886f8867056e8
+ public void forgetPlacer() {
+ this.placer = null;
+ }
+ // Purpur end
+ // Purpur end - Store placer on Block when placed
public boolean isPossibleToRespawnInThis(BlockState state) {
return !state.isSolid() && !state.liquid();