Jump to content

Recommended Posts

Posted

I did a piece of code yesterday that worked fine , but I open up Eclipse again and it does not seem to work , so could someone hep me with this ?

 

Here are my codes :

 

Main Mod Class : InfinityBow.java

 

 

package traxys.infbow;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.item.Item;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.MinecraftForge;

import traxys.infbow.lib.GenBlock;

import traxys.infbow.lib.GenItem;

import traxys.infbow.lib.Reference;

import traxys.infbow.proxy.CommonProxy;

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.event.FMLPostInitializationEvent;

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

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

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

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@Mod(modid= Reference.MOD_ID, name= Reference.MOD_NAME, version = Reference.VERSION)

public class InfinityBow {

 

public final static Item fletching = new GenItem(10048);

 

ItemStack obsidianStack = new ItemStack(Block.obsidian);

ItemStack ironStack = new ItemStack(Item.ingotIron);

ItemStack diamondStack = new ItemStack(Item.diamond);

 

@Instance(Reference.MOD_ID)

public static InfinityBow instance;

 

@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)

public static CommonProxy proxy;

 

@EventHandler

public void preInit(FMLPreInitializationEvent event){

 

}

 

@EventHandler

public void init(FMLInitializationEvent event){

LanguageRegistry.addName(hardWall, "Hard Wall"); //Here are the crash , He can't link the hardWall here from the one in HardWall.java

MinecraftForge.setBlockHarvestLevel(hardWall, "pickaxe", 2);

GameRegistry.registerBlock(hardWall, "Hard Wall");

GameRegistry.addRecipe(new ItemStack(InfinityBow.hardWall, 32), "xxx","yyy","xzx",

'x', obsidianStack,'y',ironStack,'z',diamondStack);

}

@EventHandler

public void postInit(FMLPostInitializationEvent event){

 

}

 

}

 

 

HardWall.java

 

 

package traxys.infbow.block;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import traxys.infbow.lib.GenBlock;

 

public class HardWall{

public final static Block hardWall = new GenBlock(1048, Material.rock) 

.setHardness(55.0F).setResistance(2050.0F).setStepSound(Block.soundStoneFootstep)

.setUnlocalizedName("hardWall").setCreativeTab(CreativeTabs.tabBlock)

.setTextureName("infbow:hardWall");

}

 

 

 

GenBlock.java(just a class to be called for making all blocks I want)

 

 

package traxys.infbow.lib;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

 

public class GenBlock extends Block {

 

public GenBlock(int par1, Material par2Material) {

super(par1, par2Material);

}

}

 

 

 

Please can someone can help me :)

I am just starting at moding , so I don't know much ....

Posted

try changing

 

  LanguageRegistry.addName(hardWall, "Hard Wall");

 

to

 

  LanguageRegistry.addName(HardWall, "Hard Wall");

Actually i don't know what to write in this signature soooo.... anyway

Posted

I resolved my problem , I did lot's of changes in my code , and splited many things , but i think my problem was taht I did not call properly the class

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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