Jump to content

Recommended Posts

Posted

I'm a bit new to coding with Minecraft Forge and want to add a shapeless crafting recipe for grass using vines and dirt, and the grass isn't appearing when I put a vine and dirt in, and my code isn't giving any errors telling what's wrong, so what IS wrong?

 

package com.budboy.betterfishing;

 

import com.budboy.betterfishing.Proxy.ProxyCommon;

 

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

 

@Mod(modid = BetterFishing.MODID, version = BetterFishing.VERSION, name =BetterFishing.MOD_NAME)

public class BetterFishing

public static final String MOD_NAME = "Better Fishing";

    public static final String MODID = "BF";

    public static final String VERSION = "0.0.1";

   

    @Instance(value = MODID)

    public static BetterFishing instance;

   

    @SidedProxy(clientSide = "com.budboy.betterfishing.Proxy.ProxyClient", serverSide = "com.budboy.betterfishing.proxy.proxyCommon")

    public static ProxyCommon proxy;

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

    GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass), Blocks.vine, 1, Blocks.dirt, 1);

    }

  @EventHandler

public void load(FMLInitializationEvent event){

proxy.registerRenderers();

    {

    }

}

}

 

Proxy Common Code:

 

package com.budboy.betterfishing.Proxy;

 

public class ProxyCommon {

public void registerRenderers(){

}

}

 

Proxy Client Code:

 

package com.budboy.betterfishing.Proxy;

 

public class ProxyClient extends ProxyCommon {

@Override

public void registerRenderers(){

 

}

 

}

Posted

Still didn't work, here's new code:

 

package com.budboy.betterfishing;

 

import com.budboy.betterfishing.Proxy.ProxyCommon;

 

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.EventHandler;

import cpw.mods.fml.common.Mod.Instance;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.registry.GameRegistry;

 

@Mod(modid = BetterFishing.MODID, version = BetterFishing.VERSION, name =BetterFishing.MOD_NAME)

public class BetterFishing

public static final String MOD_NAME = "Better Fishing";

    public static final String MODID = "BF";

    public static final String VERSION = "0.0.1";

   

    @Instance(value = MODID)

    public static BetterFishing instance;

   

    @SidedProxy(clientSide = "com.budboy.betterfishing.Proxy.ProxyClient", serverSide = "com.budboy.betterfishing.proxy.proxyCommon")

    public static ProxyCommon proxy;

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

    GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass), Blocks.vine, Blocks.dirt);

    }

  @EventHandler

public void load(FMLInitializationEvent event){

proxy.registerRenderers();

    {

    }

}

}

 

Posted

I got it working! Just had to rewrite my code a bit. :)

 

package com.budboy.betterfishing;

 

import com.budboy.betterfishing.Proxy.ProxyCommon;

 

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.*;

import cpw.mods.fml.common.Mod.*;

import cpw.mods.fml.common.event.*;

import cpw.mods.fml.common.registry.*;

 

@Mod(modid = BetterFishing.MODID, version = BetterFishing.VERSION)

public class BetterFishing

{

    public static final String MODID = "tutorial";

    public static final String VERSION = "1.0";

   

    @Instance(value=MODID)

    public static BetterFishing instance;

   

    @SidedProxy(clientSide = "com.budboy.betterfishing.Proxy.ProxyClient", serverSide = "com.budboy.betterfishing.Proxy.ProxyCommon")

    public static ProxyCommon proxy;

   

    @EventHandler

        public void preInit(FMLPreInitializationEvent event)

        {

    GameRegistry.addRecipe(new ItemStack(Blocks.obsidian), new Object[]{

        "AAA",

        "AAA",

        "AAA",

        'A', Items.cookie

        });

        }

        public void load(FMLPreInitializationEvent event)

        {

    }

    @EventHandler

    public void init(FMLInitializationEvent event)

    {

    }

    public void load(FMLInitializationEvent event)

    {

    proxy.registerRenderers();

    {

    }

        }

    @EventHandler

    public void postInit(FMLPostInitializationEvent event)

    {

    }

}

 

Thanks everyone for your help to this modding newb.

Posted

package com.budboy.betterfishing;

 

import com.budboy.betterfishing.Proxy.ProxyCommon;

 

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.ItemStack;

import cpw.mods.fml.common.*;

import cpw.mods.fml.common.Mod.*;

import cpw.mods.fml.common.event.*;

import cpw.mods.fml.common.registry.*;

 

@Mod(modid = BetterFishing.MODID, version = BetterFishing.VERSION, name = BetterFishing.NAME)

public class BetterFishing {

 

public static final String MODID = "betterFishing", VERSION = "1.0", NAME = "Better Fishing";

 

@Instance(MODID)

public static BetterFishing instance;

 

@SidedProxy(clientSide = "com.budboy.betterfishing.Proxy.ProxyClient", serverSide = "com.budboy.betterfishing.Proxy.ProxyCommon")

public static ProxyCommon proxy;

 

@EventHandler

public void preInit(FMLPreInitializationEvent event)  { 

proxy.registerRenderers();

addRecipes();

}

 

@EventHandler

public void init(FMLInitializationEvent event){ }

 

@EventHandler

public void postInit(FMLPostInitializationEvent event) { }

 

public void addRecipes(){

GameRegistry.addRecipe(new ItemStack(Blocks.obsidian), new Object[]{"AAA", "AAA", "AAA", 'A', Items.cookie});

}

}

Former developer for DivineRPG, Pixelmon and now the maker of Essence of the Gods

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.