Process the ShopBuySellEvent when executing a transaction

This commit is contained in:
Flowsqy 2022-12-21 22:26:27 +01:00
parent ffbfe4928a
commit b6c0bc9b5f

View File

@ -1,5 +1,6 @@
package de.epiceric.shopchest.transaction;
import de.epiceric.shopchest.event.ShopBuySellEvent;
import de.epiceric.shopchest.language.LanguageUtils;
import de.epiceric.shopchest.language.Message;
import org.bukkit.inventory.ItemStack;
@ -20,6 +21,9 @@ public class Transaction {
}
// Call buy or sell event
if (processEvent()) {
return;
}
transferItems();
@ -68,6 +72,20 @@ public class Transaction {
return true;
}
/**
* Call {@link ShopBuySellEvent}
*
* @return {@code true} if the event is cancelled. {@code false} otherwise.
*/
private boolean processEvent() {
/*
final ShopBuySellEvent transactionEvent = new ShopBuySellEvent();
Bukkit.getPluginManager().callEvent(transactionEvent);
return transactionEvent.isCancelled();
*/
return true;
}
private void transferItems() {
// Remove items from seller inventory