mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Updated Upstream (Paper & Tuinity)
Upstream has released updates that appear to apply and compile correctly Paper Changes:b33b63908eSupport complex components in written book builder (#6337)bfb3d42b44Optimize entity tracker passenger checks (#6361)399710ff79Add reobf mappings patch for MinecraftServer#getLootTables (#6368)25cd8aba9fConfig option for Piglins guarding chests (#4829)80650e8936Added EntityItemDamageEvent (#4928) Tuinity Changes:8e7cc4dc96Do not submit profile lookups to worldgen threads
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
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 b3b5b75e3df805027c5daa98d7fc1d4d5f0d9675..af0a195fb82eb7872bc6206d39c2963bd468ccd6 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -381,6 +381,7 @@ public final class ItemStack {
|
||||
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
|
||||
for (BlockState blockstate : blocks) {
|
||||
blockstate.update(true, false);
|
||||
+ ((CraftBlock) blockstate.getBlock()).getNMS().getBlock().forgetPlacer(); // Purpur
|
||||
}
|
||||
world.preventPoiUpdated = false;
|
||||
|
||||
@@ -409,6 +410,7 @@ public final class ItemStack {
|
||||
if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically
|
||||
block.getBlock().onPlace(block, world, newblockposition, oldBlock, true, itemactioncontext); // Paper - pass itemactioncontext
|
||||
}
|
||||
+ 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 0f295a496d4d94811199fa952ed68325ee1df0f6..5aab59cba33bcf4b615977dcd9261b0cf2b56aa9 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -461,7 +461,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
Block.dropResources(state, world, pos, blockEntity, player, stack);
|
||||
}
|
||||
|
||||
- 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() {
|
||||
return !this.material.isSolid() && !this.material.isLiquid();
|
||||
Reference in New Issue
Block a user