API
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
This is a short tutorial on how to use the API.
Adding the API to your project
Section titled “Adding the API to your project”The API file is published via JitPack. You can go to
the JitPack page to get more information about adding the API to your
specific toolchain.
For example, if you are using Maven, add the following to your pom.xml:
<repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository></repositories>
<dependencies> <dependency> <groupId>com.github.Topper-MC</groupId> <artifactId>TimedTopperAPI</artifactId> <version>VERSION</version> </dependency></dependencies>Replace VERSION with the latest version of the API. The latest version
is
Remember to add TimedTopper as a depend or softdepend in your plugin.yml.
Get the API instance
Section titled “Get the API instance”The main class of the API is TimedTopperAPI. You can get an instance of it using the following code:
TimedTopperAPI api = TimedTopperAPI.getInstance();Use the API
Section titled “Use the API”The JavaDoc provides detailed information about the API. You can go to the JavaDoc to learn more about the API.
Here are some examples of how to use the API:
Player player;
// Get the available holdersCollection<String> names = api.getHolders();
// Get all data in the holder "money"Map<UUID, TimedData> map = api.getData("money");
// Get the data of a player in the holder "money"Optional<TimedData> data = api.getData("money", player.getUniqueId());