mirror of
https://github.com/KAMKEEL/CustomNPC-Plus-API.git
synced 2026-11-16 15:24:47 +00:00
Add CNPC+ Api
This commit is contained in:
1 parent
0c4db676e4
commit
95e2f9df01
109 files changed
+7308
No files matched your search
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// Source code recreated from a .class file by IntelliJ IDEA
|
||||
// (powered by Fernflower decompiler)
|
||||
//
|
||||
|
||||
package noppes.npcs.api;
|
||||
|
||||
public interface ITimers {
|
||||
/**
|
||||
* Adds a timer to the NPC or player with the given attributes. If this function is used and there is already a
|
||||
* timer with the given ID, an exception will be thrown.
|
||||
*
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
|
||||
*/
|
||||
void start(int id, int ticks, boolean repeat);
|
||||
|
||||
/**
|
||||
* Adds a timer to the NPC or player with the given attributes. No exception will be thrown if there is already a
|
||||
* timer with the given ID when using this function.
|
||||
*
|
||||
* @param id The id of the timer.
|
||||
* @param ticks The amount of ticks before the timer ends.
|
||||
* @param repeat Whether this timer repeats when it reaches its maximum amount of ticks.
|
||||
*/
|
||||
void forceStart(int id, int ticks, boolean repeat);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return True if the set of timers contains a timer with the given id, false otherwise.
|
||||
*/
|
||||
boolean has(int id);
|
||||
|
||||
/**
|
||||
* Stops the timer with the given id
|
||||
*
|
||||
* @return True if there was a timer with the given id.
|
||||
*/
|
||||
boolean stop(int id);
|
||||
|
||||
/**
|
||||
* Resets the ticks elapsed in the timer with the given id to 0.
|
||||
*/
|
||||
void reset(int id);
|
||||
|
||||
/**
|
||||
* Removes all timers.
|
||||
*/
|
||||
void clear();
|
||||
|
||||
/**
|
||||
* @return The amount of ticks elapsed in the timer.
|
||||
*/
|
||||
int ticks(int id);
|
||||
|
||||
/**
|
||||
* Sets the amount of ticks elapsed in the timer with the given id to a different value.
|
||||
*
|
||||
* @param ticks The new ticks elapsed by the timer.
|
||||
*/
|
||||
void setTicks(int id, int ticks);
|
||||
|
||||
/**
|
||||
* @return The maximum amount of ticks the timer with the given id runs for before it stops.
|
||||
*/
|
||||
int maxTicks(int id);
|
||||
|
||||
/**
|
||||
* Sets the maximum amount of ticks the timer with the given id can run for before it stops.
|
||||
*/
|
||||
void setMaxTicks(int id, int maxTicks);
|
||||
|
||||
/**
|
||||
* @return True if the timer with the given id repeats, false otherwise.
|
||||
*/
|
||||
boolean repeats(int id);
|
||||
|
||||
/**
|
||||
* Sets whether the timer with the given id repeats or not.
|
||||
*/
|
||||
void setRepeats(int id, boolean repeat);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return The amount of timers in the set of timers.
|
||||
*/
|
||||
int size();
|
||||
}
|
||||
Reference in new issue
Block a user