Paper/patches/server/0256-Allow-chests-to-be-placed-with-NBT-data.patch

32 lines
1.8 KiB
Diff
Raw Normal View History

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
2022-12-07 20:22:28 +01:00
index 504a56fb2f2901c67ed22b9f0a57eb8db10ca4df..7d1e41272d05a8cb8d1adbcd2e9bc00f1a6f95fe 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
2022-12-07 20:22:28 +01:00
@@ -368,6 +368,7 @@ public final class ItemStack {
2021-06-11 14:02:28 +02:00
enuminteractionresult = InteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
+ world.capturedTileEntities.clear(); // Paper - clear out tile entities as chests and such will pop loot
// 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
2022-06-08 02:15:06 +02:00
index d4f5af759bbb6208432ad7b5002af5455dc7958c..a71414397bd45ee7bcacfeef0041d80dfa25f114 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
2022-06-08 02:15:06 +02:00
@@ -237,7 +237,7 @@ public class ChestBlockEntity extends RandomizableContainerBlockEntity implement
2021-06-11 14:02:28 +02:00
// CraftBukkit start
@Override
public boolean onlyOpCanSetNbt() {
- return true;
+ return false; // Paper
}
// CraftBukkit end
}