@@ -0,0 +1,30 @@
|
||||
package de.jottyfan.minecraft.item;
|
||||
|
||||
import java.util.EnumMap;
|
||||
|
||||
import de.jottyfan.minecraft.Gtamfmd;
|
||||
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;
|
||||
|
||||
public class ModArmorMaterial {
|
||||
public 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(Gtamfmd.MOD_ID, "ruby"));
|
||||
|
||||
public static final ArmorMaterial RUBY_ARMOR_MATERIAL = new ArmorMaterial(500,
|
||||
Util.make(new EnumMap<>(EquipmentType.class), map -> {
|
||||
map.put(EquipmentType.BOOTS, 3);
|
||||
map.put(EquipmentType.LEGGINGS,4);
|
||||
map.put(EquipmentType.CHESTPLATE, 10);
|
||||
map.put(EquipmentType.HELMET, 3);
|
||||
map.put(EquipmentType.BODY, 5);
|
||||
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, 0, 0, null, RUBY_KEY);
|
||||
}
|
||||
@@ -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;
|
||||
@@ -13,19 +14,26 @@ import net.minecraft.util.Identifier;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
public static final Item STUB = registerStubItem(
|
||||
Identifier.of(Gtamfmd.MOD_ID, "stub"), new Item.Settings());
|
||||
public static final Item STUB = registerStubItem(Identifier.of(Gtamfmd.MOD_ID, "stub"), new Item.Settings());
|
||||
|
||||
public static final Item RUBY = registerItem(
|
||||
Identifier.of(Gtamfmd.MOD_ID, "ruby"), new Item.Settings());
|
||||
public static final Item GINGERBREAD = registerItem(
|
||||
Identifier.of(Gtamfmd.MOD_ID, "gingerbread"), new Item.Settings()
|
||||
.food(Food.GINGERBREAD.get()));
|
||||
public static final Item RUBY = registerItem(Identifier.of(Gtamfmd.MOD_ID, "ruby"), new Item.Settings());
|
||||
public static final Item GINGERBREAD = registerItem(Identifier.of(Gtamfmd.MOD_ID, "gingerbread"),
|
||||
new Item.Settings().food(Food.GINGERBREAD.get()));
|
||||
|
||||
public static final Item RUBY_BOOTS = registerArmorItem("ruby_boots", EquipmentType.BOOTS);
|
||||
public static final Item RUBY_HELMET = registerArmorItem("ruby_helmet", EquipmentType.HELMET);
|
||||
public static final Item RUBY_CHESTPLATE = registerArmorItem("ruby_chestplate", EquipmentType.CHESTPLATE);
|
||||
public static final Item RUBY_LEGGINGS = registerArmorItem("ruby_leggings", EquipmentType.LEGGINGS);
|
||||
|
||||
private static Item registerArmorItem(String name, EquipmentType type) {
|
||||
Identifier identifier = Identifier.of(Gtamfmd.MOD_ID, name);
|
||||
Item.Settings settings = new Item.Settings().maxCount(1).armor(ModArmorMaterial.RUBY_ARMOR_MATERIAL, type);
|
||||
return registerItem(identifier, settings);
|
||||
}
|
||||
|
||||
private static Item registerStubItem(Identifier identifier, Settings settings) {
|
||||
return Registry.register(Registries.ITEM, identifier, new StubItem(
|
||||
settings.useItemPrefixedTranslationKey()
|
||||
.registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier))));
|
||||
settings.useItemPrefixedTranslationKey().registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier))));
|
||||
}
|
||||
|
||||
private static Item registerItem(Identifier identifier, Settings settings) {
|
||||
@@ -37,11 +45,14 @@ public class ModItems {
|
||||
public static void registerModItems() {
|
||||
Gtamfmd.LOGGER.info("registering mod items for " + Gtamfmd.MOD_ID);
|
||||
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS)
|
||||
.register(entries -> {
|
||||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(entries -> {
|
||||
entries.add(STUB);
|
||||
entries.add(RUBY);
|
||||
entries.add(GINGERBREAD);
|
||||
entries.add(RUBY_HELMET);
|
||||
entries.add(RUBY_CHESTPLATE);
|
||||
entries.add(RUBY_LEGGINGS);
|
||||
entries.add(RUBY_BOOTS);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
14
src/main/resources/assets/gtamfmd/equipment/ruby.json
Normal file
14
src/main/resources/assets/gtamfmd/equipment/ruby.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"layers": {
|
||||
"humanoid": [
|
||||
{
|
||||
"texture": "gtamfmd:ruby"
|
||||
}
|
||||
],
|
||||
"humanoid_leggings": [
|
||||
{
|
||||
"texture": "gtamfmd:ruby"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/gtamfmd/items/ruby_boots.json
Normal file
6
src/main/resources/assets/gtamfmd/items/ruby_boots.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtamfmd:item/ruby_boots"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtamfmd:item/ruby_chestplate"
|
||||
}
|
||||
}
|
||||
6
src/main/resources/assets/gtamfmd/items/ruby_helmet.json
Normal file
6
src/main/resources/assets/gtamfmd/items/ruby_helmet.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtamfmd:item/ruby_helmet"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtamfmd:item/ruby_leggings"
|
||||
}
|
||||
}
|
||||
@@ -4,5 +4,9 @@
|
||||
"item.gtamfmd.ruby": "Rubin",
|
||||
"item.gtamfmd.ruby_block": "Rubinblock",
|
||||
"item.gtamfmd.ruby_ore": "Rubinerz",
|
||||
"item.gtamfmd.christmastree": "Weihnachtsbaum"
|
||||
"item.gtamfmd.christmastree": "Weihnachtsbaum",
|
||||
"item.gtamfmd.ruby_helmet": "Rubinhelm",
|
||||
"item.gtamfmd.ruby_chestplate": "Rubinbrustpanzer",
|
||||
"item.gtamfmd.ruby_leggings": "Rubinhose",
|
||||
"item.gtamfmd.ruby_boots": "Rubinschuhe"
|
||||
}
|
||||
|
||||
@@ -4,5 +4,9 @@
|
||||
"item.gtamfmd.ruby": "Ruby",
|
||||
"item.gtamfmd.ruby_block": "Ruby block",
|
||||
"item.gtamfmd.ruby_ore": "Ruby ore",
|
||||
"item.gtamfmd.christmastree": "Christmas tree"
|
||||
"item.gtamfmd.christmastree": "Christmas tree",
|
||||
"item.gtamfmd.ruby_helmet": "ruby helmet",
|
||||
"item.gtamfmd.ruby_chestplate": "ruby chestplate",
|
||||
"item.gtamfmd.ruby_leggings": "ruby leggings",
|
||||
"item.gtamfmd.ruby_boots": "ruby boots"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/coal",
|
||||
"textures": {
|
||||
"layer0": "gtamfmd:item/ruby_boots"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/coal",
|
||||
"textures": {
|
||||
"layer0": "gtamfmd:item/ruby_chestplate"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/coal",
|
||||
"textures": {
|
||||
"layer0": "gtamfmd:item/ruby_helmet"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "item/coal",
|
||||
"textures": {
|
||||
"layer0": "gtamfmd:item/ruby_leggings"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 730 B |
BIN
src/main/resources/assets/gtamfmd/textures/item/ruby_boots.png
Normal file
BIN
src/main/resources/assets/gtamfmd/textures/item/ruby_boots.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 366 B |
Binary file not shown.
|
After Width: | Height: | Size: 465 B |
BIN
src/main/resources/assets/gtamfmd/textures/item/ruby_helmet.png
Normal file
BIN
src/main/resources/assets/gtamfmd/textures/item/ruby_helmet.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 396 B |
Binary file not shown.
|
After Width: | Height: | Size: 379 B |
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"t t",
|
||||
"t t"
|
||||
],
|
||||
"key": {
|
||||
"t": "gtamfmd:ruby"
|
||||
},
|
||||
"result": {
|
||||
"id": "gtamfmd:ruby_boots",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"t t",
|
||||
"ttt",
|
||||
"ttt"
|
||||
],
|
||||
"key": {
|
||||
"t": "gtamfmd:ruby"
|
||||
},
|
||||
"result": {
|
||||
"id": "gtamfmd:ruby_chestplate",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"ttt",
|
||||
"t t"
|
||||
],
|
||||
"key": {
|
||||
"t": "gtamfmd:ruby"
|
||||
},
|
||||
"result": {
|
||||
"id": "gtamfmd:ruby_helmet",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"ttt",
|
||||
"t t",
|
||||
"t t"
|
||||
],
|
||||
"key": {
|
||||
"t": "gtamfmd:ruby"
|
||||
},
|
||||
"result": {
|
||||
"id": "gtamfmd:ruby_leggings",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user