-
Notifications
You must be signed in to change notification settings - Fork 11
IStatFormatter
youyihj edited this page Nov 22, 2022
·
2 revisions
An IStatFormatter describes how to display stat amount to Statistics menu.
You'd better import the package to avoid errors and write script easier.
Class Name: mods.zenutils.IStatFormatter
The IStatFormatter is a function interface. It has an int parameter and requires a string return value for display text.
These below are pre-registered IStatFormatters by zenutils. You can call these method to get them. For example: IStatFormatter.time().
- simple: display an integer with digit group separators. This is the default behavior.
- time: display as time format
- distance: display as length units
- divideByTen: divides the value by ten and displays then
The following methods can be used in custom formatter.
Formats an integer with digit group separators. Returns a string
IStatFormatter.numberFormat(int amount);
Formats a decimal with 2 decimal digits.
IStatFormatter.decimalFormat(double amount);
- GlobalFunctions
- ScriptReloading
- SuppressErrorPreprocessor
- HardFailPreprocessor
- OrderlyMap
- IData Deep Update
- Template String
- Nullish Operators
- Array and List Operations
- Native Method Access
- Mixin
- CrTI18n
- CrTUUID
- CrTItemHandler
- CrTLiquidHandler
- ILiquidTankProperties
- StringList
- HexHelper
- StaticString
- Catenation
- PersistedCatenation
- PlayerStat
- IStatFormatter
- GameRuleHelper
- ZenCommand
- ZenCommandTree
- ZenUtilsCommandSender
- IGetCommandUsage
- ICommandExecute
- IGetTabCompletion
- CommandUtils