Skip to content

Instantly share code, notes, and snippets.

@DaRacci
Created December 6, 2021 14:48
Show Gist options
  • Save DaRacci/508642cb1c9a98f443c4e94f66f42371 to your computer and use it in GitHub Desktop.
Save DaRacci/508642cb1c9a98f443c4e94f66f42371 to your computer and use it in GitHub Desktop.
private fun yes() {
ItemFactoryImpl.hollowsEve2021Items.forEach {it->
ItemFactoryImpl.data.items.computeIfAbsent(it.key.name) {_ ->
val i = it.value
var skullData: SkullData? = null
if(i.type == Material.PLAYER_HEAD) {
i.meta<SkullMeta> {
skullData = SkullData(
owner = playerProfile!!.id!!,
texture = playerProfile!!.properties.first().value
)
}
}
ItemStackData(
_type = i.type,
_name = miniMessage().serialize(i.displayName().hoverEvent(null).compact()),
_model = if(i.hasCustomModelData()) i.customModelData else null,
_skullData = skullData,
_lore = i.lore()?.map{miniMessage().serialize(it.compact())} ?: emptyList(),
_itemFlags = i.itemFlags.toTypedArray(),
_enchants = i.enchantments.map{it.key to it.value},
_attributeModifiers = i.attributeModifiers?.entries()?.associate {it.key.name to it.value} ?: emptyMap(),
_nbt = i.persistentDataContainer.keys.associate {
it.toString() to (i.persistentDataContainer[it, PersistentDataType.BYTE] == 1.toByte())
}
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment