mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
re-add sign and book color code patches
This commit is contained in:
49
patches/server/0183-Store-placer-on-Block-when-placed.patch
Normal file
49
patches/server/0183-Store-placer-on-Block-when-placed.patch
Normal file
@@ -0,0 +1,49 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 3 Jul 2021 18:40:32 -0500
|
||||
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 1b829ad61a25ef1e18adefe291d91fdb7401956d..f93cb39c2664b74066bd9ac352137c11e612e5f9 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -475,6 +475,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
|
||||
for (BlockState blockstate : blocks) {
|
||||
blockstate.update(true, false);
|
||||
+ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur
|
||||
}
|
||||
world.preventPoiUpdated = false;
|
||||
|
||||
@@ -506,6 +507,7 @@ public final class ItemStack implements DataComponentHolder {
|
||||
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
||||
block.onPlace(world, newblockposition, oldBlock, true, context); // Paper - pass context
|
||||
}
|
||||
+ block.getBlock().forgetPlacer(); // Purpur
|
||||
|
||||
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 cf8b8c8efd1c9c81eb5f02d75bd75875eb66771f..6f7e90d406b088fee0eb254f8042bd404d8f36fa 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -438,7 +438,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
} // Paper - fix drops not preventing stats/food exhaustion
|
||||
}
|
||||
|
||||
- public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {}
|
||||
+ // Purpur start
|
||||
+ @Nullable protected LivingEntity placer = null;
|
||||
+
|
||||
+ public void setPlacedBy(Level world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack itemStack) {
|
||||
+ this.placer = placer;
|
||||
+ }
|
||||
+
|
||||
+ public void forgetPlacer() {
|
||||
+ this.placer = null;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
|
||||
public boolean isPossibleToRespawnInThis(BlockState state) {
|
||||
return !state.isSolid() && !state.liquid();
|
||||
Reference in New Issue
Block a user