-
Notifications
You must be signed in to change notification settings - Fork 13
Economy API
Ben edited this page Feb 18, 2025
·
3 revisions
GTS has an interface that is used for transactions. You need to implement this and it's functions using your chosen economy mod:
package org.pokesplash.gts.api.economy;
import java.util.UUID;
/**
* Interface used for GTS to interact with an economy mod.
*/
public interface GtsEconomy {
boolean add(UUID player, double amount);
boolean remove(UUID player, double amount);
double balance(UUID player);
}Now that you have implemented the interface with the transactions. You have to tell GTS to use the class. To do this, you add it to the GtsEconomyProvider class:
import org.pokesplash.gts.api.economy.GtsEconomyProvider;
GtsEconomyProvider.putEconomy(Priority.HIGH, new MyEconomyBridge());The above code should likely be in the mod initializer method somewhere. If you're running fabric, you might need to run this code after both GTS and the other economy mod have loaded with a lifecycle event.
You can find an example of an economy bridge here.