testserver/Spigot-Server-Patches/0354-Allow-chests-to-be-pla...

43 lines
1.8 KiB
Diff
Raw Normal View History

From 4b5e545bb6a57d1fb6168e7ae397a111d33dace0 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
2018-09-30 01:57:59 +00:00
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index d32ea9c92..d1000805a 100644
2018-09-30 01:57:59 +00:00
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -232,6 +232,15 @@ public final class ItemStack {
2018-09-30 01:57:59 +00:00
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 f00c7dade..961e9d62c 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.20.1