aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch
blob: dc47e3b3280b8d31a4864d4e89bc8ef857e3a2fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 95dc7e4a604e613751eb16b127e3203027c8c26d..dea478d4790be0c0d6e14cd7673d161abfc46e08 100644
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
@@ -244,6 +244,7 @@ public final class ItemStack {
                     enuminteractionresult = EnumInteractionResult.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
                     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 47ed08c414dca46720a3d4808ea71f999232e70c..17498eae50560fd26402a2e7032fe94eb924989b 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -300,7 +300,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
     // CraftBukkit start
     @Override
     public boolean isFilteredNBT() {
-        return true;
+        return false; // Paper
     }
     // CraftBukkit end
 }