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

32 Zeilen
1.7 KiB
Diff

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
2018-09-30 03:57:59 +02:00
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
index 22568201a292edc8e25396e55cad1572d419b775..7ad595d5d7e090c523aa45a10d0f84b609ea86df 100644
2018-09-30 03:57:59 +02:00
--- a/src/main/java/net/minecraft/server/ItemStack.java
+++ b/src/main/java/net/minecraft/server/ItemStack.java
2020-06-25 16:09:55 +02:00
@@ -244,6 +244,7 @@ public final class ItemStack {
2018-09-30 03:57:59 +02: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 03:57:59 +02: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
index 54cad33750efd80b104664723e1115d107c7a72d..28df29649a3e78708564b5ab9dc4d340835db9a3 100644
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
@@ -301,7 +301,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
// CraftBukkit start
@Override
public boolean isFilteredNBT() {
- return true;
+ return false; // Paper
}
// CraftBukkit end
}