Jump to content

Recommended Posts

Posted

All the code functions fine, apart from when the codes around my ore block are added.

Main class path = C:\Users\User\Desktop\MC MODDING EQUIPMENT\Mods\Forge 1.6.4\Odeyessues's oddity mod 1.6.4\mcp\src\minecraft\b\OOMOD\OOmain.Java

 

Block Class file =C:\Users\User\Desktop\MC MODDING EQUIPMENT\Mods\Forge 1.6.4\Odeyessues's oddity mod 1.6.4\mcp\src\minecraft\b\OOMOD\ore\CBore.java

 

Main Code

package b.OOMOD;

import b.OOMOD.Weapons.weaponCBdagger;
import b.OOMOD.Weapons.weaponCBhammer;
import b.OOMOD.Weapons.weaponCBsword;
import b.OOMOD.Weapons.weaponIGknife;
import b.OOMOD.Weapons.weaponIGknife;
import b.OOMOD.Weapons.weaponIGsword;
import b.OOMOD.Weapons.weaponSIaxe;
import b.OOMOD.Weapons.weaponSIdagger;
import b.OOMOD.Weapons.weaponSIsword;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import b.OOMOD.Ingots.*;
import b.OOMOD.ore.CBore;



//mod info
@Mod(modid = "OOMOD", name = "Odysessues' Oddity", version = "1.0.0")
//client server 
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class OOmain{
//Weapon defining
public static Item CBsword;
public static Item CBdagger;
public static Item CBhammer;
public static Item SIsword;
public static Item SIdagger;
public static Item SIaxe;
public static Item IGsword;
public static Item IGknife;

//define weapon material
public static EnumToolMaterial SWORD = EnumHelper.addToolMaterial("SWORD", 0, 2134, 8.0F, 11.0F, 10);
public static EnumToolMaterial DAGGER = EnumHelper.addToolMaterial("DAGGER", 0, 2134, 8.0F, 5.0F, 10);
public static EnumToolMaterial HAMMER = EnumHelper.addToolMaterial("HAMMER", 0, 2134, 8.0F, 15.0F, 10);


//Ingot Defining
public static Item CBingot;
public static Item SIingot;
public static Item IGingot;

//Ore Defining
public static Block CBore;



//event handler
@EventHandler
public void Load(FMLPreInitializationEvent Event){

	//Weapon Settings
	CBsword = new weaponCBsword(5000, SWORD).setUnlocalizedName("OOmod:CBsword ");
	CBdagger = new weaponCBdagger(5001, DAGGER).setUnlocalizedName("OOmod:CBdagger ");
	CBhammer = new weaponCBhammer(5002, HAMMER).setUnlocalizedName("OOmod:CBhammer ");
	SIsword = new weaponSIsword(5003, SWORD).setUnlocalizedName("OOmod:SIsword ");
	SIdagger = new weaponSIdagger(5004, DAGGER).setUnlocalizedName("OOmod:SIdagger ");
	SIaxe = new weaponSIaxe(5005, HAMMER).setUnlocalizedName("OOmod:SIaxe ");
	IGsword = new weaponIGsword(5006, SWORD).setUnlocalizedName("OOmod:IGsword ");
	IGknife = new weaponIGknife(5007, DAGGER).setUnlocalizedName("OOmod:IGdagger ");

	//ingot setting
	CBingot = new CBingot(5008).setUnlocalizedName("OOmod:CBingot");
	SIingot = new SIingot(5009).setUnlocalizedName("OOmod:SIingot");
	IGingot = new IGingot(5010).setUnlocalizedName("OOmod:IGingot");

	//ore settings
	CBore = new b.OOMOD.ore.CBore(5011, Material.rock).setUnlocalizedName("OOmod:CBore");


	//Weapon Game Register
	GameRegistry.registerItem(CBsword, "CBsword");
	GameRegistry.registerItem(CBdagger, "CBdagger");
	GameRegistry.registerItem(CBhammer, "CBhammer");
	GameRegistry.registerItem(SIsword, "SIsword");
	GameRegistry.registerItem(SIdagger, "SIdagger");
	GameRegistry.registerItem(SIaxe, "SIaxe");
	GameRegistry.registerItem(IGsword, "IGsword");
	GameRegistry.registerItem(IGknife, "IGknife");

	//Ingot Game Register
	GameRegistry.registerItem(CBingot, "CBingot");
	GameRegistry.registerItem(SIingot, "SIingot");
	GameRegistry.registerItem(IGingot, "IGingot");

	//Ore Game Register
	GameRegistry.registerBlock(CBore, "CBore");




	//Weapon Language Register
	LanguageRegistry.addName(CBsword, "Celestial Bronze Sword");
	LanguageRegistry.addName(CBdagger, "Celestial Bronze Dagger");
	LanguageRegistry.addName(CBhammer, "Celestial Bronze Hammer");
	LanguageRegistry.addName(SIsword, "Stygian Iron Sword");
	LanguageRegistry.addName(SIdagger, "Stygian Iron Dagger");
	LanguageRegistry.addName(SIaxe, "Stygian Iron Axe");
	LanguageRegistry.addName(IGsword, "Imperial Gold Sword");
	LanguageRegistry.addName(IGknife, "Imperial Gold Dagger");

	//Ingot Language Register
	LanguageRegistry.addName(CBingot, "Celestial Bronze Ingot");
	LanguageRegistry.addName(SIingot, "Stygian Iron Ingot");
	LanguageRegistry.addName(IGingot, "Imperial Gold Ingot");

	//Ore Language Register
	LanguageRegistry.addName(CBore, "Celestial Bronze Ore");


	//weapon recipes
	GameRegistry.addRecipe(new ItemStack(CBsword), new Object[] {" C "," C "," S ", 'C', CBingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(CBdagger), new Object[] {"   "," C "," S ", 'C', CBingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(CBhammer), new Object[] {"CCC"," S "," S ", 'C', CBingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(SIsword), new Object[] {" I "," I "," S ", 'I', SIingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(SIdagger), new Object[] {"   "," I "," S ", 'I', SIingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(SIaxe), new Object[] {"III"," S "," S ", 'I', SIingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(IGsword), new Object[] {" G "," G "," S ", 'G', IGingot, 'S', Item.stick});
	GameRegistry.addRecipe(new ItemStack(IGknife), new Object[] {"   "," G "," S ", 'G', IGingot, 'S', Item.stick});

}}


 

 

Block Code

package b.OOMOD.ore;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;


public class CBore extends Block{

public CBore(int par1, Material par2Material) {
	super(par1, par2Material);
	this.setCreativeTab(CreativeTabs.tabBlock);
	this.setHardness(10.0F);
	this.setResistance(10.0F);
	this.setLightValue(0.5F);}




	@SideOnly(Side.CLIENT)
	public void registerIcons(IconRegister par1IconRegister){
	this.blockIcon = par1IconRegister.registerIcon("OOmod:CBore");
}

}

 

Console Output

 

  Reveal hidden contents

 

 

Posted
  Quote
java.lang.ArrayIndexOutOfBoundsException: 5011

  at net.minecraft.block.Block.<init>(Block.java:347)

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

public static final Block[] blocksList = new Block[4096];

That means you can only have block ids from 0-4095

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted
  On 1/20/2014 at 7:34 PM, majesticmadman98 said:

ah ok, thanks a lot.  :) is there an actual reason why block ids have a smaller range than item ids?

 

Yes.  Because all blocks are items.  Ergo there needs to be more slots for items than for blocks.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.