Class EconomyEvent.PreTransaction
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.economy.EconomyEvent
com.pixelmonmod.pixelmon.api.economy.EconomyEvent.PreTransaction
- Enclosing class:
- EconomyEvent
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
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
ConstructorDescriptionPreTransaction
(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 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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
-