Paper/Spigot-Server-Patches/0355-Allow-chests-to-be-placed-with-NBT-data.patch
Zach Brown 684bd2adbc
Upstate upstream B/CB
--- work/Bukkit
Submodule work/Bukkit 9a793cce8..0c1d258bb:
  > Make PigZapEvent extend EntityTransformEvent

--- work/CraftBukkit
Submodule work/CraftBukkit ee6684bba..6a398ac44:
  > SPIGOT-4511: Trident doesn't lose durability
  > Tweak outdated windows
2018-12-02 18:31:09 -05:00

43 lines
1.8 KiB
Diff

From 18ec774319308ba9befa7a944933bd457259d580 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/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index eea6d9419..4d29cb8d8 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -228,6 +228,15 @@ public final class ItemStack {
enuminteractionresult = EnumInteractionResult.FAIL; // cancel placement
// PAIL: Remove this when MC-99075 fixed
placeEvent.getPlayer().updateInventory();
+
+ // Paper start
+ for (Map.Entry<BlockPosition, TileEntity> e : world.capturedTileEntities.entrySet()) {
+ if (e.getValue() instanceof TileEntityLootable) {
+ ((TileEntityLootable) e.getValue()).setLootTable(null);
+ }
+ }
+ // Paper end
+
// revert back all captured blocks
for (BlockState blockstate : blocks) {
blockstate.update(true, false);
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
index 9573a4ecd..7594c16e9 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -305,7 +305,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
// CraftBukkit start
@Override
public boolean isFilteredNBT() {
- return true;
+ return false; // Paper
}
// CraftBukkit end
}
--
2.19.1