Repository navigation
Utils
Contains several methods for working with Material
getMaterialFromString(String) - Returns the material with the specified name or Material.AIR
remove(Inventory inventory, Material type, int n) - Removes n items of Material from inventory
count(Inventory inventory, Material type) - Count of items with type 'type' in inventory
Utils for parsing time from string
formatDurationTicks(long) - Time in ticks to string in format hours:minutes:seconds
ticksFromString, millisFromString, secondsFromString, minutesFromString, hoursFromString, daysFromString
All these functions convert a string to time.
Format of string
- none - ticks (one second = 20 ticks)
- s - seconds
- m - minutes
- h - hours
- d - days
For example: "20 1s 2h"
uuidByName(String) - Returns uuid of player by name
Simplified syntax for BukkitRunnable For example:
((RunnableX)() -> System.out.println("test")).runTask(plugin);translateHexColorCodes(String) - translates hex and legacy colors
Serializer of UUID for kotlinx.serialization
@Serializable
data class RentalRecord(
val tag: String,
@Serializable(with = UUIDSerializer::class)
val renter: UUID)