Class EconomyEvent.PreTransaction
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.economy.EconomyEvent
com.pixelmonmod.pixelmon.api.economy.EconomyEvent.PreTransaction
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
EconomyEvent
public static class EconomyEvent.PreTransaction
extends EconomyEvent
implements net.neoforged.bus.api.ICancellableEvent
Event fired just before a transaction is applied to the
BankAccount
If cancelled the transaction will not take place-
Nested Class Summary
Nested classes/interfaces inherited from class com.pixelmonmod.pixelmon.api.economy.EconomyEvent
EconomyEvent.GetBalance, EconomyEvent.PostTransaction, EconomyEvent.PreTransaction, EconomyEvent.SetBalance, EconomyEvent.TransactionType
-
Constructor Summary
ConstructorsConstructorDescriptionPreTransaction
(net.minecraft.server.level.ServerPlayer player, BankAccount bankAccount, EconomyEvent.TransactionType type, BigDecimal balance, BigDecimal change) -
Method Summary
Modifier and TypeMethodDescriptionGets the balance before the transactionGets the amount the balance will change by after the transactiongetType()
Gets the type of transaction that will take placevoid
setChange
(BigDecimal change) Sets the amount the balance will change byMethods inherited from class com.pixelmonmod.pixelmon.api.economy.EconomyEvent
getAccount, getPlayer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Constructor Details
-
PreTransaction
public PreTransaction(net.minecraft.server.level.ServerPlayer player, BankAccount bankAccount, EconomyEvent.TransactionType type, BigDecimal balance, BigDecimal change)
-
-
Method Details
-
getType
Gets the type of transaction that will take place- Returns:
- The type of transaction
-
getBalance
Gets the balance before the transaction- Returns:
- The balance before
-
getChange
Gets the amount the balance will change by after the transaction- Returns:
- The change amount
-
setChange
Sets the amount the balance will change by- Parameters:
change
- The new change amount
-