From 7393ee53ce88ada813315a7700d52a9e6244d86e Mon Sep 17 00:00:00 2001 From: Jottyfan Date: Thu, 14 May 2026 12:39:51 +0200 Subject: [PATCH] added armor --- .../minecraft/gta/item/ModArmorMaterial.java | 30 ++++++++++++++++++ .../jottyfan/minecraft/gta/item/UnoItems.java | 30 ++++++++++++++---- .../resources/assets/uno/equipment/ruby.json | 16 ++++++++++ .../assets/uno/items/ruby_boots.json | 6 ++++ .../assets/uno/items/ruby_chestplate.json | 6 ++++ .../assets/uno/items/ruby_helmet.json | 6 ++++ .../assets/uno/items/ruby_leggings.json | 6 ++++ src/main/resources/assets/uno/lang/de_de.json | 6 +++- src/main/resources/assets/uno/lang/en_us.json | 6 +++- .../assets/uno/models/item/ruby_boots.json | 6 ++++ .../uno/models/item/ruby_chestplate.json | 6 ++++ .../assets/uno/models/item/ruby_helmet.json | 6 ++++ .../assets/uno/models/item/ruby_leggings.json | 6 ++++ .../entity/equipment/humanoid/ruby.png | Bin 0 -> 1310 bytes .../equipment/humanoid_leggings/ruby.png | Bin 0 -> 730 bytes .../assets/uno/textures/item/ruby_boots.png | Bin 0 -> 366 bytes .../uno/textures/item/ruby_chestplate.png | Bin 0 -> 465 bytes .../assets/uno/textures/item/ruby_helmet.png | Bin 0 -> 396 bytes .../uno/textures/item/ruby_leggings.png | Bin 0 -> 379 bytes .../data/uno/recipe/shaped_ruby_boots.json | 14 ++++++++ .../uno/recipe/shaped_ruby_chestplate.json | 16 ++++++++++ .../data/uno/recipe/shaped_ruby_helmet.json | 14 ++++++++ .../data/uno/recipe/shaped_ruby_leggings.json | 15 +++++++++ 23 files changed, 186 insertions(+), 9 deletions(-) create mode 100644 src/main/java/de/jottyfan/minecraft/gta/item/ModArmorMaterial.java create mode 100644 src/main/resources/assets/uno/equipment/ruby.json create mode 100644 src/main/resources/assets/uno/items/ruby_boots.json create mode 100644 src/main/resources/assets/uno/items/ruby_chestplate.json create mode 100644 src/main/resources/assets/uno/items/ruby_helmet.json create mode 100644 src/main/resources/assets/uno/items/ruby_leggings.json create mode 100644 src/main/resources/assets/uno/models/item/ruby_boots.json create mode 100644 src/main/resources/assets/uno/models/item/ruby_chestplate.json create mode 100644 src/main/resources/assets/uno/models/item/ruby_helmet.json create mode 100644 src/main/resources/assets/uno/models/item/ruby_leggings.json create mode 100644 src/main/resources/assets/uno/textures/entity/equipment/humanoid/ruby.png create mode 100644 src/main/resources/assets/uno/textures/entity/equipment/humanoid_leggings/ruby.png create mode 100644 src/main/resources/assets/uno/textures/item/ruby_boots.png create mode 100644 src/main/resources/assets/uno/textures/item/ruby_chestplate.png create mode 100644 src/main/resources/assets/uno/textures/item/ruby_helmet.png create mode 100644 src/main/resources/assets/uno/textures/item/ruby_leggings.png create mode 100644 src/main/resources/data/uno/recipe/shaped_ruby_boots.json create mode 100644 src/main/resources/data/uno/recipe/shaped_ruby_chestplate.json create mode 100644 src/main/resources/data/uno/recipe/shaped_ruby_helmet.json create mode 100644 src/main/resources/data/uno/recipe/shaped_ruby_leggings.json 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 0000000000000000000000000000000000000000..219ce91703500d71297ac668c0d44e6a7d77ebd3 GIT binary patch literal 1310 zcmV+(1>yRMP)z@;j|==^1poj5AY({UO#lFTCIA3{ga82g0001h=l}q9FaQARU;qF* zm;eA5aGbhPJOBUy24YJ`L;$M*T>usL4NUL=000SaNLh0L01FcU01FcV0GgZ_00007 zbV*G`2kHR|4lWklo66?^00d%5L_t(&-tAexZyHw|{~UKk7xYLiv1BL+sH(^c7qBc@ zvWV<4qLIfqOWG;!5cLm8q>fgzM9Suc(OujwRVw7Hj6$IO=Jj57?ZgWNIC;NWb9-|fBoygR->-}m!H!6{PCtUBDb002zY#Xjxb+FDX@fkhhxl&w4f z%of_EV*tR>`W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6S0ou~{(bY@^F!!HRGt!tQ<(vWQyjB{Kud-AzVzqK3P++pFOyeYz}2gp zW437b#=UWCgE>Pp;#SXm_F0C->*;Cr1{+Sn0B4rZ-Mig5ZgTe~ HDWM4fR;(wi literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..a06b9b3229f79be3184d7cedb48a76eed263a98c GIT binary patch literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jPK-BC>eK@{Ea{HEjtmSN z`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e4;`njw}!^gFN52cQUNfk$L90|U1(2s1Lwnj--eWH0gbb!C6W$i-*G9Bx<~2o&1n z>Eak-aXL9c;!}fQ?16db|JnD{ez@%D7LydwXgmM!e=yki;d^~3-_`#uMp^p!@aPy(9mZ=Z-K67@O1TaS?83{1OW8pg-ied literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..0f66dbac58d1e9784c7c6941a54e0d87310d69c7 GIT binary patch literal 465 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jPK-BC>eK@{Ea{HEjtmSN z`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e4;`njw}!^gFN52cQUNfk$L90|U1(2s1Lwnj--eWH0gbb!C6W$i-*Gr`f>&2IvA& zPZ!4!i_^&o5*Y_h95`?wK|krgeC(qKvzvQP)a=Q6i^C5VV423sky&<+Oz>8X3hTm?ICV-0xkOtHkUq%6zzfMx)fJ zT@tebd2Uqa={B3}muha?q{kd>!QIT+EPYsy&79|O{++#NK74tsYcapGv9a;t&F{;3 zuJSK8viV!l-FV!6(!=Yg>mCg~2eut1hvxM2&DfxMB%Q;NdBe>n|2eF&4_+RR=HV&dc)LyJmxiaLtwQwE v&5}!gUfs}USHzHH%8eK@{Ea{HEjtmSN z`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e4;`njw}!^gFN52cQUNfk$L90|U1(2s1Lwnj--eWH0gbb!C6W$i-*Gap3W)n?Rup zo-U3d7N_4%wC6t?o39WB758tHEiR z$0II=?i*lq+60hBVXk(=>q-6;OXk;vd$@?2>=gNkt_fJ literal 0 HcmV?d00001 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 0000000000000000000000000000000000000000..1ebbe78968e5ef7cb73ce139028d80ee80210098 GIT binary patch literal 379 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jPK-BC>eK@{Ea{HEjtmSN z`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8ZKG z?e4;`njw}!^gFN52cQUNfk$L90|U1(2s1Lwnj--eWH0gbb!C6W$i-)9xl7=u0#Inb zr;B5V#p&b(iHrjsdI{&#|I1H*l)itS;hlelvjvxDeyjQRf4}~pzw&JRfaL$*hwlHs zUuFCM|FzdY|Az)${=d3t#iED