added ruby armor

This commit is contained in:
Jottyfan
2025-07-19 18:11:20 +02:00
parent 771745b6b3
commit 5a30bffae1
23 changed files with 168 additions and 4 deletions

View File

@@ -0,0 +1,30 @@
package de.jottyfan.gta.gdp.item;
import java.util.EnumMap;
import de.jottyfan.gta.gdp.GTAGDP;
import net.minecraft.item.equipment.ArmorMaterial;
import net.minecraft.item.equipment.EquipmentAsset;
import net.minecraft.item.equipment.EquipmentType;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
/**
*
* @author jotty
*
*/
public class ModArmorMaterials {
static RegistryKey<? extends Registry<EquipmentAsset>> REGISTRY_KEY = RegistryKey.ofRegistry(Identifier.ofVanilla("equipment_asset"));
public static final RegistryKey<EquipmentAsset> RUBY_KEY = RegistryKey.of(REGISTRY_KEY, Identifier.of(GTAGDP.MOD_ID, "ruby"));
public static final ArmorMaterial RUBY_ARMOR_MATERIAL = new ArmorMaterial(500, Util.make(new EnumMap<>(EquipmentType.class), map -> {
map.put(EquipmentType.BOOTS, 2);
map.put(EquipmentType.LEGGINGS, 3);
map.put(EquipmentType.CHESTPLATE, 4);
map.put(EquipmentType.HELMET, 1);
map.put(EquipmentType.BODY, 4);
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0, 0, null, RUBY_KEY);
}

View File

@@ -5,6 +5,7 @@ import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.item.Item;
import net.minecraft.item.Item.Settings;
import net.minecraft.item.ItemGroups;
import net.minecraft.item.equipment.EquipmentType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
@@ -18,11 +19,12 @@ import net.minecraft.util.Identifier;
*/
public class ModItems {
public static final Item STUB = registerStubItem(
Identifier.of(GTAGDP.MOD_ID, "stub"),
new Item.Settings().food(ModFoodComponents.DELICIOUS_STUB));
public static final Item STUB = registerStubItem(Identifier.of(GTAGDP.MOD_ID, "stub"), new Item.Settings().food(ModFoodComponents.DELICIOUS_STUB));
public static final Item RUBYBALL = registerItem(Identifier.of(GTAGDP.MOD_ID, "rubyball"), new Item.Settings());
public static final Item ARMOR_RUBY_HELMET = registerItem(Identifier.of(GTAGDP.MOD_ID, "ruby_helmet"), new Item.Settings().maxCount(1).armor(ModArmorMaterials.RUBY_ARMOR_MATERIAL, EquipmentType.HELMET));
public static final Item ARMOR_RUBY_CHESTPLATE = registerItem(Identifier.of(GTAGDP.MOD_ID, "ruby_chestplate"), new Item.Settings().maxCount(1).armor(ModArmorMaterials.RUBY_ARMOR_MATERIAL, EquipmentType.CHESTPLATE));
public static final Item ARMOR_RUBY_LEGGINGS = registerItem(Identifier.of(GTAGDP.MOD_ID, "ruby_leggings"), new Item.Settings().maxCount(1).armor(ModArmorMaterials.RUBY_ARMOR_MATERIAL, EquipmentType.LEGGINGS));
public static final Item ARMOR_RUBY_BOOTS = registerItem(Identifier.of(GTAGDP.MOD_ID, "ruby_boots"), new Item.Settings().maxCount(1).armor(ModArmorMaterials.RUBY_ARMOR_MATERIAL, EquipmentType.BOOTS));
private static Item registerItem(Identifier identifier, Settings settings) {
return Registry.register(Registries.ITEM, identifier,
@@ -40,6 +42,10 @@ public class ModItems {
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(entries -> {
entries.add(STUB);
entries.add(RUBYBALL);
entries.add(ARMOR_RUBY_HELMET);
entries.add(ARMOR_RUBY_CHESTPLATE);
entries.add(ARMOR_RUBY_LEGGINGS);
entries.add(ARMOR_RUBY_BOOTS);
});
}
}

View File

@@ -0,0 +1,14 @@
{
"layers": {
"humanoid": [
{
"texture": "gtagdp:ruby_top"
}
],
"humanoid_leggings": [
{
"texture": "gtagdp:ruby_bottom"
}
]
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "gtagdp:item/ruby_boots"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "gtagdp:item/ruby_chestplate"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "gtagdp:item/ruby_helmet"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "gtagdp:item/ruby_leggings"
}
}

View File

@@ -1,6 +1,10 @@
{
"item.gtagdp.stub": "Stummel",
"item.gtagdp.rubyball": "Rubinball",
"item.gtagdp.ruby_helmet": "Rubinhelm",
"item.gtagdp.ruby_chestplate": "Rubinbrustpanzer",
"item.gtagdp.ruby_leggings": "Rubinhose",
"item.gtagdp.ruby_boots": "Rubinstiefel",
"block.gtagdp.ruby_block": "Rubinblock",
"block.gtagdp.ruby_ore": "Rubinerz",

View File

@@ -1,6 +1,10 @@
{
"item.gtagdp.stub": "Stub",
"item.gtagdp.rubyball": "Ruby ball",
"item.gtagdp.ruby_helmet": "Ruby helmet",
"item.gtagdp.ruby_chestplate": "Ruby chestplate",
"item.gtagdp.ruby_leggings": "Ruby leggings",
"item.gtagdp.ruby_boots": "Ruby boots",
"block.gtagdp.ruby_block": "Ruby block",
"block.gtagdp.ruby_ore": "Ruby ore",

View File

@@ -0,0 +1,6 @@
{
"parent": "item/coal",
"textures": {
"layer0": "gtagdp:item/ruby_boots"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/coal",
"textures": {
"layer0": "gtagdp:item/ruby_chestplate"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/coal",
"textures": {
"layer0": "gtagdp:item/ruby_helmet"
}
}

View File

@@ -0,0 +1,6 @@
{
"parent": "item/coal",
"textures": {
"layer0": "gtagdp:item/ruby_leggings"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"# #",
"# #"
],
"key": {
"#": "gtagdp:rubyball"
},
"result": {
"id": "gtagdp:ruby_boots",
"count": 1
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"# #",
"###",
"###"
],
"key": {
"#": "gtagdp:rubyball"
},
"result": {
"id": "gtagdp:ruby_chestplate",
"count": 1
}
}

View File

@@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"# #"
],
"key": {
"#": "gtagdp:rubyball"
},
"result": {
"id": "gtagdp:ruby_helmet",
"count": 1
}
}

View File

@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"###",
"# #",
"# #"
],
"key": {
"#": "gtagdp:rubyball"
},
"result": {
"id": "gtagdp:ruby_leggings",
"count": 1
}
}