1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-17 02:34:30 +01:00

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 0c78971552
commit b9c321ff21

View file

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