Jump to content

Recommended Posts

Posted

So i made a basic mod today and basically, the mod works fine when launched in mcp, but it gives me an error.

 

Error code:

java.lang.ClassNotFoundException: rulerxx.mods.industriouspower.Industriouspower
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:100)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:57)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:341)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:69)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:317)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:300)
at com.google.common.eventbus.EventBus.post(EventBus.java:268)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:81)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:442)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:141)
at net.minecraft.client.Minecraft.a(Minecraft.java:405)
at net.minecraft.client.Minecraft.run(Minecraft.java:737)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.objectweb.asm.ClassReader.<init>(Unknown Source)
at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:27)
at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:142)
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:93)

 

the mods files:

 

Industriouspower.java

package rulerxx.mods.industriouspower;
import net.minecraft.src.Block;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.PreInit;
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;

@Mod(modid ="something", name = "Mod name lol", version = "1.3.2")
public class Industriouspower {

//Blocks
public static Block oreTin = new oreTin(204, 0).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("oreTin");
public static Block testBlock = new testBlock(205, 1).setHardness(2.5F).setStepSound(Block.soundWoodFootstep).setBlockName("");
//WorldGen File
public static worldGen worldGen = new worldGen();
//Initialization
@Init
	public void loadMod(FMLInitializationEvent event) {
//Pre-Loading textures
 	MinecraftForgeClient.preloadTexture("/IP/textures/terrain.png");
//Blocks
 	GameRegistry.registerBlock(oreTin);
 	LanguageRegistry.addName(oreTin, "Tin Ore");
 	GameRegistry.registerBlock(testBlock);
 	LanguageRegistry.addName(testBlock, "RenderTest");
//WorldGen
 	GameRegistry.registerWorldGenerator(worldGen);
  
	}
}

 

 

oreTin.java

package rulerxx.mods.industriouspower;

import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Material;


public class oreTin extends Block {
public oreTin(int i, int j) {
  super(i, j, Material.rock);
  this.setCreativeTab(CreativeTabs.tabTools);
}

public String getTextureFile() {
  return "/IP/textures/terrain.png";
} 
}

 

testBlock.java

package rulerxx.mods.industriouspower;

import net.minecraft.src.Block;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Material;


public class testBlock extends Block {
public testBlock(int i, int j) {
  super(i, j, Material.rock);
  this.setCreativeTab(CreativeTabs.tabTools);
}

public String getTextureFile() {
  return "/IP/textures/terrain.png";
} 
}

 

worldGen.java

package rulerxx.mods.industriouspower;

import java.util.Random;

import net.minecraft.src.IChunkProvider;
import net.minecraft.src.World;
import cpw.mods.fml.common.IWorldGenerator;

public class worldGen implements IWorldGenerator { 

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    world.setBlock(chunkX*16 + random.nextInt(16), 100, chunkZ*16 + random.nextInt(16), 204);
    // block X location, block Y location, block Z location, block id (in this case, wooden planks)
}
}
        

 

 

 

This code all works fine while running through eclipse, it just seems to give me errors while im running it through a multimc instance

ive got the mod.zip setup as

 

mod.zip - rulerxx - mods - industriouspower - .class files

            - IP - textures - terrain.png

 

 

Could someone please tell me what im doing wrong here?

 

 

EDIT -  Turns out recompiling and reobfuscating fixed the problem

 

 

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.