From 06ad9e36dbaced80e3bf3393e69013a0a4fa9707 Mon Sep 17 00:00:00 2001 From: HellionGames Date: Sun, 8 Aug 2021 19:18:40 -0400 Subject: [PATCH] GemItem Class -Moved gems to their own Item class for ease of changing things later --- .../infernalstudios/miningmaster/init/MMItems.java | 12 ++++++------ .../infernalstudios/miningmaster/items/GemItem.java | 11 +++++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 src/main/java/org/infernalstudios/miningmaster/items/GemItem.java diff --git a/src/main/java/org/infernalstudios/miningmaster/init/MMItems.java b/src/main/java/org/infernalstudios/miningmaster/init/MMItems.java index a89b298..4f7a3bb 100644 --- a/src/main/java/org/infernalstudios/miningmaster/init/MMItems.java +++ b/src/main/java/org/infernalstudios/miningmaster/init/MMItems.java @@ -17,23 +17,23 @@ package org.infernalstudios.miningmaster.init; import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.RegistryObject; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import org.infernalstudios.miningmaster.MiningMaster; +import org.infernalstudios.miningmaster.items.GemItem; import java.util.function.Supplier; public class MMItems { public static final DeferredRegister ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MiningMaster.MOD_ID); - public static final RegistryObject FIRE_RUBY = registerItem("fire_ruby", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); - public static final RegistryObject ICE_SAPPHIRE = registerItem("ice_sapphire", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); - public static final RegistryObject SPIRIT_GARNET = registerItem("spirit_garnet", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); - public static final RegistryObject HASTE_PERIDOT = registerItem("haste_peridot", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); - public static final RegistryObject LUCKY_CITRINE = registerItem("lucky_citrine", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS))); + public static final RegistryObject FIRE_RUBY = registerItem("fire_ruby", GemItem::new); + public static final RegistryObject ICE_SAPPHIRE = registerItem("ice_sapphire", GemItem::new); + public static final RegistryObject SPIRIT_GARNET = registerItem("spirit_garnet", GemItem::new); + public static final RegistryObject HASTE_PERIDOT = registerItem("haste_peridot", GemItem::new); + public static final RegistryObject LUCKY_CITRINE = registerItem("lucky_citrine", GemItem::new); public static void register(IEventBus eventBus) { diff --git a/src/main/java/org/infernalstudios/miningmaster/items/GemItem.java b/src/main/java/org/infernalstudios/miningmaster/items/GemItem.java new file mode 100644 index 0000000..124847d --- /dev/null +++ b/src/main/java/org/infernalstudios/miningmaster/items/GemItem.java @@ -0,0 +1,11 @@ +package org.infernalstudios.miningmaster.items; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemGroup; +import net.minecraft.item.ItemStack; + +public class GemItem extends Item { + public GemItem() { + super(new Item.Properties().group(ItemGroup.MATERIALS)); + } +}