Skip to content

Example of economy plugins with helper survival core API

License

Notifications You must be signed in to change notification settings

NazarbekAld/SurvivalEconomy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SurvivalEconomy

Economy plugin with helper SurvivalCore API.
Please include sql libs for the SurvivalCore API.

As dependency.

    <repositories>

        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>

    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.github.NazarbekAld</groupId>
            <artifactId>SurvivalEconomy</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

API hook

You must include

depend:
  - "SurvivalCore"
  - "SurvivalEconomy"
# AND
loadbefore: 
  - "SurvivalCore"
  - "SurvivalEconomy"
 
/*
  NOTE: Required SurvivalCore
  May return null.
*/
EconomyAPI api = getServer().getServiceManager().getProvider(EconomyAPI.class).getProvider();

API example

public class EconomyRegistrations implements Listener {
EconomyAPI api; // Somehow get ins of EconomyAPI

/*
  Add 69$ for player breaking gold block (41).
*/
@EventHandler
    public void onBreak(@NotNull BlockBreakEvent e){
        if (e.getBlock().equalsBlock(Block.get(41))){
            api.add(e.getPlayer().getUniqueId(), 69)
        }
    }
}

About

Example of economy plugins with helper survival core API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages