Paper/Spigot-Server-Patches/0301-Allow-chests-to-be-placed-with-NBT-data.patch

35 lines
1.6 KiB
Diff
Raw Normal View History

2019-07-20 12:01:24 +08:00
From d59739ffc3b8c3667e141de7d76a1a1d8ea6c478 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 09:57:59 +08:00
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
2019-07-20 12:01:24 +08:00
index 1e23d77e72..0e164840fd 100644
2018-09-30 09:57:59 +08:00
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
2019-05-05 16:33:44 +08:00
@@ -235,6 +235,7 @@ public final class ItemStack {
2018-09-30 09:57:59 +08:00
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
2018-09-30 09:57:59 +08:00
// 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
2019-07-20 12:01:24 +08:00
index 387e366130..6c10f0eb89 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -309,7 +309,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
// CraftBukkit start
@Override
public boolean isFilteredNBT() {
- return true;
+ return false; // Paper
}
// CraftBukkit end
}
--
2.22.0