Skip to content

Commit

Permalink
GemItem Class
Browse files Browse the repository at this point in the history
-Moved gems to their own Item class for ease of changing things later
  • Loading branch information
Dariensg committed Aug 8, 2021
1 parent 9a1bc07 commit 06ad9e3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/org/infernalstudios/miningmaster/init/MMItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MiningMaster.MOD_ID);

public static final RegistryObject<Item> FIRE_RUBY = registerItem("fire_ruby", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS)));
public static final RegistryObject<Item> ICE_SAPPHIRE = registerItem("ice_sapphire", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS)));
public static final RegistryObject<Item> SPIRIT_GARNET = registerItem("spirit_garnet", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS)));
public static final RegistryObject<Item> HASTE_PERIDOT = registerItem("haste_peridot", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS)));
public static final RegistryObject<Item> LUCKY_CITRINE = registerItem("lucky_citrine", () -> new Item(new Item.Properties().group(ItemGroup.MATERIALS)));
public static final RegistryObject<Item> FIRE_RUBY = registerItem("fire_ruby", GemItem::new);
public static final RegistryObject<Item> ICE_SAPPHIRE = registerItem("ice_sapphire", GemItem::new);
public static final RegistryObject<Item> SPIRIT_GARNET = registerItem("spirit_garnet", GemItem::new);
public static final RegistryObject<Item> HASTE_PERIDOT = registerItem("haste_peridot", GemItem::new);
public static final RegistryObject<Item> LUCKY_CITRINE = registerItem("lucky_citrine", GemItem::new);


public static void register(IEventBus eventBus) {
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/infernalstudios/miningmaster/items/GemItem.java
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 06ad9e3

Please sign in to comment.