TileEntityLootable can call processRefill with a null player

Seems specific to EntityMinecartChest
Fixes GH-290
This commit is contained in:
Zach Brown 2016-05-15 01:41:36 -05:00
parent 024bc323bc
commit 613655eae6
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76

View file

@ -1,4 +1,4 @@
From 0f72c89ba8ab6abcf9d92154c315ddfdf2a54bce Mon Sep 17 00:00:00 2001
From 3cae4941492db646e4a46f31da7b72aa878fcf01 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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);
+ }
+ 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