Updated code and dependencies for minecraft 1.21.3
This commit is contained in:
parent
c97416d113
commit
5df8395298
6 changed files with 15 additions and 29 deletions
|
@ -2,22 +2,21 @@ package net.chaoticbyte.hardboiled;
|
|||
|
||||
import net.minecraft.component.type.FoodComponent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.registry.RegistryKey;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class HardBoiledItems {
|
||||
// default food component
|
||||
public static final FoodComponent foodComponent = new FoodComponent.Builder()
|
||||
.nutrition(3)
|
||||
.snack()
|
||||
.build();
|
||||
// register item
|
||||
public static Item register(String id) {
|
||||
final RegistryKey<Item> regKey = RegistryKey.of(RegistryKeys.ITEM, Identifier.of(HardBoiled.MOD_ID, id));
|
||||
Item.Settings settings = new Item.Settings().food(foodComponent);
|
||||
Identifier itemId = Identifier.of(HardBoiled.MOD_ID, id);
|
||||
Item item = new Item(settings);
|
||||
return Registry.register(Registries.ITEM, itemId, item);
|
||||
return Items.register(regKey, Item::new, settings);
|
||||
}
|
||||
// dummy init method
|
||||
public static void init() {}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"type": "minecraft:campfire_cooking",
|
||||
"ingredient": {
|
||||
"item": "minecraft:egg"
|
||||
},
|
||||
"ingredient": "minecraft:egg",
|
||||
"result": {
|
||||
"id": "hardboiled:hardboiled_egg"
|
||||
},
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"type": "minecraft:smelting",
|
||||
"ingredient": {
|
||||
"item": "minecraft:egg"
|
||||
},
|
||||
"ingredient": "minecraft:egg",
|
||||
"result": {
|
||||
"id": "hardboiled:hardboiled_egg"
|
||||
},
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
},
|
||||
"mixins": [],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.16.5",
|
||||
"minecraft": "~1.21.1",
|
||||
"fabricloader": ">=0.16.9",
|
||||
"minecraft": "1.21.3",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*"
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue