Store placer on Block when placed

This commit is contained in:
William Blake Galbreath
2025-01-12 11:12:58 -08:00
committed by granny
parent ab27287ecb
commit 305d99234b
3 changed files with 35 additions and 49 deletions

View File

@@ -0,0 +1,19 @@
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -412,7 +_,15 @@
}
public void setPlacedBy(Level level, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) {
- }
+ this.placer = placer; // Purpur - Store placer on Block when placed
+ }
+
+ // Purpur start - Store placer on Block when placed
+ @Nullable protected LivingEntity placer = null;
+ public void forgetPlacer() {
+ this.placer = null;
+ }
+ // Purpur end - Store placer on Block when placed
public boolean isPossibleToRespawnInThis(BlockState state) {
return !state.isSolid() && !state.liquid();