Mark energy sword as enchantable
still, you can't enchant it, because enchants don't recognize it as appropriate item to enchant
This commit is contained in:
parent
56789d0e40
commit
09111a87d9
@ -76,6 +76,10 @@ class EnergySwordItem : Item(Properties().stacksTo(1).rarity(Rarity.RARE).tab(Ov
|
|||||||
dischargedAttributes = builder.build()
|
dischargedAttributes = builder.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun isEnchantable(p_41456_: ItemStack): Boolean {
|
||||||
|
return p_41456_.count == 1
|
||||||
|
}
|
||||||
|
|
||||||
override fun getDestroySpeed(itemStack: ItemStack, blockState: BlockState): Float {
|
override fun getDestroySpeed(itemStack: ItemStack, blockState: BlockState): Float {
|
||||||
val energy = itemStack.getCapability(MatteryCapability.ENERGY).orNull() ?: return 1f
|
val energy = itemStack.getCapability(MatteryCapability.ENERGY).orNull() ?: return 1f
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user