For developers, here you will have a mini basic guide to some of the uses you have, it assumes some knowledge about java and plugins in general. Any doubt you can contact me in the discord
Implementation
First of all, to get as dependency, you will need in the root folder a folder called libs and the .jar should be there
You will now have access to our classes and you can start modifying things, first, let's go to the easiest thing of all, the events, you can listen to all these events:
MinionPlaceEvent
MinionBreakEvent
MinionUpgradeEvent
MinionAddMemberEvent
MinionTakeInventoryItemsEvent
ChestPlaceEvent
ChestBreakEvent
ChestTakeItemsEvent
ItemProvider
Another thing you can do is to set up your own item provider to do the upgrades, this is the interface you must implement for it
Now you will be able to use the item plugin that you have implemented, for this in the configuration of the items you must put: identifier#item_id#quantity
Upgrades
Also, you can create your own upgrades for the minions, for this you will need to create 2 classes, one that implements Upgrade and another that implements DataHolder. Let's see this in a little more detail
Upgrade
This is the Upgrade class that you must implement to create a new upgrade
packagecom.sarry20.topminion.upgrades;importcom.sarry20.topminion.models.minion.MinionObj;importcom.sarry20.topminion.upgrades.dataHandler.Datahandler;importorg.bukkit.configuration.serialization.ConfigurationSerializable;importorg.bukkit.inventory.ItemStack;publicinterfaceUpgradeextendsConfigurationSerializable { /** * @return the item that represent the upgrade * */ItemStackgetItem(); /** * @param objects the objects that should be used to get the data handler, can be null * these can be integers, strings, etc * used to create a data handler with the specific data, not with the default data * @return the data handler of the upgrade * */DatahandlergetDataHandler(Object... objects); /** * Called when tries to add the upgrade to the minion * @param minionObj the minion that the upgrade is being added * @return true if the upgrade should be added * */booleanonAdd(MinionObj minionObj); /** * Called every time the minion work * @param minionObj the minion that is working * @return (only used when upgrade is a fuel) the time to the next tick * */intonTick(MinionObj minionObj); /** * Called when the player give the item to the minion * @param item the item that the minion is going to add to the inventory * this item can be modified * @param minionObj the minion that is going to receive the item * @return the item that should be given to the minion * */ItemStackonGiveItemToMinion(MinionObj minionObj,ItemStack item); /** * Called when the player click on the item * @param shiftClick true if the player is shift clicking * @param minionObj the minion that the upgrade is being clicked * @return true if the upgrade should be removed * */booleanonClick(boolean shiftClick,MinionObj minionObj); /** * @return true if should be on fuel slot * */booleanisFuel(); /** * @return the remaining uses of the upgrade * */intgetRemainingUses();}
NOTE about getDataHolder: for the upgrades that are done I am using the parameter, for when the upgrade with LIMITED uses is removed, to store the remaining uses in the item
DataHolder
This is the DataHolder class that you must implement for the minion to store the necessary information, it is quite basic, if you need more methods for your implementation do not hesitate to enter discord to suggest what methods you need.
packagecom.sarry20.topminion.upgrades.dataHandler;importorg.bukkit.configuration.serialization.ConfigurationSerializable;publicinterfaceDatahandlerextendsConfigurationSerializable { /** * @return the remaining uses of the upgrade * */intgetRemainingUses(); /** * remove much actions as you want * @param actions the actions to remove * */voidtakeActions(int actions);}
Once you have the classes created, when you want to add the upgrade, you must add the following line
These are the functions that we have contemplated to do, any other function is not tested and you will do it under your responsibility (these functions here explained, also will be done under your responsibility, but these are explained), you can always ask for help in discord or ask to add a function to the api