Refactored: All Config methods have had their first letter lowercased, and the old marked as deprecated.
I'll slowly start converting other classes to the same formatting.
Config.GetString() -> Config.getString()
Added: valorless.valorlessutils.logging.Log to replace valorless.valorlessutils.ValorlessUtils.Log
ValorlessUtils.Log has been marked deprecated and MarkedForRemoval
Added: PlayerCache and SkinCache.
-
PlayerCache: Get player UUID or OfflinePlayer by their username.
-
SkinCache: Get player skins by their username. Can be used to populate player heads without having to call Mojang's api, as setting too many heads returns HTTP 429.
Added: Server methods.
- boolean <- Server.isServerLikelyLoaded()
Determines if the server has been fully loaded, hinting that the plugin was most likely enabled after startup rather than on initial server start.
- boolean <- Server.serverHasBeenUpLongerThan(long)
Checks if the server JVM has been running longer than the specified milliseconds.
Added: valorless.valorlessutils.logging.Log now supports colors in the console.
Updated: NBTAPI to v2.15.7.
Fixed: An issue where configs that hadn't been created are marked as "not found" before being created.
This was due to a change for the config backup function.
Refactored: Large refactor/expansion of config wrapper (Config): new constructors (File/Path/String), many typed getters/setters, validation improvements, comment support, and Add/Set helpers for vectors, materials, lists and ItemStacks.
Added: Annotations.
Added: SFX now accepts namespaced keys alongside the Sound enum entries.
Added: Config.GetConfigurationSection() now fallbacks to Config.GetSection() in cases of null.
Changed: Updated NBTAPI to 2.15.5 (was 2.15.3).
Changed: SFX now correctly plays sounds on newer versions.
Changed: SetStringList & GetStringList now specifically sets/gets strings, and no longer causes infinity loops with number entries like "3e77247".
Changed: Renamed Vector to VectorModel.
Changed: HavenBagsPlacementBlocker now also checks for PDC alongside NBT.
Changed: When attempting to load a config and the file is not found, an error is now shown in the console.
Fixed: Debug messages now correctly appear, after it's been enabled in a plugin's config file.
Used to require a restart.
Removed: Deprecated methods from ValorlessUtils.java.
Added: tags.Tags now also has Get/Set/Has for PersistentDataContainer alongside ItemStack, the way the original ValorlessUtils.Tags has.
Added: Boolean - Server.VersionHigherOrEqualTo(Version version).
Returns true is the server's version is the higher or the same as the value given.
Added: Boolean - Server.VersionEqualTo(Version version).
Returns true is the server's version is the same as the value given.
Changed: config.GetFloat() has been marked as deprecated, and replaced with config.GetDouble().
This was a mixup I made early on, before I knew the difference between the two.
Changed: Config backups are now saved as .txt instead of .yml, for plugins where all .yml files in a folder is loaded.
The Translator function no longer contains language files needed to translate,
but will instead download the desired language from github, for the specific version of the server.
This not only lowers the overall ValorlessUtils file size, but also provides language files
specifically for the server's version, instead of universal file.
Once the desired language has been downloaded, it's stored in ValorlessUtils' plugin data folder for later use.
In case the download fails, a fallback en_us language file is used.
--- Other Stuff ---
Added: ValorlessUtils.GetServerVersionString(), returns the server's version as a string. (e.g. "1_21_4")
Fixed: ValorlessUtils.GetServerVersion() now correctly returns the server version.
Added: Failsafe for HavenBags.
Should HavenBags for what ever reason be disabled or removed.
This failsafe will prevent bags from being placed, so long as a valid HavenBags config file is found.
Fixed: Language files are now replaced when loaded, so old files don't remain and cause errors.
Changed: The api version of the plugin has been changed 1.21-R0.1 instead of 1.19.4-R0.1.
Changed: Tags has yet again been marked as Deprecated, but a new class was added in its place under
valorless.valorlessutils.tags.Tags.
Added: ItemUtils - Utility class to get certain ItemMeta values on versions < 1.20.5.
Remember that the server still has to run 1.20.5+ in order to use these utils, but the plugin calling them does not.
Added: If a config file is found invalid, the file will now be backed up before getting reset!
Code (Text):
[02:22:15 ERROR]: [ValorlessUtils] Invalid plugins\HavenArena\config.yml detected. Creating a backup and resetting to default.
[02:22:15 ERROR]: [ValorlessUtils] org.bukkit.configuration.InvalidConfigurationException: while scanning a quoted scalar
in 'reader', line 59, column 12:
formula: '(%wave% + 1.5) * %players%''
^
found unexpected end of stream
in 'reader', line 92, column 1:
Changed: Config validation will no longer spam with
"Config value 'XXXX' is missing, fixing.", and will instead say
"New or missing config values have been added." when done.
Changed: Config validation will no longer say
"Validating Config", and will instead say
"Validating %file%".
%file% being like config.yml or lang.yml.
Added:
NBT.SetStringList(ItemStack item, String key, List<String> value) &
NBT.GetStringList(ItemStack item, String key) The string list is saved as a single string on the item. The symbol '◊'
is used to section the different strings from each other.
Added package '
valorless.valorlessutils.text'
Added '
TextFeatures' in the package, with the following functions:
CreateBar(double progress, double total, int barLength); "Creates a progress bar with specified parameters." A duplicate function with additional parameters exists.
LimitCharacters(String text, int length); "Limits the characters in a text to a specified length."
LimitDecimal(String text, int length); "Limits the decimal places in a number to a specified length."
You can now use ValorlessUtils to create custom vanilla-like crafting recipes.
A more advanced system may be created in the future. Click here to read more about it.
!! This update only provides additional functions to the plugin, and not optimizations. !! Unless your plugin uses these functions, there is no reason to update to 1.5.1 Additonal information regarding new features, can be found on
GitHub.
Added functions:
Utils.Clamp()
Utils.Clamp01()
Utils.Bool.FromValue()
Utils.Bool.ToValue()
Added variable types:
Vector2
Vector3
ValorlessUtils 1.5.1 still works with plugins using 1.5.0.
Fixed an issue with the config validation system causing it to work incorrectly, or not at all.
Compatible with plugins using ValorlessUtils v1.1.0.96 or newer.