DecentSoftware-eu / DecentHolograms

A lightweight but powerful hologram plugin with many features and configuration options.
https://www.spigotmc.org/resources/96927/
GNU General Public License v3.0
211 stars 101 forks source link

Fix `HologramItem.fromItemStack(ItemStack)` not including custom model data. #237

Closed Andre601 closed 3 months ago

Andre601 commented 3 months ago

Changes the fromItemStack(ItemStack) method to now check for CustomModelData or minecraft:custom_model_data in an item's tag or components compount respectively, depending on the version.

This fixes an issue where custom model data is no longer applied to the final String for the HologramItem when used on 1.20.5+, as DH looks for CustomModelData.

In addition was the NBTItem replaced with ReadAndWriteNBT due to the former being deprecated, while also making sure to check in the Item's tag or components part respectively.

A test jar shared on Discord shows to fix the issue.