mirror of
https://github.com/Flowsqy/ShopChest.git
synced 2024-12-03 02:13:22 +01:00
Process the ShopBuySellEvent when executing a transaction
This commit is contained in:
parent
ffbfe4928a
commit
b6c0bc9b5f
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user