From 613655eae660d3cf2bc36e4d1561bd628324a1fe Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 15 May 2016 01:41:36 -0500 Subject: [PATCH] TileEntityLootable can call processRefill with a null player Seems specific to EntityMinecartChest Fixes GH-290 --- ...Table-API-Replenishable-Lootables-Feature.patch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Spigot-Server-Patches/0148-LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/0148-LootTable-API-Replenishable-Lootables-Feature.patch index 0ffae90f30..ad950a2586 100644 --- a/Spigot-Server-Patches/0148-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/0148-LootTable-API-Replenishable-Lootables-Feature.patch @@ -1,4 +1,4 @@ -From 0f72c89ba8ab6abcf9d92154c315ddfdf2a54bce Mon Sep 17 00:00:00 2001 +From 3cae4941492db646e4a46f31da7b72aa878fcf01 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 1 May 2016 21:19:14 -0400 Subject: [PATCH] LootTable API & Replenishable Lootables Feature @@ -231,10 +231,10 @@ index 0000000..6680976 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java new file mode 100644 -index 0000000..c3d3cb9 +index 0000000..01c2713 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java -@@ -0,0 +1,180 @@ +@@ -0,0 +1,182 @@ +package com.destroystokyo.paper.loottable; + +import com.destroystokyo.paper.PaperWorldConfig; @@ -322,7 +322,7 @@ index 0000000..c3d3cb9 + } + return event.callEvent(); + } -+ public void processRefill(EntityHuman player) { ++ public void processRefill(@Nullable EntityHuman player) { + this.lastFill = System.currentTimeMillis(); + final PaperWorldConfig paperConfig = this.lootable.getNMSWorld().paperConfig; + if (paperConfig.autoReplenishLootables) { @@ -333,7 +333,9 @@ index 0000000..c3d3cb9 + if (paperConfig.changeLootTableSeedOnFill) { + this.lootable.setLootTableSeed(0); + } -+ this.setPlayerLootedState(player.getUniqueID(), true); ++ if (player != null) { // This means that numRefills can be incremented without a player being in the lootedPlayers list - Seems to be EntityMinecartChest specific ++ this.setPlayerLootedState(player.getUniqueID(), true); ++ } + } else { + this.lootable.clearLootTable(); + } @@ -727,5 +729,5 @@ index e9963e2..acb4dee 100644 CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) { -- -2.8.2 +2.8.2.windows.1