Verified Commit 1805b1aa authored by Soren's avatar Soren

Base item textures and recipes

parent 44328092
......@@ -20,17 +20,17 @@ public class Coordinated {
public static CommonProxy proxy;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e){
public void preInit(FMLPreInitializationEvent e) {
proxy.preInit(e);
}
@Mod.EventHandler
public void init(FMLInitializationEvent e){
public void init(FMLInitializationEvent e) {
proxy.init(e);
}
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent e){
public void postInit(FMLPostInitializationEvent e) {
proxy.postInit(e);
}
}
package cynfoxwell.coordinated.core;
import cynfoxwell.coordinated.Coordinated;
import net.minecraft.client.renderer.block.model.ModelBakery;
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.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class ModItemBase extends Item {
public ModItemBase(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"));
}
}
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.client.event.ModelRegistryEvent;
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 {
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");
public static ModItemBase stoneBowl = new ModItemBase("stone_bowl");
@GameRegistry.ObjectHolder("stone_stick")
public static Item stoneStick = new ItemBase("stone_stick");
public static ModItemBase stoneStick = new ModItemBase("stone_stick");
@GameRegistry.ObjectHolder("stone_mortar")
public static Item stoneMortar = new ItemBase("stone_mortar");
public static ModItemBase stoneMortar = new ModItemBase("stone_mortar");
@GameRegistry.ObjectHolder("pearl_dust")
public static Item pearlDust = new ItemBase("pearl_dust");
public static ModItemBase pearlDust = new ModItemBase("pearl_dust");
@GameRegistry.ObjectHolder("pearl_dust_energy")
public static Item pearlDustEnergy = new ItemBase("pearl_dust_energy");
public static ModItemBase pearlDustEnergy = new ModItemBase("pearl_dust_energy");
@GameRegistry.ObjectHolder("pearl_dust_fluid")
public static Item pearlDustFluid = new ItemBase("pearl_dust_fluid");
public static ModItemBase pearlDustFluid = new ModItemBase("pearl_dust_fluid");
@GameRegistry.ObjectHolder("pearl_dust_item")
public static Item pearlDustItem = new ItemBase("pearl_dust_item");
public static ModItemBase pearlDustItem = new ModItemBase("pearl_dust_item");
// Todo Mod Compat
@GameRegistry.ObjectHolder("pearl_dust_fluix")
......@@ -50,7 +33,7 @@ public class ModItems {
@GameRegistry.ObjectHolder("pearl_dust_quartz")
public static Item pearlDustQuartz;
public static Item[] all = new Item[]{
public static ModItemBase[] all = new ModItemBase[]{
stoneBowl,
stoneStick,
stoneMortar,
......@@ -66,7 +49,14 @@ public class ModItems {
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
IForgeRegistry<Item> itemRegistry = event.getRegistry();
itemRegistry.registerAll(ModItems.all);
itemRegistry.registerAll(all);
}
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {
for (ModItemBase mib : all) {
mib.initModel();
}
}
}
......
......@@ -5,4 +5,5 @@ import net.minecraftforge.fml.relauncher.Side;
@Mod.EventBusSubscriber(Side.CLIENT)
public class ClientProxy extends CommonProxy {
}
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "coordinated:items/stone_bowl"
}
}
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "coordinated:items/stone_mortar"
}
}
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "coordinated:items/stone_stick"
}
}
{
"type": "minecraft:crafting_shaped",
"pattern": [
"F F",
" F "
],
"key": {
"F": {
"item": "minecraft:stone",
"data": 32767
}
},
"result": {
"item": "coordinated:stone_bowl",
"count": 4
}
}
\ No newline at end of file
{
"type": "minecraft:crafting_shaped",
"pattern": [
" S",
"F ",
"B "
],
"key": {
"S": {
"item": "coordinated:stone_stick"
},
"F": {
"item": "minecraft:stone",
"data": 32767
},
"B": {
"item": "coordinated:stone_bowl"
}
},
"result": {
"item": "coordinated:stone_mortar"
}
}
\ No newline at end of file
{
"type": "minecraft:crafting_shaped",
"pattern": [
"F",
"F"
],
"key": {
"F": {
"item": "minecraft:stone",
"data": 32767
}
},
"result": {
"item": "coordinated:stone_stick",
"count": 4
}
}
\ No newline at end of file
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