2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: BillyGalbreath <Blake.Galbreath@GMail.com>
|
|
|
|
Date: Sat, 8 Sep 2018 18:43:31 -0500
|
|
|
|
Subject: [PATCH] Allow chests to be placed with NBT data
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
2024-06-13 17:45:43 +02:00
|
|
|
index 6358cdada112cd3e17d9363111c931a4d21eb4b9..b5f1d223a3955e1b478712c581080904f86a2a2a 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
2024-04-27 00:08:35 +02:00
|
|
|
@@ -469,6 +469,7 @@ public final class ItemStack implements DataComponentHolder {
|
2021-06-11 14:02:28 +02:00
|
|
|
enuminteractionresult = InteractionResult.FAIL; // cancel placement
|
|
|
|
// PAIL: Remove this when MC-99075 fixed
|
|
|
|
placeEvent.getPlayer().updateInventory();
|
2024-01-21 13:56:22 +01:00
|
|
|
+ world.capturedTileEntities.clear(); // Paper - Allow chests to be placed with NBT data; clear out block entities as chests and such will pop loot
|
2021-06-11 14:02:28 +02:00
|
|
|
// revert back all captured blocks
|
2021-07-07 08:52:40 +02:00
|
|
|
world.preventPoiUpdated = true; // CraftBukkit - SPIGOT-5710
|
2021-06-11 14:02:28 +02:00
|
|
|
for (BlockState blockstate : blocks) {
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
2024-04-24 04:46:06 +02:00
|
|
|
index 9d6262e286a00f840d88d6eb6bfdb304467466e3..b88aa184cd06a0485146f58a5b61a56a50911209 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/level/block/entity/ChestBlockEntity.java
|
2024-04-24 04:46:06 +02:00
|
|
|
@@ -238,7 +238,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
|
2021-06-11 14:02:28 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
@Override
|
|
|
|
public boolean onlyOpCanSetNbt() {
|
|
|
|
- return true;
|
2024-01-21 13:56:22 +01:00
|
|
|
+ return false; // Paper - Allow chests to be placed with NBT data
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|