Jump to content

SandStoneItems crash


tminor1

Recommended Posts

So I have all the items and the textures and the crafting all working. So I then exported the code to a jar file I then put it in the mods folder and tried to run minecraft. (Because now that the mod is done I need to see if it will work with the real minecraft outside of eclipse.) But when I run it the game crashes and tells me java.lang.NoSuchMethodError: net.SandItems.mod.items.SandPickaxe.getCreativeTab()Lnet/minecraft/creativetab/CreativeTabs;.

Here is the code for SandPickaxe.java.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemPickaxe;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandPickaxe extends ItemPickaxe {

 

public SandPickaxe(ToolMaterial p_i45347_1_) {

super(p_i45347_1_);

this.setCreativeTab(getCreativeTab().tabTools);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

So I first tried to import the net.minecraft.creativetab.CreativeTabs but it still gave me the same message. Then I tried changing  this.setCreativeTab(getCreativeTab().tabTools); to  this.setCreativeTab(CreativeTabs.tabTools); but Then it just gave me a crash again. What am I doing wrong?

Link to comment
Share on other sites

Hey I don't know if this helps but in eclipse I clicked the button to run the sever and it gave me the same message.

 

[EDIT] never mind about this I changed  (getCreativeTab().tabTools) back to (CreativeTabs.tabTools); and every thing in the eclipse development sever and client but it is still giving me problems when I make my mod in to a jar file and run it with the real minecraft. Would it help if I post the crash report? also I am working on a different mod as well and it is giving me problems too.

Link to comment
Share on other sites

It says. Build failed with an eception. * What went wrong: A problem occured configuring root project 'SandItems'. com.google.gson.stream.MalformedJsonException: Unterminated string at line 3485 column 49.

 

I am working on a mod pack so I have two mods. This is the code for both the mods.

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

package net.SandItems.mod;

 

import net.SandItems.mod.items.SandAxe;

import net.SandItems.mod.items.SandHoe;

import net.SandItems.mod.items.SandPickaxe;

import net.SandItems.mod.items.SandShovel;

import net.SandItems.mod.items.SandSword;

import net.minecraft.init.Blocks;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.common.Mod;

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

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;

 

 

@Mod(modid = SandItems.modid, version = SandItems.version, name = SandItems.name)

public class SandItems {

 

public static final String modid = "sandItems";

public static final String version = "v1.0";

public static final String name = "SandStoneItems";

 

public static ToolMaterial Sandy = EnumHelper.addToolMaterial("Sandy", 1, 125, 4.0F, 1.0F, 10);

 

public static Item itemSandPickaxe;

 

public static Item itemSandSword;

 

public static Item itemSandShovel;

 

public static Item itemSandAxe;

 

public static Item itemSandHoe;

 

 

@EventHandler

public void PreInit(FMLPreInitializationEvent preEvent){

 

itemSandPickaxe = new SandPickaxe(Sandy).setUnlocalizedName("SandPick");

 

itemSandSword = new SandSword(Sandy).setUnlocalizedName("SandSword");

 

itemSandShovel = new SandShovel(Sandy).setUnlocalizedName("SandShovel");

 

itemSandAxe = new SandAxe(Sandy).setUnlocalizedName("SandAxe");

 

itemSandHoe = new SandHoe(Sandy).setUnlocalizedName("SandHoe");

 

GameRegistry.registerItem(itemSandPickaxe, "SandPickaxe");

GameRegistry.registerItem(itemSandSword, "SandSword");

GameRegistry.registerItem(itemSandShovel, "SandShovel");

GameRegistry.registerItem(itemSandAxe, "SandAxe");

GameRegistry.registerItem(itemSandHoe, "SandHoe");

 

}

 

@EventHandler

public void Init(FMLInitializationEvent event){

 

GameRegistry.addRecipe(new ItemStack(itemSandPickaxe), new Object[]{"ccc", " x ", " x ", 'x', Items.stick, 'c',new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)});

GameRegistry.addRecipe(new ItemStack(itemSandSword), new Object[]{" c ", " c ", " x ", 'x', Items.stick, 'c',new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)});

GameRegistry.addRecipe(new ItemStack(itemSandShovel), new Object[]{" c ", " x ", " x ", 'x', Items.stick, 'c',new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)});

GameRegistry.addRecipe(new ItemStack(itemSandAxe), new Object[]{"cc ", "cx ", " x ", 'x', Items.stick, 'c',new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)});

GameRegistry.addRecipe(new ItemStack(itemSandHoe), new Object[]{"cc ", " x ", " x ", 'x', Items.stick, 'c',new ItemStack(Blocks.sandstone, 1, OreDictionary.WILDCARD_VALUE)});

 

}

 

@EventHandler

public void PostInit(FMLPostInitializationEvent PostEvent){

 

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemAxe;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandAxe extends ItemAxe {

 

public SandAxe(ToolMaterial p_i45327_1_) {

super(p_i45327_1_);

this.setCreativeTab(CreativeTabs.tabTools);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemHoe;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandHoe extends ItemHoe {

 

public SandHoe(ToolMaterial p_i45343_1_) {

super(p_i45343_1_);

this.setCreativeTab(CreativeTabs.tabTools);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemPickaxe;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandPickaxe extends ItemPickaxe {

 

public SandPickaxe(ToolMaterial p_i45347_1_) {

super(p_i45347_1_);

this.setCreativeTab(CreativeTabs.tabTools);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemSpade;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandShovel extends ItemSpade {

 

public SandShovel(ToolMaterial p_i45353_1_) {

super(p_i45353_1_);

this.setCreativeTab(CreativeTabs.tabTools);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.SandItems.mod.items;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

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

import net.minecraft.item.ItemSword;

import net.minecraft.creativetab.CreativeTabs;

 

public class SandSword extends ItemSword {

 

public SandSword(ToolMaterial p_i45356_1_) {

super(p_i45356_1_);

this.setCreativeTab(CreativeTabs.tabCombat);

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IIconRegister iconRegister) {

this.itemIcon = iconRegister.registerIcon(SandItems.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.classicBlocks.mod;

 

 

import net.classicBlocks.mod.blocks.ClassicBrick;

import net.classicBlocks.mod.blocks.ClassicCobble;

import net.classicBlocks.mod.blocks.ClassicMossy;

import net.minecraft.init.Blocks;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.init.Items;

import net.minecraft.item.Item;

import net.minecraft.item.Item.ToolMaterial;

import net.minecraft.item.ItemStack;

import net.minecraftforge.common.util.EnumHelper;

import net.minecraftforge.oredict.OreDictionary;

import cpw.mods.fml.common.Mod;

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

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;

 

 

@Mod(modid = classicBlock.modid, version = classicBlock.version, name = classicBlock.name)

public class classicBlock {

 

public static final String modid = "classicBlocks";

public static final String version = "v1.0";

public static final String name = "ClassicBlocks";

 

public static Block blockClassicBrick;

public static Block blockClassicCobble;

public static Block blockClassicMossy;

 

 

 

 

 

@EventHandler

public void PreInit(FMLPreInitializationEvent preEvent){

 

blockClassicBrick = new ClassicBrick(Material.rock).setBlockName("classicBrick");

blockClassicCobble = new ClassicCobble(Material.rock).setBlockName("ClassicStoneCobble");

blockClassicMossy = new ClassicMossy(Material.rock).setBlockName("ClassicStoneMossy");

 

GameRegistry.registerBlock(blockClassicBrick, "ClassicBrick");

GameRegistry.registerBlock(blockClassicCobble, "ClassicCobbleStone");

GameRegistry.registerBlock(blockClassicMossy, "ClassicMossyStone");

 

 

 

}

 

@EventHandler

public void Init(FMLInitializationEvent event){

 

GameRegistry.addShapelessRecipe(new ItemStack(blockClassicBrick), Blocks.brick_block);

GameRegistry.addShapelessRecipe(new ItemStack(blockClassicCobble), Blocks.cobblestone);

GameRegistry.addShapelessRecipe(new ItemStack(blockClassicMossy), Blocks.mossy_cobblestone);

 

}

 

@EventHandler

public void PostInit(FMLPostInitializationEvent PostEvent){

 

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.classicBlocks.mod.blocks;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.SandItems.mod.SandItems;

import net.classicBlocks.mod.classicBlock;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

 

public class ClassicBrick extends Block {

 

public ClassicBrick(Material material) {

super(material);

 

this.setHardness(2.0F);

this.setResistance(10.0F);

this.setStepSound(soundTypePiston);

this.setCreativeTab(CreativeTabs.tabBlock);

 

 

}

 

@SideOnly(Side.CLIENT)

public void registerBlockIcons(IIconRegister iconRegister){

this.blockIcon = iconRegister.registerIcon(classicBlock.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.classicBlocks.mod.blocks;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.classicBlocks.mod.classicBlock;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

 

public class ClassicCobble extends Block {

 

public ClassicCobble(Material material) {

super(material);

 

this.setHardness(2.0F);

this.setResistance(10.0F);

this.setStepSound(soundTypePiston);

this.setCreativeTab(CreativeTabs.tabBlock);

 

 

}

 

@SideOnly(Side.CLIENT)

public void registerBlockIcons(IIconRegister iconRegister){

this.blockIcon = iconRegister.registerIcon(classicBlock.modid + ":" + this.getUnlocalizedName().substring(5));

}

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

}

 

package net.classicBlocks.mod.blocks;

 

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

import net.classicBlocks.mod.classicBlock;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

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

import net.minecraft.creativetab.CreativeTabs;

 

public class ClassicMossy extends Block {

 

public ClassicMossy(Material material) {

super(material);

 

this.setHardness(2.0F);

this.setResistance(10.0F);

this.setStepSound(soundTypePiston);

this.setCreativeTab(CreativeTabs.tabBlock);

 

 

}

 

@SideOnly(Side.CLIENT)

public void registerBlockIcons(IIconRegister iconRegister){

this.blockIcon = iconRegister.registerIcon(classicBlock.modid + ":" + this.getUnlocalizedName().substring(5));

 

}

 

 

}

Link to comment
Share on other sites

Ok but if I should not put 2 mods in one workspace then what should I do? If I have to create a new workspace for every mod then I will have to go through the gradlew setupDecompWorkspace for every mod I want to make and my computer will be workspaces every where. but could this be the problem?

Link to comment
Share on other sites

Hey so I don't think it has any thing to do with my code at all. You see I wanted to see if it would work so I tried to create a new workspace, and when I ran gradlew setupDecompWorkspace it then game me the same message. When I first created my workspace I have now I had java7 32-bit but I decided to change that to 64-bit because I was tiered of minecraft messing up all the time. So when I upgraded it it then changed the dir from Program Files (x86) to Program files so I had to change my JAVA_HOME. And now it is giving me that problem. this is how I have my JAVA_HOME set C:\Program Files\Java\jdk1.7.0_65 and this is how I have it in my system path "C:\Program Files\Java\jdk1.7.0_65\bin"

Could it be because of java 64-bit or do I have something wrong with my Variables?

Link to comment
Share on other sites

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.