item builder DSL framework completed and seems to work. custom tag and model generation don't work yet. don't uncomment the tag generation code as it causes a stack overflow crash ⚠️

This commit is contained in:
2026-07-11 22:21:17 +01:00
parent 5b57baafb1
commit fe04526040
23 changed files with 524 additions and 166 deletions
@@ -1,8 +1,9 @@
package dev.zxq5.items.sets
import dev.zxq5.items.core.ArmorSet
import dev.zxq5.items.core.GenericGearSet
import dev.zxq5.items.core.gearItem
import dev.zxq5.items.template.ArmorSet
import dev.zxq5.items.template.GenericGearSet
import dev.zxq5.items.template.registerItem
import dev.zxq5.items.template.provideDelegate
import net.minecraft.core.component.DataComponents
import net.minecraft.sounds.SoundEvents
import net.minecraft.world.InteractionHand
@@ -29,7 +30,7 @@ object Witherite: GenericGearSet() {
override val materialDefinition
get() = super.materialDefinition.copy(assetId = materialKey)
val SHIELD by gearItem("witherite_shield", ::Item) {
val SHIELD by registerItem("witherite_shield", ::Item) {
properties {
component(DataComponents.BLOCKS_ATTACKS, BlocksAttacks(
0.25f, // 5 tick warmup
@@ -48,9 +49,10 @@ object Witherite: GenericGearSet() {
Optional.empty() // default disable sound
))
}
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_SWORD, Items.WITHER_SKELETON_SKULL)
}
val SWORD by gearItem("witherite_sword", ::WitheriteSword) {
val SWORD by registerItem("witherite_sword", ::WitheriteSword) {
properties {
enchantable(armorMaterial.enchantmentValue)
.component(DataComponents.USE_COOLDOWN, UseCooldown(2f))
@@ -59,7 +61,7 @@ object Witherite: GenericGearSet() {
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_SWORD, Items.WITHER_SKELETON_SKULL)
}
val AXE by gearItem("witherite_axe", ::WitheriteWeapon) {
val AXE by registerItem("witherite_axe", ::WitheriteWeapon) {
properties {
enchantable(armorMaterial.enchantmentValue)
.component(DataComponents.USE_COOLDOWN, UseCooldown(2f))
@@ -68,28 +70,28 @@ object Witherite: GenericGearSet() {
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_AXE, Items.WITHER_SKELETON_SKULL)
}
val HELMET by gearItem("witherite_helmet", ::Item) {
val HELMET by registerItem("witherite_helmet", ::Item) {
properties {
humanoidArmor(armorMaterial, ArmorType.HELMET)
}
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_HELMET, Items.WITHER_SKELETON_SKULL)
}
val CHESTPLATE by gearItem("witherite_chestplate", ::Item) {
val CHESTPLATE by registerItem("witherite_chestplate", ::Item) {
properties {
humanoidArmor(armorMaterial, ArmorType.CHESTPLATE)
}
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_CHESTPLATE, Items.WITHER_SKELETON_SKULL)
}
val LEGGINGS by gearItem("witherite_leggings", ::Item) {
val LEGGINGS by registerItem("witherite_leggings", ::Item) {
properties {
humanoidArmor(armorMaterial, ArmorType.LEGGINGS)
}
smithingUpgrade(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE, Items.NETHERITE_LEGGINGS, Items.WITHER_SKELETON_SKULL)
}
val BOOTS by gearItem("witherite_boots", ::Item) {
val BOOTS by registerItem("witherite_boots", ::Item) {
properties {
humanoidArmor(armorMaterial, ArmorType.BOOTS)
}