-
Notifications
You must be signed in to change notification settings - Fork 24
Custom Economy Storage
Yap Zhen Yie edited this page Nov 1, 2020
·
7 revisions
- First, you need to open
plugin.yml
file in your plugin and adddepend
orsoftdepend
entry so the server knows that your plugin depends on GadgetsMenu.
name: CustomEconomy
main: com.yapzhenyie.customeconomy.CustomEconomyMain
version: 1.0.0
author: yapzhenyie
softdepend: [GadgetsMenu]
- Then, create a new class which extends GEconomyProvider.
- Create a constructor and add unimplemented methods.
import com.yapzhenyie.GadgetsMenu.economy.GEconomyProvider;
import com.yapzhenyie.GadgetsMenu.economy.GStorage;
import com.yapzhenyie.GadgetsMenu.player.OfflinePlayerManager;
public class Economy_CustomEconomy extends GEconomyProvider {
public Economy_CustomEconomy(CustomEconomyMain yourPlugin) {
//Plugin plugin, your storage name
super(yourPlugin, "Custom-Storage");
}
@Override
public int getMysteryDust(OfflinePlayerManager pManager) {
return 0;
}
@Override
public boolean addMysteryDust(OfflinePlayerManager pManager, int amount) {
// Add your code here.
return true; // Return true when the transaction is successful, otherwise return false.
}
@Override
public boolean setMysteryDust(OfflinePlayerManager pManager, int amount) {
// Add your code here.
return true; // Return true when the transaction is successful, otherwise return false.
}
@Override
public boolean removeMysteryDust(OfflinePlayerManager pManager, int amount) {
// Add your code here.
return true; // Return true when the transaction is successful, otherwise return false.
}
}
- Lastly, set mystery dust storage if GadgetsMenu is found.
import com.yapzhenyie.GadgetsMenu.economy.GEconomyProvider;
public class CustomEconomyMain extends JavaPlugin {
@Override
public void onEnable() {
if(Bukkit.getPluginManager().isPluginEnabled("GadgetsMenu")) {
// Set Mystery Dust Storage.
GEconomyProvider.setMysteryDustStorage(new Economy_CustomEconomy(this));
}
}
}
Getting Started
Features
- Cosmetic Item Purchase
- Item Cost Discount
- Mystery Boxes
- Custom Mystery Boxes Loot
- Pets
- Morphs
- Data Migration (From SQLite to MySQL)
Custom Cosmetic Items
- Custom Hats
- Custom Animated Hats
- Custom Particles
- Custom Banners
- Custom Emotes
- Custom Miniatures (New)
Developers
Misc
Discord