Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Latest commit

 

History

History
42 lines (33 loc) · 948 Bytes

README.md

File metadata and controls

42 lines (33 loc) · 948 Bytes

PixliesAPI - hook into Pixlies with your plugin

Basic usage

Implementation

public class myPlugin extends JavaPlugin {
    
    private PixliesAPI api;

    @Override
    public void onEnable() {
        api = new PixliesAPI("mongodb://mongodb0.example.com:27017", this, "database", "users", "nations");
    }
    
    public PixliesAPI getApi() {
        return api;
    }

}

get profile

public class myPlugin extends JavaPlugin implements Listener {
    
    private PixliesAPI api;

    @Override
    public void onEnable() {
        api = new PixliesAPI("mongodb://mongodb0.example.com:27017", this, "database", "users", "nations");
    }
    
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Profile profile = api.getProfile(event.getPlayer().getUUID());
        profile.depositMoney(2000, "Free money from server");
    }
    
    public PixliesAPI getApi() {
        return api;
    }

}