diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2023-07-02 01:32:49 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2023-07-02 01:32:49 -0300 |
commit | 12048dc1a1cf01f8a0f37ced83af78b57a35b4cd (patch) | |
tree | ec521c2f2f4694ffa35012518fcec9c7b1fca002 /src/main/java/ganarchy/chewstuff/ChewStuff.java | |
parent | e9fda053b04038c772d7fc0010f6c10557e0d83e (diff) |
Diffstat (limited to 'src/main/java/ganarchy/chewstuff/ChewStuff.java')
-rw-r--r-- | src/main/java/ganarchy/chewstuff/ChewStuff.java | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/main/java/ganarchy/chewstuff/ChewStuff.java b/src/main/java/ganarchy/chewstuff/ChewStuff.java index 7bea0ec..ee035f3 100644 --- a/src/main/java/ganarchy/chewstuff/ChewStuff.java +++ b/src/main/java/ganarchy/chewstuff/ChewStuff.java @@ -1,10 +1,12 @@ package ganarchy.chewstuff; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemGroups; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,7 +24,7 @@ public class ChewStuff implements ModInitializer { * chews. */ public static final Item SILICONE = new Item( - new Item.Settings().group(ItemGroup.MISC) + new Item.Settings() ); /** * 1 day, in ticks. @@ -33,27 +35,21 @@ public class ChewStuff implements ModInitializer { */ public static final Item SOFT_CHEW = new ChewableItem( 1, - new Item.Settings().maxDamage(5 * DAY_MULTIPLIER).group(ItemGroup.TOOLS) + new Item.Settings().maxDamage(5 * DAY_MULTIPLIER) ); /** * Medium chew. Lasts 6 days, 2 effect slots. */ public static final Item MEDIUM_CHEW = new ChewableItem( 2, - new Item.Settings().maxDamage(6 * DAY_MULTIPLIER).group(ItemGroup.TOOLS) + new Item.Settings().maxDamage(6 * DAY_MULTIPLIER) ); /** * Hard chew. Lasts 7 days, 3 effect slots. */ public static final Item HARD_CHEW = new ChewableItem( 3, - new Item.Settings().maxDamage(7 * DAY_MULTIPLIER).group(ItemGroup.TOOLS) - ); - /** - * The stat for chew effects. - */ - public static final Identifier CHEW_EFFECTS = new Identifier( - "chewstuff", "effects" + new Item.Settings().maxDamage(7 * DAY_MULTIPLIER) ); @Override @@ -65,26 +61,32 @@ public class ChewStuff implements ModInitializer { LOGGER.info("This software is made with love by a queer trans person."); Registry.register( - Registry.ITEM, + Registries.ITEM, new Identifier("chewstuff", "silicone"), SILICONE ); Registry.register( - Registry.ITEM, + Registries.ITEM, new Identifier("chewstuff", "soft_chew"), SOFT_CHEW ); Registry.register( - Registry.ITEM, + Registries.ITEM, new Identifier("chewstuff", "medium_chew"), MEDIUM_CHEW ); Registry.register( - Registry.ITEM, + Registries.ITEM, new Identifier("chewstuff", "hard_chew"), HARD_CHEW ); -// Registry.register(Registry.CUSTOM_STAT, CHEW_EFFECTS, CHEW_EFFECTS); -// Stats.CUSTOM.getOrCreateStat(CHEW_EFFECTS, StatFormatter.DEFAULT); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(content -> { + content.add(SOFT_CHEW); + content.add(MEDIUM_CHEW); + content.add(HARD_CHEW); + }); + ItemGroupEvents.modifyEntriesEvent(ItemGroups.INGREDIENTS).register(content -> { + content.add(SILICONE); + }); } } |