2020-04-22 00:06:30 +02:00
|
|
|
From 6e4fca561d5f911253c660b4a0efa1651ac22608 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-04-22 00:06:30 +02:00
|
|
|
index 0b0c3c68..d953cdef 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
|
2019-12-12 17:20:43 +01:00
|
|
|
@@ -240,6 +240,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-04-22 00:06:30 +02:00
|
|
|
index c4766f72..b22bd06e 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
|
2019-12-12 17:20:43 +01:00
|
|
|
@@ -292,7 +292,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
|
|
|
|
}
|
|
|
|
--
|
2020-04-22 00:06:30 +02:00
|
|
|
2.25.1.windows.1
|
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
|
|
|
|