-
-
Notifications
You must be signed in to change notification settings - Fork 69
API
Want to hook into my plugin? Here's a basic overview on the API. This is useful if you want to make a addon or an extend the features of my plugin. More API to come!
JavaDoc available here
####User object:
- I use a user object to handle most things with a user, there is a Data class that actually handles the file reading/editing
- Creating object:
new User(playerName);
new User(new UUID(uuid)); // uuid as string
new User(player); // player = Player object
- Using Examples:
- Get total votes:
user.getTotalVotes();
- Get user points:
user.getPoints();
- Set user points:
user.setPoints(int);
- Get total votes:
####VoteSite object:
- Similary, I use a votesite object to handle stuff with votesites
- The class ConfigVoteSites that handles the file reading/editing
- Create object:
new VoteSite(siteName);
plugin.getVoteSite(name);
- Using object:
- Give vote site rewards:
voteSite.giveRewards(user); // user is user object
- Give vote site rewards:
####Adding commands into /v or /av
-
With my command system, you can add your own custom commands in /vote or /adminvote, with tab complete support
-
Define what arguments to add ("(player)","(sitename)","(string)","(number)","(reward)","(list)","(boolean)" are ones the plugin will add tab support and for example, check if argument is a number)
-
Also use & to define multiple possible args (E.g. "Help&?")
-
Examples (plugin is my Main plugin class, either add a CommandHandler to voteCommand or adminVoteCommand):
plugin.voteCommand.add(new CommandHandler(new String[] { "Next", "(player)" }, "Permission", "Help message for /v help or /av help") { @Override public void execute(CommandSender sender, String[] args) { // code to run when command is executed, if player has perms and // args like number is met, plugin will check if it should be a number and check if args match // no need to add it here } });
-
See my CommandLoader class for more examples
####PlayerVoteEvent:
- When a player votes, it will trigger a PlayerVoteEvent
- You can use this to cancel a vote, or whatever you want to do with it
####PlayerRewardEvent:
- When a player is given a reward, it will trigger a PlayerRewardEvent
- You can use this to cancel a reward, or whatever you want to do with it
Setup/Configuration:
BungeeCord/Velocity Setups:
-
Proxy Setups
- PLUGINMESSAGING (Best method)
- REDIS (Second best)
- SOCKETS
- MYSQL
- Global Data Handling
- Multi-Proxy Setups
Knowledge base:
- Commands & Permissions
- Special Rewards
- File Layout
- API
- Converting data storage
- Vote Reminding
- Time Changes
- Minecraft Server Lists
- Performance Settings
- Bedrock Player Support
- Debug
- Minecraft Server Lists
- PlaceHolderAPI Expansion
- Signs
- Online/Offline Mode
- WIP MonthDateTotals
Troubleshooting
Rewards:
More setups: