From b9c321ff21848f214584cd599559fe06528f9627 Mon Sep 17 00:00:00 2001 From: Zach Brown <1254957+zachbr@users.noreply.github.com> 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 --- .../LootTable-API-Replenishable-Lootables-Feature.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index a6dfcfcea..442e39895 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -322,7 +322,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + 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 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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(); + }