πŸ’»Developer API

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

In your gradle project

compileOnly files("libs/TopMinion.jar")

In your maven project

<dependencies>
    <dependency>
        <groupId>com.sarry20</groupId>
        <artifactId>TopMinion</artifactId>
        <version>VERSION</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/libs/TopMinion.jar</systemPath>
    </dependency>
</dependencies>

Events

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

Once you have your class, what you will have to do is to put it as the item provider for it you can do it with the following line:

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

String
explanation

identifier

it is not used for anything in the plugin, it is simply for you as a configurator to know which plugin it comes from or whatever you want to put.

item_id

this is the name by which the ItemProvider#getItem method will get the item you need for the enhancement.

amount

the amount needed to level up the minion.

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

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.

Once you have the classes created, when you want to add the upgrade, you must add the following line

Also for it to work you must register your two classes in the serializer

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

Examples

ItemProvider Implementation

Upgrade Implementation

FuelUpgrade.class

SmelterUpgrade.class

DataHolder Implementation

FuelData.class

SmelterData.class

Last updated