Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-16 03:20:07 +01:00
TileEntityLootable can call processRefill with a null player
Seems specific to EntityMinecartChest Fixes GH-290
Dieser Commit ist enthalten in:
Ursprung
024bc323bc
Commit
613655eae6
@ -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>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sun, 1 May 2016 21:19:14 -0400
|
Date: Sun, 1 May 2016 21:19:14 -0400
|
||||||
Subject: [PATCH] LootTable API & Replenishable Lootables Feature
|
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
|
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
|
new file mode 100644
|
||||||
index 0000000..c3d3cb9
|
index 0000000..01c2713
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java
|
+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java
|
||||||
@@ -0,0 +1,180 @@
|
@@ -0,0 +1,182 @@
|
||||||
+package com.destroystokyo.paper.loottable;
|
+package com.destroystokyo.paper.loottable;
|
||||||
+
|
+
|
||||||
+import com.destroystokyo.paper.PaperWorldConfig;
|
+import com.destroystokyo.paper.PaperWorldConfig;
|
||||||
@ -322,7 +322,7 @@ index 0000000..c3d3cb9
|
|||||||
+ }
|
+ }
|
||||||
+ return event.callEvent();
|
+ return event.callEvent();
|
||||||
+ }
|
+ }
|
||||||
+ public void processRefill(EntityHuman player) {
|
+ public void processRefill(@Nullable EntityHuman player) {
|
||||||
+ this.lastFill = System.currentTimeMillis();
|
+ this.lastFill = System.currentTimeMillis();
|
||||||
+ final PaperWorldConfig paperConfig = this.lootable.getNMSWorld().paperConfig;
|
+ final PaperWorldConfig paperConfig = this.lootable.getNMSWorld().paperConfig;
|
||||||
+ if (paperConfig.autoReplenishLootables) {
|
+ if (paperConfig.autoReplenishLootables) {
|
||||||
@ -333,7 +333,9 @@ index 0000000..c3d3cb9
|
|||||||
+ if (paperConfig.changeLootTableSeedOnFill) {
|
+ if (paperConfig.changeLootTableSeedOnFill) {
|
||||||
+ this.lootable.setLootTableSeed(0);
|
+ 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 {
|
+ } else {
|
||||||
+ this.lootable.clearLootTable();
|
+ this.lootable.clearLootTable();
|
||||||
+ }
|
+ }
|
||||||
@ -727,5 +729,5 @@ index e9963e2..acb4dee 100644
|
|||||||
|
|
||||||
CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) {
|
CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) {
|
||||||
--
|
--
|
||||||
2.8.2
|
2.8.2.windows.1
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren