aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-11-11 11:23:12 -0800
committerGitHub <[email protected]>2023-11-11 11:23:12 -0800
commitc95bc5f86d24383ed21b529f90c26e4f481f0a50 (patch)
tree13033185269638889cb2e8508251e4ec1bcdf49b
parent4675152f4908431e0f944a7bf9fa3b2181a2dfd6 (diff)
downloadPaper-c95bc5f86d24383ed21b529f90c26e4f481f0a50.tar.gz
Paper-c95bc5f86d24383ed21b529f90c26e4f481f0a50.zip
Don't unpack loot table for TEs not in world (#9918)
Fixed by 23w44a/1.20.3
-rw-r--r--patches/server/1047-Don-t-unpack-loot-table-for-TEs-not-in-world.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/patches/server/1047-Don-t-unpack-loot-table-for-TEs-not-in-world.patch b/patches/server/1047-Don-t-unpack-loot-table-for-TEs-not-in-world.patch
new file mode 100644
index 0000000000..2c7310b079
--- /dev/null
+++ b/patches/server/1047-Don-t-unpack-loot-table-for-TEs-not-in-world.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Tue, 7 Nov 2023 18:59:04 -0800
+Subject: [PATCH] Don't unpack loot table for TEs not in world
+
+Fixed by 23w44a/1.20.3. Remove it then
+
+diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+index 081691f9710ff1115e4308f79ed49fbc38941193..3e638f12956e57548f76c7e2403ba370f7baa249 100644
+--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
++++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+@@ -70,7 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
+ }
+
+ public void unpackLootTable(@Nullable Player player) {
+- if (this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper
++ if (this.level != null && this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper - don't unpack loot table if not in world
+ LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
+ if (player instanceof ServerPlayer) {
+ CriteriaTriggers.GENERATE_LOOT.trigger((ServerPlayer)player, this.lootTable);