The downloadable zip file for this resource contains both a compiled version, in the form of a plugin, which can be run on servers, and whatever plugins you make can utilize the API by adding it to your build path.
Alternatively, there is also a .java file containing the API.
I made sure to make this as easy as possible to use, so it's all in one class. Simply copy paste the code contents to your project.
To use the API, all you have to do is:
This will output:Code (Java):TimeUnit.toString(69696969);
It's really that simple.Code (Text):115 weeks 1 day 16 hours 16 minutes 9 seconds
With this API you can...
You're not limited by time either.
- Convert the smallest unit of measurement into a dispersed readable representative string.
- Convert the string back into the smallest unit of measurement.
- Easily remove measurements, create/add your own.
Feel free to use this resource to convert/distribute anything.
Weight, size, length, money, etc.
Simply change the enumeration string values around you're good to go!
If that's too much work for you, that's fine too.
This API is still perfect for cooldowns, ban times, or simple off the fly conversions.
The plugin version of this resource contains the commands:
Run from the TimeUnit class, demonstrating how it works.
This API is free for use, and I intend to keep it updated constantly.
Though, donations are always welcome. I don't make much.
All suggestions/feedback appreciated.