From 49c8b346535bfb9c65daa93c72e0ed7ec10d3290 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 6 Jun 2016 19:56:51 -0400 Subject: [PATCH] Fix bug with lootable refresh not saving inventory if on --- ...-API-Replenishable-Lootables-Feature.patch | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index 442e398954..c44b2f6b71 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -453,6 +453,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (this.c != null) { nbttagcompound.setString("LootTable", this.c.toString()); if (this.d != 0L) { + nbttagcompound.setLong("LootTableSeed", this.d); + } +- } else { ++ } if (true) { // Paper - Always save the items, Table may stick around + NBTTagList nbttaglist = new NBTTagList(); + + for (int i = 0; i < this.items.length; ++i) { @@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp protected void a(NBTTagCompound nbttagcompound) { super.a(nbttagcompound); @@ -461,6 +468,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (nbttagcompound.hasKeyOfType("LootTable", 8)) { this.c = new MinecraftKey(nbttagcompound.getString("LootTable")); this.d = nbttagcompound.getLong("LootTableSeed"); +- } else { ++ } if (true) { // Paper - always load the items, table may still remain + NBTTagList nbttaglist = nbttagcompound.getList("Items", 10); + + for (int i = 0; i < nbttaglist.size(); ++i) { @@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp } @@ -555,7 +567,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (nbttagcompound.hasKeyOfType("LootTable", 8)) { this.m = new MinecraftKey(nbttagcompound.getString("LootTable")); this.n = nbttagcompound.getLong("LootTableSeed"); -@@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + return true; + } else { +- return false; ++ return true; // Paper - always load the items, table may still remain + } } protected boolean e(NBTTagCompound nbttagcompound) { @@ -564,6 +580,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 nbttagcompound.setString("LootTable", this.m.toString()); if (this.n != 0L) { @@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements + + return true; + } else { +- return false; ++ return true; // Paper - always save the items, table may still remain + } } protected void d(@Nullable EntityHuman entityhuman) {