From fc419cfa50736c1b1171b79b9b8c5a61b8fe3297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BD=C3=A1=C4=8Dek?= Date: Sun, 16 Oct 2022 09:49:47 +0200 Subject: [PATCH] Fix package for PlayerInventorySlotChangeEvent (#8475) Co-authored-by: Jakub Zacek --- patches/api/Add-PlayerInventorySlotChangeEvent.patch | 10 +++++----- .../server/Add-PlayerInventorySlotChangeEvent.patch | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/patches/api/Add-PlayerInventorySlotChangeEvent.patch b/patches/api/Add-PlayerInventorySlotChangeEvent.patch index b23ead0b6d..732843441e 100644 --- a/patches/api/Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/api/Add-PlayerInventorySlotChangeEvent.patch @@ -4,13 +4,13 @@ Date: Sun, 24 Apr 2022 22:56:31 +0200 Subject: [PATCH] Add PlayerInventorySlotChangeEvent -diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInventorySlotChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInventorySlotChangeEvent.java +diff --git a/src/main/java/io/papermc/paper/event/player/PlayerInventorySlotChangeEvent.java b/src/main/java/io/papermc/paper/event/player/PlayerInventorySlotChangeEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInventorySlotChangeEvent.java ++++ b/src/main/java/io/papermc/paper/event/player/PlayerInventorySlotChangeEvent.java @@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.event.player; ++package io.papermc.paper.event.player; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; @@ -70,7 +70,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * @return Whether the slot change advancements will be triggered. + */ -+ public boolean isTriggerAdvancements() { ++ public boolean shouldTriggerAdvancements() { + return triggerAdvancements; + } + @@ -79,7 +79,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * @param triggerAdvancements Whether the slot change advancements will be triggered. + */ -+ public void setTriggerAdvancements(boolean triggerAdvancements) { ++ public void setShouldTriggerAdvancements(boolean triggerAdvancements) { + this.triggerAdvancements = triggerAdvancements; + } + diff --git a/patches/server/Add-PlayerInventorySlotChangeEvent.patch b/patches/server/Add-PlayerInventorySlotChangeEvent.patch index 0934ea6eea..071e17c5d7 100644 --- a/patches/server/Add-PlayerInventorySlotChangeEvent.patch +++ b/patches/server/Add-PlayerInventorySlotChangeEvent.patch @@ -18,13 +18,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + Slot slot = handler.getSlot(slotId); + if (!(slot instanceof ResultSlot)) { + if (slot.container == ServerPlayer.this.getInventory()) { -+ if (com.destroystokyo.paper.event.player.PlayerInventorySlotChangeEvent.getHandlerList().getRegisteredListeners().length == 0) { ++ if (io.papermc.paper.event.player.PlayerInventorySlotChangeEvent.getHandlerList().getRegisteredListeners().length == 0) { + CriteriaTriggers.INVENTORY_CHANGED.trigger(ServerPlayer.this, ServerPlayer.this.getInventory(), stack); + return; + } -+ com.destroystokyo.paper.event.player.PlayerInventorySlotChangeEvent event = new com.destroystokyo.paper.event.player.PlayerInventorySlotChangeEvent(ServerPlayer.this.getBukkitEntity(), slotId, CraftItemStack.asBukkitCopy(oldStack), CraftItemStack.asBukkitCopy(stack)); ++ io.papermc.paper.event.player.PlayerInventorySlotChangeEvent event = new io.papermc.paper.event.player.PlayerInventorySlotChangeEvent(ServerPlayer.this.getBukkitEntity(), slotId, CraftItemStack.asBukkitCopy(oldStack), CraftItemStack.asBukkitCopy(stack)); + event.callEvent(); -+ if (event.isTriggerAdvancements()) { ++ if (event.shouldTriggerAdvancements()) { + CriteriaTriggers.INVENTORY_CHANGED.trigger(ServerPlayer.this, ServerPlayer.this.getInventory(), stack); + } + }