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-deprecatedMaterialDatanow consume the more flexibleRecipeChoiceinstead.- All helpers that generate shaped recipes (2x2, 2x2 diagonal, etc.) now return
ShapedRecipes 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 usingGlowEffector 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.consumeItemtoItemUtils.consumeItemInMainHand.⚠️ MovedItemUtils.damageItemInHandtoItemUtils.damageItem.ItemUtils.damageItemnow returnstrueif the damaged item was broken.⚠️ MovedItemUtils.breakItemInHandmethods toInventoryUtils.breakItemInHand.⚠️ MovedDualWieldingtoInventoryUtils.DualWielding.⚠️ MovedDualWieldlingmethods toInventoryUtils.⚠️ RemovedDualWieldling.setItemInHandandDualWieldling.getItemInHand(use Bukkit API instead).
⚠️ This class is not an enchantment anymore and has been re-implemented. It is now aQuartzComponentthat 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 theItemMetaof 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
asDyemethod to convert aChatColorto its closestDyeColorequivalent. -
We added two
colorizemethods toItemUtilsto 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 ofItemStackBuilderones, 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 theDamageableItemMetaAPI and can be used inItemStackBuilderwith 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 inItemStackBuilderinstead.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.zlibis nowfr.zcraft.quartzlib. - The
ZLibclass is nowQuartzLib. - The
ZLibComponentclass is nowQuartzComponent. - The
ZPluginclass 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+.