3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00

TileEntityLootable can call processRefill with a null player

Seems specific to EntityMinecartChest
Fixes GH-290
Dieser Commit ist enthalten in:
Zach Brown 2016-05-15 01:41:36 -05:00
Ursprung 024bc323bc
Commit 613655eae6
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: CC9DA35FC5450B76

Datei anzeigen

@ -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);
+ }
+ 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