// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java
// @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT")
// public class LapisCommonsPlugin {
//     private static LapisCommonsPlugin instance;
// 
//     private final Game game;
//     private final PluginContainer container;
// 
//     @Inject
//     protected Logger logger;
// 
//     @Inject
//     public LapisCommonsPlugin(Game game, PluginContainer container) {
//         this.game = game;
//         this.container = container;
//     }
// 
//     /**
//      * Gets the instance of the LapisCommons plugin.
//      *
//      * @return The currently loaded plugin instance or null if the plugin is not loaded.
//      */
//     public static LapisCommonsPlugin getInstance() {
//         return instance;
//     }
// 
//     /**
//      * Gets the instance the {@link Game} instance of the current server implementation.
//      *
//      * @return The game instance of the server implementation or null if the plugin is not loaded.
//      */
//     public static Game getGame() {
//         return getInstance().game;
//     }
// 
//     /**
//      * Gets the plugin logger of the LapisCommons plugin.
//      *
//      * @return The plugin logger for this plugin or null if the plugin is not loaded
//      */
//     public static Logger getLogger() {
//         return getInstance().logger;
//     }
// 
//     @Subscribe
//     public void initialize(PreInitializationEvent event) {
//         instance = this;
//     }
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/TransactionEvent.java
// public interface TransactionEvent extends EconomyEvent, Cancellable {
// 
//     Transaction getTransaction();
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/TransactionException.java
// public class TransactionException extends Exception {
// 
//     private final Transaction transaction;
// 
//     public TransactionException(final Transaction t) {
//         this.transaction = t;
//     }
// 
//     public TransactionException(final String message, final Transaction t) {
//         super(message);
//         this.transaction = t;
//     }
// 
//     public Transaction getTransaction() {
//         return transaction;
//     }
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/impl/TransactionEventImpl.java
// public class TransactionEventImpl extends EconomyEventImpl implements TransactionEvent {
//     private final Transaction transaction;
//     private boolean cancelled = false;
// 
//     public TransactionEventImpl(Transaction transaction) {
//         super(Preconditions.checkNotNull(transaction, "transaction").getAccount());
//         this.transaction = transaction;
//     }
// 
//     @Override
//     public Transaction getTransaction() {
//         return transaction;
//     }
// 
//     @Override
//     public void setCancelled(boolean cancelled) {
//         this.cancelled = cancelled;
//     }
// 
//     @Override
//     public boolean isCancelled() {
//         return cancelled;
//     }
// }


import javax.annotation.Nullable;
import blue.lapis.common.LapisCommonsPlugin;
import blue.lapis.common.economy.event.TransactionEvent;
import blue.lapis.common.economy.event.TransactionException;
import blue.lapis.common.economy.event.impl.TransactionEventImpl;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
     * @param amount The amount to reduce the account balance by
     * @return This object for further modification
     */
    public Transaction subtract(double amount) {
        delta -= amount;
        return this;
    }

    /**
     * Express a constant balance that the account should be changed to
     *
     * @param amount The amount that the new account balance should be
     * @return This object for further modification
     */
    public Transaction setAbsolute(double amount) {
        balance = amount;
        return this;
    }

    /**
     * Causes a TransactionEvent to be fired for this Transaction, and if the event is not cancelled, hands
     * this Transaction to the EconomyAccount for final processing. This final processing may complete
     * asynchronously, and may fail, so it's important to register a FutureCallback to handle the result of the
     * transaction.
     *
     * @param onResult A callback for when the transaction is complete
     */
    public void commit(FutureCallback<Transaction> onResult) {
        validateState(Status.INCOMPLETE);
        status = Status.IN_TRANSIT;
// Path: src/main/java/blue/lapis/common/LapisCommonsPlugin.java
// @Plugin(id = "lapis-commons", name = "LapisCommons", version = "1.0.0-SNAPSHOT")
// public class LapisCommonsPlugin {
//     private static LapisCommonsPlugin instance;
// 
//     private final Game game;
//     private final PluginContainer container;
// 
//     @Inject
//     protected Logger logger;
// 
//     @Inject
//     public LapisCommonsPlugin(Game game, PluginContainer container) {
//         this.game = game;
//         this.container = container;
//     }
// 
//     /**
//      * Gets the instance of the LapisCommons plugin.
//      *
//      * @return The currently loaded plugin instance or null if the plugin is not loaded.
//      */
//     public static LapisCommonsPlugin getInstance() {
//         return instance;
//     }
// 
//     /**
//      * Gets the instance the {@link Game} instance of the current server implementation.
//      *
//      * @return The game instance of the server implementation or null if the plugin is not loaded.
//      */
//     public static Game getGame() {
//         return getInstance().game;
//     }
// 
//     /**
//      * Gets the plugin logger of the LapisCommons plugin.
//      *
//      * @return The plugin logger for this plugin or null if the plugin is not loaded
//      */
//     public static Logger getLogger() {
//         return getInstance().logger;
//     }
// 
//     @Subscribe
//     public void initialize(PreInitializationEvent event) {
//         instance = this;
//     }
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/TransactionEvent.java
// public interface TransactionEvent extends EconomyEvent, Cancellable {
// 
//     Transaction getTransaction();
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/TransactionException.java
// public class TransactionException extends Exception {
// 
//     private final Transaction transaction;
// 
//     public TransactionException(final Transaction t) {
//         this.transaction = t;
//     }
// 
//     public TransactionException(final String message, final Transaction t) {
//         super(message);
//         this.transaction = t;
//     }
// 
//     public Transaction getTransaction() {
//         return transaction;
//     }
// }
// 
// Path: src/main/java/blue/lapis/common/economy/event/impl/TransactionEventImpl.java
// public class TransactionEventImpl extends EconomyEventImpl implements TransactionEvent {
//     private final Transaction transaction;
//     private boolean cancelled = false;
// 
//     public TransactionEventImpl(Transaction transaction) {
//         super(Preconditions.checkNotNull(transaction, "transaction").getAccount());
//         this.transaction = transaction;
//     }
// 
//     @Override
//     public Transaction getTransaction() {
//         return transaction;
//     }
// 
//     @Override
//     public void setCancelled(boolean cancelled) {
//         this.cancelled = cancelled;
//     }
// 
//     @Override
//     public boolean isCancelled() {
//         return cancelled;
//     }
// }


// Path: src/main/java/blue/lapis/common/economy/Transaction.java
import javax.annotation.Nullable;
import blue.lapis.common.LapisCommonsPlugin;
import blue.lapis.common.economy.event.TransactionEvent;
import blue.lapis.common.economy.event.TransactionException;
import blue.lapis.common.economy.event.impl.TransactionEventImpl;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;

     * @param amount The amount to reduce the account balance by
     * @return This object for further modification
     */
    public Transaction subtract(double amount) {
        delta -= amount;
        return this;
    }

    /**
     * Express a constant balance that the account should be changed to
     *
     * @param amount The amount that the new account balance should be
     * @return This object for further modification
     */
    public Transaction setAbsolute(double amount) {
        balance = amount;
        return this;
    }

    /**
     * Causes a TransactionEvent to be fired for this Transaction, and if the event is not cancelled, hands
     * this Transaction to the EconomyAccount for final processing. This final processing may complete
     * asynchronously, and may fail, so it's important to register a FutureCallback to handle the result of the
     * transaction.
     *
     * @param onResult A callback for when the transaction is complete
     */
    public void commit(FutureCallback<Transaction> onResult) {
        validateState(Status.INCOMPLETE);
        status = Status.IN_TRANSIT;
        TransactionEvent event = new TransactionEventImpl(this);