This document explains how QuartzLib evolved from version to version, starting at 0.0.1 (the version after zLib 0.99), and how to migrate your code if there are breaking changes.
We follow semantic versioning: you can tell if a version contains breaking changes by looking at the evolution of the version number.
Changes marked with
Published on April 12th, 2021
- Fixed a bug where plural scripts were loaded once per translation instead of once per file.
- Optimised the plural script manager by adding many known scripts. This reduces the likelihood of having to start a JavaScript engine, improving performance by several orders of magnitude.
Published on April 11th, 2021
⚠️ All recipes are now required to provide names, therefore all helper methods to generate recipes take a mandatory name argument. The name is automatically namespaced with the plugin's name.⚠️ All helpers that were consuming the now-deprecatedMaterialData
now consume the more flexibleRecipeChoice
instead.- All helpers that generate shaped recipes (2x2, 2x2 diagonal, etc.) now return
ShapedRecipe
s explicitely, since there is no way those recipes can be anything other than shaped, and hiding this detail is not useful at all.
This tool was rewritten to register a namespaced enchantment, avoiding future incompatibilities with other plugins registering new enchants.
⚠️ The glow effect is now a QuartzLib component. You still use glow effect as usual (either usingGlowEffect
or through theItemStackBuilder
), but you have to load the effect usingloadComponents(GlowEffect.class)
in your plugin'sonEnable
.
This API was added when Bukkit had no support for dual wielding. As there is support now, we cleaned up all of this and removed some things. We kept some useful methods and moved things to other classes for coherence.
- Added
ItemUtils.consumeItemInOffHand
. ⚠️ MovedItemUtils.consumeItem
toItemUtils.consumeItemInMainHand
.⚠️ MovedItemUtils.damageItemInHand
toItemUtils.damageItem
.ItemUtils.damageItem
now returnstrue
if the damaged item was broken.⚠️ MovedItemUtils.breakItemInHand
methods toInventoryUtils.breakItemInHand
.⚠️ MovedDualWielding
toInventoryUtils.DualWielding
.⚠️ MovedDualWieldling
methods toInventoryUtils
.⚠️ RemovedDualWieldling.setItemInHand
andDualWieldling.getItemInHand
(use Bukkit API instead).
⚠️ This class is not an enchantment anymore and has been re-implemented. It is now aQuartzComponent
that needs to be enabled at startup in order to prevent items with a Glow effect to be used in a Grindstone.
Published on November 26th, 2020
-
We added a
withMeta()
method to alter theItemMeta
of the built item. Use it like this.final ItemStack skull = new ItemStackBuilder(Material.PLAYER_HEAD) .withMeta((SkullMeta s) -> s.setOwner("foo")) .item();
This method can be called multiple times, and if so, all callbacks will be executed. If the meta is not of the right type, the callback will be ignored without error. You can chain multiple
withMeta()
calls; only the ones matching the item type will be called. -
We added a
withFlags(ItemFlag...)
method to add the given item flags to the built item. As example, to hide enchantments and unbreakable state from an item, use it like this.final ItemStack item = new ItemStackBuilder(Material.QUARTZ) .withFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE) .item();
To hide all attributes from the item, use
hideAllAttributes()
.
-
We added a
asDye
method to convert aChatColor
to its closestDyeColor
equivalent. -
We added two
colorize
methods toItemUtils
to convert either a dye or a chat color to a colored block dynamically. As example,ItemUtils.colorize(ColorableMaterial.GLAZED_TERRACOTTA, DyeColor.LIME)
will return
Material.LIME_GLAZED_TERRACOTTA
.
- We now use MockBukkit to greatly increase our tests coverage.
- A sample QuartzLib plugin is now available in the repository. We also use it for tests. Check it out at
src/test/java/fr/zcraft/ztoaster
.
⚠️ We renamed theItemStackBuilder.hideAttributes()
toItemStackBuilder.hideAllAttributes()
for clarity.
⚠️ We removed the following methods fromGuiUtils
, as they were duplicates ofItemStackBuilder
ones, or using deprecated APIs. UseItemStackBuilder.hideAllAttributes()
instead.GuiUtils.hideItemAttributes(ItemMeta)
GuiUtils.hideItemAttributes(ItemStack)
⚠️ We removed theItemStackBuilder.dye(DyeColor)
andItemStackBuilder.head(String)
methods. The first one can be replaced by the right material, as in 1.13+ each dyed version has its own material. For the second one, use the newItemStackBuilder.withMeta()
method.⚠️ We removed theItemStackBuilder.data(short)
method, and all abilities to process Data Values since they are now removed from Minecraft and strongly deprecated from Bukkit. Damage for tools are now properly handled by bukkit using theDamageable
ItemMeta
API and can be used inItemStackBuilder
with the newwithMeta()
API.
⚠️ We removed the following methods fromItemUtils
, as they are now directly present in all supported Bukkit versions. You can also use their equivalent inItemStackBuilder
instead.hasItemFlag(ItemMeta, String)
removeItemFlags(ItemMeta, String...)
hideItemAttributes(ItemMeta)
hideItemAttributes(ItemStack)
Published on November 12th, 2020
https://maven.zcraft.fr/QuartzLib
. To do so, put his in your pom.xml
, instead of the old repository:
<repository>
<id>zdevelopers-quartzlib</id>
<url>https://maven.zcraft.fr/QuartzLib</url>
</repository>
Also, the artifact ID changed to reflect the new name. You should update the dependency like so:
<dependency>
<groupId>fr.zcraft</groupId>
<artifactId>quartzlib</artifactId>
<version>0.0.1</version>
</dependency>
Of course, feel free to update the version if new versions have been released when you read this.
Finally, as the package changed too, you should update your shading settings. Update the configuration
tag like this:
<artifactSet>
<includes>
<include>fr.zcraft:quartzlib</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>fr.zcraft.quartzlib</pattern>
<shadedPattern>YOUR.OWN.PACKAGE.quartzlib</shadedPattern>
</relocation>
</relocations>
…keeping other shading as is, if any.
- The base package
fr.zcraft.zlib
is nowfr.zcraft.quartzlib
. - The
ZLib
class is nowQuartzLib
. - The
ZLibComponent
class is nowQuartzComponent
. - The
ZPlugin
class is nowQuartzPlugin
.
Just rename these references—the interfaces have remained the same.
⚠️ RemovedAchievement
-related methods from the raw text component, as these are no longer supported in Minecraft 1.15+.