2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
Allow chests to be placed with NBT (#1425)
This restores vanilla behavior of allowing placed chests to retain any Block Entity Tag data.
Upstream added filtering to chests, breaking vanilla behavior, and preventing use of loot table chests as a reward mechanism.
Upon review, we can find no security risk in allowing players to place a chest with NBT data, as Spawn Eggs, Minecarts, command blocks etc all have their own checks.
Additionally, survival mode players, non op players can not create these items anyways. If a player has Creative or Op, they already have high levels of access.
Plus, Chests aren't the only inventory that could have free form items, so this filter was insufficient anyways.
2018-09-09 18:53:23 +02:00
|
|
|
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
|
2020-08-25 04:22:08 +02:00
|
|
|
index 64e9d50be03cbefa521bf8c2e6dba5ceadda78b6..63aa474c73f506737cb5de31977bffcd17d4dc11 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();
|
2019-04-06 16:23:05 +02:00
|
|
|
+ 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);
|
Allow chests to be placed with NBT (#1425)
This restores vanilla behavior of allowing placed chests to retain any Block Entity Tag data.
Upstream added filtering to chests, breaking vanilla behavior, and preventing use of loot table chests as a reward mechanism.
Upon review, we can find no security risk in allowing players to place a chest with NBT data, as Spawn Eggs, Minecarts, command blocks etc all have their own checks.
Additionally, survival mode players, non op players can not create these items anyways. If a player has Creative or Op, they already have high levels of access.
Plus, Chests aren't the only inventory that could have free form items, so this filter was insufficient anyways.
2018-09-09 18:53:23 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java
|
2020-08-25 04:22:08 +02:00
|
|
|
index 52f64460ba1bfb298f343f71a923c8f34de9e39d..d429c6a4154497fea813ef98d1a30eef2ca5e5e0 100644
|
Allow chests to be placed with NBT (#1425)
This restores vanilla behavior of allowing placed chests to retain any Block Entity Tag data.
Upstream added filtering to chests, breaking vanilla behavior, and preventing use of loot table chests as a reward mechanism.
Upon review, we can find no security risk in allowing players to place a chest with NBT data, as Spawn Eggs, Minecarts, command blocks etc all have their own checks.
Additionally, survival mode players, non op players can not create these items anyways. If a player has Creative or Op, they already have high levels of access.
Plus, Chests aren't the only inventory that could have free form items, so this filter was insufficient anyways.
2018-09-09 18:53:23 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/TileEntityChest.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/TileEntityChest.java
|
2020-07-29 21:50:16 +02:00
|
|
|
@@ -300,7 +300,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic
|
Allow chests to be placed with NBT (#1425)
This restores vanilla behavior of allowing placed chests to retain any Block Entity Tag data.
Upstream added filtering to chests, breaking vanilla behavior, and preventing use of loot table chests as a reward mechanism.
Upon review, we can find no security risk in allowing players to place a chest with NBT data, as Spawn Eggs, Minecarts, command blocks etc all have their own checks.
Additionally, survival mode players, non op players can not create these items anyways. If a player has Creative or Op, they already have high levels of access.
Plus, Chests aren't the only inventory that could have free form items, so this filter was insufficient anyways.
2018-09-09 18:53:23 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
@Override
|
|
|
|
public boolean isFilteredNBT() {
|
|
|
|
- return true;
|
|
|
|
+ return false; // Paper
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|