mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-12-03 05:28:53 -05:00
Wearable Fixes
All Wearable Items now can be equipped properly, and render their correct models in the correct contexts. More may be done here in future, but it works and that was the goal
This commit is contained in:
1 parent
0f65a986ed
commit
6b24bf5cae
28 files changed
+278
-113
No files matched your search
@@ -56,6 +56,7 @@ import net.minecraft.resources.ResourceKey
|
||||
import net.minecraft.resources.Identifier
|
||||
import net.minecraft.world.effect.MobEffectInstance
|
||||
import net.minecraft.world.effect.MobEffects
|
||||
import net.minecraft.world.entity.EquipmentSlot
|
||||
import net.minecraft.world.entity.LivingEntity
|
||||
import net.minecraft.world.food.FoodProperties
|
||||
import net.minecraft.world.item.BlockItem
|
||||
@@ -940,25 +941,24 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
@JvmField
|
||||
val WATER_STONE = noSettingsItem("water_stone")
|
||||
|
||||
//val wearables = mutableListOf<WearableItem>()
|
||||
//Wearable items (these items should have a corresponding 3D model)
|
||||
@JvmField val BLACK_GLASSES = noSettingsItem("black_glasses")
|
||||
@JvmField val CHOICE_BAND = noSettingsItem("choice_band")
|
||||
@JvmField val CHOICE_SPECS = noSettingsItem("choice_specs")
|
||||
@JvmField val EXP_SHARE = noSettingsItem("exp_share")
|
||||
@JvmField val FOCUS_BAND = noSettingsItem("focus_band")
|
||||
@JvmField val KINGS_ROCK = blockItem("kings_rock", CobblemonBlocks.KINGS_ROCK)
|
||||
@JvmField val NEVER_MELT_ICE = blockItem("never_melt_ice", CobblemonBlocks.NEVER_MELT_ICE)
|
||||
@JvmField val MUSCLE_BAND = noSettingsItem("muscle_band")
|
||||
@JvmField val ROCKY_HELMET = noSettingsItem("rocky_helmet")
|
||||
@JvmField val SAFETY_GOGGLES = noSettingsItem("safety_goggles")
|
||||
@JvmField val WISE_GLASSES = noSettingsItem("wise_glasses")
|
||||
@JvmField val SHARP_BEAK = noSettingsItem("sharp_beak")
|
||||
@JvmField val COVERT_CLOAK = noSettingsItem("covert_cloak")
|
||||
@JvmField val SHELL_HELMET = noSettingsItem("shell_helmet")
|
||||
@JvmField val GALARICA_WREATH = blockItem("galarica_wreath", CobblemonBlocks.GALARICA_WREATH)
|
||||
@JvmField val CLEANSE_TAG = blockItem("cleanse_tag", CobblemonBlocks.CLEANSE_TAG)
|
||||
@JvmField val SPELL_TAG = blockItem("spell_tag", CobblemonBlocks.SPELL_TAG)
|
||||
// Wearable items (these items should have a corresponding 3D model)
|
||||
@JvmField val BLACK_GLASSES = wearableItem("black_glasses")
|
||||
@JvmField val CHOICE_BAND = wearableItem("choice_band")
|
||||
@JvmField val CHOICE_SPECS = wearableItem("choice_specs")
|
||||
@JvmField val EXP_SHARE = wearableItem("exp_share")
|
||||
@JvmField val FOCUS_BAND = wearableItem("focus_band")
|
||||
@JvmField val KINGS_ROCK = wearableBlockItem("kings_rock", CobblemonBlocks.KINGS_ROCK)
|
||||
@JvmField val NEVER_MELT_ICE = wearableBlockItem("never_melt_ice", CobblemonBlocks.NEVER_MELT_ICE)
|
||||
@JvmField val MUSCLE_BAND = wearableItem("muscle_band")
|
||||
@JvmField val ROCKY_HELMET = wearableItem("rocky_helmet")
|
||||
@JvmField val SAFETY_GOGGLES = wearableItem("safety_goggles")
|
||||
@JvmField val WISE_GLASSES = wearableItem("wise_glasses")
|
||||
@JvmField val SHARP_BEAK = wearableItem("sharp_beak")
|
||||
@JvmField val COVERT_CLOAK = wearableItem("covert_cloak")
|
||||
@JvmField val SHELL_HELMET = wearableItem("shell_helmet")
|
||||
@JvmField val GALARICA_WREATH = wearableBlockItem("galarica_wreath", CobblemonBlocks.GALARICA_WREATH)
|
||||
@JvmField val CLEANSE_TAG = wearableBlockItem("cleanse_tag", CobblemonBlocks.CLEANSE_TAG)
|
||||
@JvmField val SPELL_TAG = wearableBlockItem("spell_tag", CobblemonBlocks.SPELL_TAG)
|
||||
|
||||
// Held Items
|
||||
@JvmField
|
||||
@@ -1604,6 +1604,10 @@ object CobblemonItems : PlatformRegistry<Registry<Item>, ResourceKey<Registry<It
|
||||
|
||||
private fun noSettingsItem(name: String): CobblemonItem = this.create(name, CobblemonItem(emptyProperties(name)))
|
||||
|
||||
private fun wearableItem(name: String): CobblemonItem = this.create(name, CobblemonItem(emptyProperties(name).equippable(EquipmentSlot.HEAD)))
|
||||
|
||||
private fun wearableBlockItem(name: String, block: Block, rarity: Rarity = Rarity.COMMON): BlockItem = this.create(name, BlockItem(block, emptyProperties(name).rarity(rarity).equippable(EquipmentSlot.HEAD)))
|
||||
|
||||
private fun itemWithRarity(name: String, rarity: Rarity): CobblemonItem = this.create(name, CobblemonItem(emptyProperties(name).rarity(rarity)))
|
||||
|
||||
fun berries() = this.berries.toMap()
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/black_glasses"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/black_glasses"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/black_glasses"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/choice_band"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/choice_band"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/choice_band"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/choice_specs"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/choice_specs"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/choice_specs"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/cleanse_tag"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/cleanse_tag"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/cleanse_tag"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/covert_cloak"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/covert_cloak"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/covert_cloak"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/exp_share"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/exp_share"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/exp_share"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/focus_band"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/focus_band"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/focus_band"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/galarica_wreath"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/galarica_wreath"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/galarica_wreath"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/kings_rock"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/kings_rock"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/kings_rock"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/muscle_band"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/muscle_band"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/muscle_band"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/never_melt_ice"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/never_melt_ice"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/never_melt_ice"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/rocky_helmet"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/rocky_helmet"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/rocky_helmet"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/safety_goggles"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/safety_goggles"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/safety_goggles"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/sharp_beak"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/sharp_beak"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/sharp_beak"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/shell_helmet"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/shell_helmet"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/shell_helmet"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/spell_tag"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/spell_tag"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/spell_tag"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/black_glasses"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/choice_band"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/choice_specs"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/exp_share"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/focus_band"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/kings_rock"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/muscle_band"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/rocky_helmet"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/safety_goggles"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/wise_glasses"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,19 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wise_glasses"
|
||||
"type": "minecraft:select",
|
||||
"property": "minecraft:display_context",
|
||||
"cases": [
|
||||
{
|
||||
"when": "head",
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wearable/wise_glasses"
|
||||
}
|
||||
}
|
||||
],
|
||||
"fallback": {
|
||||
"type": "minecraft:model",
|
||||
"model": "cobblemon:item/wise_glasses"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user