mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-22 07:11:54 +01:00
Call InventoryPreClickEvent even without any inventory condition
This commit is contained in:
parent
23e82e0ae2
commit
ef28720496
@ -518,10 +518,8 @@ public class InventoryClickProcessor {
|
||||
// Wait for inventory conditions + events to possibly close the inventory
|
||||
player.UNSAFE_changeDidCloseInventory(false);
|
||||
|
||||
final List<InventoryCondition> inventoryConditions = isPlayerInventory ?
|
||||
player.getInventory().getInventoryConditions() : inventory.getInventoryConditions();
|
||||
if (!inventoryConditions.isEmpty()) {
|
||||
|
||||
// PreClickEvent
|
||||
{
|
||||
InventoryPreClickEvent inventoryPreClickEvent = new InventoryPreClickEvent(player, inventory, slot, clickType, clicked, cursor);
|
||||
player.callEvent(InventoryPreClickEvent.class, inventoryPreClickEvent);
|
||||
cursor = inventoryPreClickEvent.getCursorItem();
|
||||
@ -531,6 +529,12 @@ public class InventoryClickProcessor {
|
||||
if (inventoryPreClickEvent.isCancelled()) {
|
||||
clickResult.setRefresh(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Inventory conditions
|
||||
final List<InventoryCondition> inventoryConditions = isPlayerInventory ?
|
||||
player.getInventory().getInventoryConditions() : inventory.getInventoryConditions();
|
||||
if (!inventoryConditions.isEmpty()) {
|
||||
|
||||
for (InventoryCondition inventoryCondition : inventoryConditions) {
|
||||
InventoryConditionResult result = new InventoryConditionResult(clicked, cursor);
|
||||
|
Loading…
Reference in New Issue
Block a user