mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: a4f066cc Fix method profiler inbalance introduced in a2a9ffe (#3132) c65dcad3 Don't delay chunk unloads during entity ticking bc17ce69 Delay unsafe actions until after entity ticking is done - Fixes #3114 5553e6b3 Disable Sync Events firing Async errors during shutdown e12c51d9 Use better variable for isStopping() API 586ee2bb Remove patch for MC-111480, fixed in 1.14 09a94215 Remove streams from Mob AI System bb5c294e Fix Disabling Asynchronous Chunks 089d8356 Implement Chunk Priority / Urgency System for World Gen fce69af7 Use dedicated thread for main thread blocking chunk loads 588b62e4 Add tick times API and /mspt command (#3102) 11de41c7 Add API MinecraftServer#isStopping (#3129) 942ff3c2 My patches are under MIT (#3130)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
From 2c820399a19585925137de9ec871152990cb9c2a Mon Sep 17 00:00:00 2001
|
||||
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
||||
Date: Sat, 19 Oct 2019 02:43:17 -0500
|
||||
Subject: [PATCH] Add LootableInventoryFirstFillEvent
|
||||
|
||||
---
|
||||
.../paper/loottable/PaperLootableInventoryData.java | 4 ++++
|
||||
.../paper/loottable/PaperTileEntityLootableInventory.java | 5 ++++-
|
||||
2 files changed, 8 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
index b5401eaf97..1decf0e895 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
|
||||
@@ -49,6 +49,10 @@ public class PaperLootableInventoryData {
|
||||
|
||||
// ALWAYS process the first fill or if the feature is disabled
|
||||
if (this.lastFill == -1 || !this.lootable.getNMSWorld().paperConfig.autoReplenishLootables) {
|
||||
+ // Purpur start
|
||||
+ LootableInventory inventory = lootable.getAPILootableInventory();
|
||||
+ if (inventory != null) new net.pl3x.purpur.event.block.LootableInventoryFirstFillEvent(player == null ? null : (Player) player.getBukkitEntity(), inventory).callEvent();
|
||||
+ // Purpur end
|
||||
return true;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java
|
||||
index d50410532c..2f24e5a702 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java
|
||||
@@ -57,7 +57,10 @@ public class PaperTileEntityLootableInventory implements PaperLootableBlockInven
|
||||
if (world == null) {
|
||||
return null;
|
||||
}
|
||||
- return (LootableInventory) getBukkitWorld().getBlockAt(MCUtil.toLocation(world, tileEntityLootable.getPosition())).getState();
|
||||
+ // Purpur start
|
||||
+ org.bukkit.block.BlockState state = getBukkitWorld().getBlockAt(MCUtil.toLocation(world, tileEntityLootable.getPosition())).getState();
|
||||
+ return state instanceof LootableInventory ? (LootableInventory) state : null;
|
||||
+ // Purpur end
|
||||
}
|
||||
|
||||
@Override
|
||||
--
|
||||
2.24.0
|
||||
|
||||
Reference in New Issue
Block a user