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 one day
-
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 12 November, 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+.