Verified Commit 5a803b3e authored by Soren's avatar Soren

Basic framework for items

parent 3e6ccffc
package cynfoxwell.coordinated.core;
public class ModBlocks {
}
package cynfoxwell.coordinated.core;
import cynfoxwell.coordinated.Coordinated;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.registries.IForgeRegistry;
@GameRegistry.ObjectHolder(Coordinated.MODID)
public class ModItems {
@GameRegistry.ObjectHolder(Coordinated.MODID + ":stone_bowl")
public static Item stoneBowl;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":stone_stick")
public static Item stoneStick;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":stone_mortar")
public static Item stoneMortar;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust")
public static Item pearlDust;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_iron")
public static Item pearlIron;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust_energy")
public static Item pearlDustEnergy;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust_fluid")
public static Item pearlDustFluid;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust_item")
public static Item pearlDustItem;
//Mod Compat
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust_fluix")
private static class ItemBase extends Item {
public ItemBase(String name) {
setCreativeTab(ModTab.get());
setRegistryName(new ResourceLocation(Coordinated.MODID, name));
setUnlocalizedName(Coordinated.MODID + "." + name);
}
@SideOnly(Side.CLIENT)
public void initModel() {
ModelLoader.setCustomModelResourceLocation(this, 0, new ModelResourceLocation(getRegistryName(), "inventory"));
}
}
@GameRegistry.ObjectHolder("stone_bowl")
public static Item stoneBowl = new ItemBase("stone_bowl");
@GameRegistry.ObjectHolder("stone_stick")
public static Item stoneStick = new ItemBase("stone_stick");
@GameRegistry.ObjectHolder("stone_mortar")
public static Item stoneMortar = new ItemBase("stone_mortar");
@GameRegistry.ObjectHolder("pearl_dust")
public static Item pearlDust = new ItemBase("pearl_dust");
@GameRegistry.ObjectHolder("pearl_dust_energy")
public static Item pearlDustEnergy = new ItemBase("pearl_dust_energy");
@GameRegistry.ObjectHolder("pearl_dust_fluid")
public static Item pearlDustFluid = new ItemBase("pearl_dust_fluid");
@GameRegistry.ObjectHolder("pearl_dust_item")
public static Item pearlDustItem = new ItemBase("pearl_dust_item");
// Todo Mod Compat
@GameRegistry.ObjectHolder("pearl_dust_fluix")
public static Item pearlDustFluix;
@GameRegistry.ObjectHolder(Coordinated.MODID + ":pearl_dust_quartz")
@GameRegistry.ObjectHolder("pearl_dust_quartz")
public static Item pearlDustQuartz;
public static Item[] all = new Item[]{
stoneBowl,
stoneStick,
stoneMortar,
pearlDust,
pearlDustEnergy,
pearlDustFluid,
pearlDustItem
};
@Mod.EventBusSubscriber(modid = Coordinated.MODID)
public static class Registration {
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
IForgeRegistry<Item> itemRegistry = event.getRegistry();
itemRegistry.registerAll(ModItems.all);
}
}
}
......@@ -5,9 +5,17 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
public class CreativeTab extends CreativeTabs {
public class ModTab extends CreativeTabs {
public CreativeTab(){
private static class Loader {
public static final ModTab INSTANCE = new ModTab();
}
public static ModTab get() {
return Loader.INSTANCE;
}
private ModTab() {
super(Coordinated.MODID);
}
......@@ -15,4 +23,5 @@ public class CreativeTab extends CreativeTabs {
public ItemStack getTabIconItem() {
return new ItemStack(Items.ENDER_PEARL);
}
}
\ No newline at end of file
}
item.coordinated.stone_bowl.name=Stone Bowl
item.coordinated.stone_stick.name=Stone Stick
item.coordinated.stone_mortar.name=Stone Mortar
item.coordinated.pearl_dust.name=Pearl Dust
item.coordinated.pearl_dust_item.name=Itemized Pearl Dust
item.coordinated.pearl_dust_fluid.name=Liquidated Pearl Dust
item.coordinated.pearl_dust_energy.name=Energetic Pearl Dust
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment