-
Notifications
You must be signed in to change notification settings - Fork 53
mod_api
- This content is for mod developers.
ParCool provides API for adding support of ParCool.
First import ParCool into your project in some way.
Normally I recommend to use Curse Maven.
Add these sentences to your gradle buildscripts.
repositories {
maven {
url "https://cursemaven.com"
}
}dependencies {
implementation fg.deobf("curse.maven:parcool-482378:${fileid /*Edit here*/}")
}import com.alrex.parcool.api.Stamina;
/*-------In your code-------*/
Stamina instance = Stamina.get(player);Stamina.get(Player) returns @Nullable Stamina, so don't forget null-check.
This method returns null when initialization is not done yet.
It returns current value.
This method returns accurate value when called for a local player on Client side, but if called for other players in multi-player game or on server side, whether the value is accurate is not guaranteed because of its synchronization system.
It returns max value of stamina.
It returns whether the stamina is in exhausted state.
It sets current value.
This method can be called only for a local player on client side
It consumes stamina by passed value.
This method can be called only for a local player on client side
It recovers stamina by passed value.
This method can be called only for a local player on client side
There is a dedicated page. Please read it.
In addition to these, several other classes marked as APIs.
Please check package com.alrex.parcool.api.*