diff --git a/src/main/java/de/jottyfan/minecraft/gta/item/ModArmorMaterial.java b/src/main/java/de/jottyfan/minecraft/gta/item/ModArmorMaterial.java new file mode 100644 index 0000000..7c21e1b --- /dev/null +++ b/src/main/java/de/jottyfan/minecraft/gta/item/ModArmorMaterial.java @@ -0,0 +1,30 @@ +package de.jottyfan.minecraft.gta.item; + +import java.util.EnumMap; + +import de.jottyfan.minecraft.gta.Uno; +import net.minecraft.core.Registry; +import net.minecraft.resources.Identifier; +import net.minecraft.resources.ResourceKey; +import net.minecraft.sounds.SoundEvents; +import net.minecraft.util.Util; +import net.minecraft.world.item.equipment.ArmorMaterial; +import net.minecraft.world.item.equipment.ArmorType; +import net.minecraft.world.item.equipment.EquipmentAsset; + +public class ModArmorMaterial { + public static ResourceKey> REGISTRY_KEY = ResourceKey + .createRegistryKey(Identifier.withDefaultNamespace("equipment_asset")); + + public static final ResourceKey RUBY_KEY = ResourceKey.create(REGISTRY_KEY, + Identifier.fromNamespaceAndPath(Uno.MOD_ID, "ruby")); + + public static final ArmorMaterial RUBY_ARMOR_MATERIAL = new ArmorMaterial(500, + Util.make(new EnumMap<>(ArmorType.class), map -> { + map.put(ArmorType.BOOTS, 3); + map.put(ArmorType.LEGGINGS,4); + map.put(ArmorType.CHESTPLATE, 10); + map.put(ArmorType.HELMET, 3); + map.put(ArmorType.BODY, 5); + }), 20, SoundEvents.ARMOR_EQUIP_DIAMOND, 0, 0, null, RUBY_KEY); +} diff --git a/src/main/java/de/jottyfan/minecraft/gta/item/UnoItems.java b/src/main/java/de/jottyfan/minecraft/gta/item/UnoItems.java index 89ea306..858a672 100644 --- a/src/main/java/de/jottyfan/minecraft/gta/item/UnoItems.java +++ b/src/main/java/de/jottyfan/minecraft/gta/item/UnoItems.java @@ -10,21 +10,37 @@ import net.minecraft.resources.Identifier; import net.minecraft.resources.ResourceKey; import net.minecraft.world.item.Item; import net.minecraft.world.item.Item.Properties; +import net.minecraft.world.item.equipment.ArmorType; public class UnoItems { - public static final Item STUB = registerStubItem(Identifier.fromNamespaceAndPath(Uno.MOD_ID, "stub")); - public static final Item RUBY = registerItem(Identifier.fromNamespaceAndPath(Uno.MOD_ID, "ruby")); + public static final Item STUB = registerStubItem("stub"); + public static final Item RUBY = registerItem("ruby"); + private static final Item RUBY_BOOTS = registerArmorItem("ruby_boots", ArmorType.BOOTS); + private static final Item RUBY_HELMET = registerArmorItem("ruby_helmet", ArmorType.HELMET); + private static final Item RUBY_CHESTPLATE = registerArmorItem("ruby_chestplate", ArmorType.CHESTPLATE); + private static final Item RUBY_LEGGINGS = registerArmorItem("ruby_leggings", ArmorType.LEGGINGS); - private static final Item registerStubItem(Identifier identifier) { - return registerItem(identifier, new Item.Properties() + private static final Item registerArmorItem(String name, ArmorType type) { + Item.Properties properties = new Item.Properties() + .humanoidArmor(ModArmorMaterial.RUBY_ARMOR_MATERIAL, type); + return registerItem(name, properties); + } + + private static final Item registerItem(String name, Properties properties) { + return registerItem(name, properties, Item::new); + } + + private static final Item registerStubItem(String name) { + return registerItem(name, new Item.Properties() .food(Food.DELICIOUS_STUB.get()), StubItem::new); } - private static final Item registerItem(Identifier identifier) { - return registerItem(identifier, new Item.Properties(), Item::new); + private static final Item registerItem(String name) { + return registerItem(name, new Item.Properties(), Item::new); } - private static final Item registerItem(Identifier identifier, Properties properties, Function function) { + private static final Item registerItem(String name, Properties properties, Function function) { + Identifier identifier = Identifier.fromNamespaceAndPath(Uno.MOD_ID, name); Item item = function.apply(properties.setId(ResourceKey.create(Registries.ITEM, identifier)).modelId(identifier).useItemDescriptionPrefix()); return Registry.register(BuiltInRegistries.ITEM, identifier, item); } diff --git a/src/main/resources/assets/uno/equipment/ruby.json b/src/main/resources/assets/uno/equipment/ruby.json new file mode 100644 index 0000000..f9e38ab --- /dev/null +++ b/src/main/resources/assets/uno/equipment/ruby.json @@ -0,0 +1,16 @@ +{ + "layers": { + "humanoid": [ + { + "texture": "uno:ruby" + } + ], + "humanoid_leggings": [ + { + "texture": "uno:ruby" + } + ] + } +} + + diff --git a/src/main/resources/assets/uno/items/ruby_boots.json b/src/main/resources/assets/uno/items/ruby_boots.json new file mode 100644 index 0000000..88b3ff9 --- /dev/null +++ b/src/main/resources/assets/uno/items/ruby_boots.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "uno:item/ruby_boots" + } +} diff --git a/src/main/resources/assets/uno/items/ruby_chestplate.json b/src/main/resources/assets/uno/items/ruby_chestplate.json new file mode 100644 index 0000000..0e5650e --- /dev/null +++ b/src/main/resources/assets/uno/items/ruby_chestplate.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "uno:item/ruby_chestplate" + } +} diff --git a/src/main/resources/assets/uno/items/ruby_helmet.json b/src/main/resources/assets/uno/items/ruby_helmet.json new file mode 100644 index 0000000..2723442 --- /dev/null +++ b/src/main/resources/assets/uno/items/ruby_helmet.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "uno:item/ruby_helmet" + } +} diff --git a/src/main/resources/assets/uno/items/ruby_leggings.json b/src/main/resources/assets/uno/items/ruby_leggings.json new file mode 100644 index 0000000..66eed76 --- /dev/null +++ b/src/main/resources/assets/uno/items/ruby_leggings.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "uno:item/ruby_leggings" + } +} diff --git a/src/main/resources/assets/uno/lang/de_de.json b/src/main/resources/assets/uno/lang/de_de.json index 6008136..14ba47a 100644 --- a/src/main/resources/assets/uno/lang/de_de.json +++ b/src/main/resources/assets/uno/lang/de_de.json @@ -3,5 +3,9 @@ "item.uno.ruby": "Rubin", "item.uni.ruby_block": "Rubinblock", "item.uni.ruby_ore": "Rubinerz", - "item.uni.ruby_deepslate_ore": "Rubintiefenerz" + "item.uni.ruby_deepslate_ore": "Rubintiefenerz", + "item.uni.ruby_helmet": "Rubinhelm", + "item.uni.ruby_chestplate": "Rubinbrustpanzer", + "item.uni.ruby_leggings": "Rubinhose", + "item.uni.ruby_boots": "Rubinschuhe" } \ No newline at end of file diff --git a/src/main/resources/assets/uno/lang/en_us.json b/src/main/resources/assets/uno/lang/en_us.json index 798f5a6..c9a94cf 100644 --- a/src/main/resources/assets/uno/lang/en_us.json +++ b/src/main/resources/assets/uno/lang/en_us.json @@ -3,5 +3,9 @@ "item.uno.ruby": "Ruby", "item.uno.ruby_block": "Ruby block", "item.uno.ruby_ore": "Ruby ore", - "item.uno.ruby_deepslate_ore": "Ruby deepslate ore" + "item.uno.ruby_deepslate_ore": "Ruby deepslate ore", + "item.uno.ruby_helmet": "ruby helmet", + "item.uno.ruby_chestplate": "ruby chestplate", + "item.uno.ruby_leggings": "ruby leggings", + "item.uno.ruby_boots": "ruby boots" } \ No newline at end of file diff --git a/src/main/resources/assets/uno/models/item/ruby_boots.json b/src/main/resources/assets/uno/models/item/ruby_boots.json new file mode 100644 index 0000000..e49262c --- /dev/null +++ b/src/main/resources/assets/uno/models/item/ruby_boots.json @@ -0,0 +1,6 @@ +{ + "parent": "item/coal", + "textures": { + "layer0": "uno:item/ruby_boots" + } +} diff --git a/src/main/resources/assets/uno/models/item/ruby_chestplate.json b/src/main/resources/assets/uno/models/item/ruby_chestplate.json new file mode 100644 index 0000000..f6af9ba --- /dev/null +++ b/src/main/resources/assets/uno/models/item/ruby_chestplate.json @@ -0,0 +1,6 @@ +{ + "parent": "item/coal", + "textures": { + "layer0": "uno:item/ruby_chestplate" + } +} diff --git a/src/main/resources/assets/uno/models/item/ruby_helmet.json b/src/main/resources/assets/uno/models/item/ruby_helmet.json new file mode 100644 index 0000000..a5e9beb --- /dev/null +++ b/src/main/resources/assets/uno/models/item/ruby_helmet.json @@ -0,0 +1,6 @@ +{ + "parent": "item/coal", + "textures": { + "layer0": "uno:item/ruby_helmet" + } +} diff --git a/src/main/resources/assets/uno/models/item/ruby_leggings.json b/src/main/resources/assets/uno/models/item/ruby_leggings.json new file mode 100644 index 0000000..cfb0b5e --- /dev/null +++ b/src/main/resources/assets/uno/models/item/ruby_leggings.json @@ -0,0 +1,6 @@ +{ + "parent": "item/coal", + "textures": { + "layer0": "uno:item/ruby_leggings" + } +} diff --git a/src/main/resources/assets/uno/textures/entity/equipment/humanoid/ruby.png b/src/main/resources/assets/uno/textures/entity/equipment/humanoid/ruby.png new file mode 100644 index 0000000..219ce91 Binary files /dev/null and b/src/main/resources/assets/uno/textures/entity/equipment/humanoid/ruby.png differ diff --git a/src/main/resources/assets/uno/textures/entity/equipment/humanoid_leggings/ruby.png b/src/main/resources/assets/uno/textures/entity/equipment/humanoid_leggings/ruby.png new file mode 100644 index 0000000..1e8739a Binary files /dev/null and b/src/main/resources/assets/uno/textures/entity/equipment/humanoid_leggings/ruby.png differ diff --git a/src/main/resources/assets/uno/textures/item/ruby_boots.png b/src/main/resources/assets/uno/textures/item/ruby_boots.png new file mode 100644 index 0000000..a06b9b3 Binary files /dev/null and b/src/main/resources/assets/uno/textures/item/ruby_boots.png differ diff --git a/src/main/resources/assets/uno/textures/item/ruby_chestplate.png b/src/main/resources/assets/uno/textures/item/ruby_chestplate.png new file mode 100644 index 0000000..0f66dba Binary files /dev/null and b/src/main/resources/assets/uno/textures/item/ruby_chestplate.png differ diff --git a/src/main/resources/assets/uno/textures/item/ruby_helmet.png b/src/main/resources/assets/uno/textures/item/ruby_helmet.png new file mode 100644 index 0000000..0f0423a Binary files /dev/null and b/src/main/resources/assets/uno/textures/item/ruby_helmet.png differ diff --git a/src/main/resources/assets/uno/textures/item/ruby_leggings.png b/src/main/resources/assets/uno/textures/item/ruby_leggings.png new file mode 100644 index 0000000..1ebbe78 Binary files /dev/null and b/src/main/resources/assets/uno/textures/item/ruby_leggings.png differ diff --git a/src/main/resources/data/uno/recipe/shaped_ruby_boots.json b/src/main/resources/data/uno/recipe/shaped_ruby_boots.json new file mode 100644 index 0000000..bea8e93 --- /dev/null +++ b/src/main/resources/data/uno/recipe/shaped_ruby_boots.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "t t", + "t t" + ], + "key": { + "t": "uno:ruby" + }, + "result": { + "id": "uno:ruby_boots", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/uno/recipe/shaped_ruby_chestplate.json b/src/main/resources/data/uno/recipe/shaped_ruby_chestplate.json new file mode 100644 index 0000000..6ac8186 --- /dev/null +++ b/src/main/resources/data/uno/recipe/shaped_ruby_chestplate.json @@ -0,0 +1,16 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "t t", + "ttt", + "ttt" + ], + "key": { + "t": "uno:ruby" + }, + "result": { + "id": "uno:ruby_chestplate", + "count": 1 + } +} + diff --git a/src/main/resources/data/uno/recipe/shaped_ruby_helmet.json b/src/main/resources/data/uno/recipe/shaped_ruby_helmet.json new file mode 100644 index 0000000..64cc5e7 --- /dev/null +++ b/src/main/resources/data/uno/recipe/shaped_ruby_helmet.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ttt", + "t t" + ], + "key": { + "t": "uno:ruby" + }, + "result": { + "id": "uno:ruby_helmet", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/uno/recipe/shaped_ruby_leggings.json b/src/main/resources/data/uno/recipe/shaped_ruby_leggings.json new file mode 100644 index 0000000..970c76b --- /dev/null +++ b/src/main/resources/data/uno/recipe/shaped_ruby_leggings.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "ttt", + "t t", + "t t" + ], + "key": { + "t": "uno:ruby" + }, + "result": { + "id": "uno:ruby_leggings", + "count": 1 + } +} \ No newline at end of file