aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2016-05-15 01:41:36 -0500
committerZach Brown <[email protected]>2016-05-15 01:41:36 -0500
commit613655eae660d3cf2bc36e4d1561bd628324a1fe (patch)
tree489d2ef5c2763ccf0327a3a5444757a9874b1ccd
parent024bc323bc83ba6bfddfa24a05495b081ed42ed5 (diff)
downloadPaper-613655eae660d3cf2bc36e4d1561bd628324a1fe.tar.gz
Paper-613655eae660d3cf2bc36e4d1561bd628324a1fe.zip
TileEntityLootable can call processRefill with a null player
Seems specific to EntityMinecartChest Fixes GH-290
-rw-r--r--Spigot-Server-Patches/0148-LootTable-API-Replenishable-Lootables-Feature.patch14
1 files 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 <[email protected]>
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