20
src/main/java/de/jottyfan/minecraft/item/Food.java
Normal file
20
src/main/java/de/jottyfan/minecraft/item/Food.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package de.jottyfan.minecraft.item;
|
||||
|
||||
import net.minecraft.component.type.FoodComponent;
|
||||
|
||||
public enum Food {
|
||||
GINGERBREAD(new FoodComponent.Builder()
|
||||
.nutrition(1).saturationModifier(0.1f)
|
||||
.build());
|
||||
|
||||
private final FoodComponent component;
|
||||
|
||||
private Food(FoodComponent component) {
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
public FoodComponent get() {
|
||||
return component;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,9 @@ public class ModItems {
|
||||
|
||||
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()));
|
||||
|
||||
private static Item registerStubItem(Identifier identifier, Settings settings) {
|
||||
return Registry.register(Registries.ITEM, identifier, new StubItem(
|
||||
@@ -38,6 +41,7 @@ public class ModItems {
|
||||
.register(entries -> {
|
||||
entries.add(STUB);
|
||||
entries.add(RUBY);
|
||||
entries.add(GINGERBREAD);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
6
src/main/resources/assets/gtamfmd/items/gingerbread.json
Normal file
6
src/main/resources/assets/gtamfmd/items/gingerbread.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "gtamfmd:item/gingerbread"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"item.gtamfmd.gingerbread": "Lebkuchen",
|
||||
"item.gtamfmd.stub": "Stummel",
|
||||
"item.gtamfmd.ruby": "Rubin",
|
||||
"item.gtamfmd.ruby_block": "Rubinblock",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"item.gtamfmd.gingerbread": "Gingerbread",
|
||||
"item.gtamfmd.stub": "Stub",
|
||||
"item.gtamfmd.ruby": "Ruby",
|
||||
"item.gtamfmd.ruby_block": "Ruby block",
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"parent": "minecraft:item/generated",
|
||||
"textures": {
|
||||
"layer0": "gtamfmd:item/gingerbread"
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/gtamfmd/textures/item/gingerbread.png
Normal file
BIN
src/main/resources/assets/gtamfmd/textures/item/gingerbread.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"# #",
|
||||
"###",
|
||||
" # "
|
||||
],
|
||||
"key": {
|
||||
"#": "minecraft:wheat"
|
||||
},
|
||||
"result": {
|
||||
"id": "gtamfmd:gingerbread",
|
||||
"count": 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user