Jump to content

Recommended Posts

Posted

I am making a mod where I have multiple items with textures. I am using the

 

public void registerIcons(IconRegister iconRegiste

 

method. I am having issues putting my mod onto a Minecraft client but it works perfectly in Eclipse. Does anyone know the method where you put the images directly into the Eclipse package instead of into the MCP folders?

 

EDIT:

I have isolated the problem with my mod and textures are not the issue, I believe it is the location of the class files. My mod works 100 percent perfectly in Eclipse but when ported to a minecraft client it does not work at all. I have it set up like so:

 

ROOT OF ZIP

<.class files here>

<mods>

      <resources>

              <textures>

                    <items>

                        <.pngs here>

 

 

All my mod does is add some items to the game to use currency. I think I have the .zip's configuration wrong because it doesn't seem to be finding any of the class files wherever it's choosing to look, which obviously is not where I have chosen to put my class files. Here is the full error report if it helps:

 

   Minecraft has crashed!      
      ----------------------      

Minecraft has stopped running because it encountered a problem; Failed to start game

A full error report has been saved to C:\Users\Will\AppData\Roaming\.minecraft\crash-reports\crash-2013-06-14_23.49.45-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash 



--- BEGIN ERROR REPORT 827b4660 --------
Full report at:
C:\Users\Will\AppData\Roaming\.minecraft\crash-reports\crash-2013-06-14_23.49.45-client.txt
Please show that file to Mojang, NOT just this screen!

Generated 6/14/13 11:49 PM

-- System Details --
Details:
Minecraft Version: 1.5.2
Operating System: Windows 8 (amd64) version 6.2
Java Version: 1.7.0_21, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 424555152 bytes (404 MB) / 648740864 bytes (618 MB) up to 954466304 bytes (910 MB)
JVM Flags: 2 total; -Xms512m -Xmx1024m
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Suspicious classes: FML and Forge are installed
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v7.51 FML v5.2.2.684 Minecraft Forge 7.8.0.684 4 mods loaded, 4 mods active
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{5.2.2.684} [Forge Mod Loader] (coremods) Unloaded->Constructed
Forge{7.8.0.684} [Minecraft Forge] (coremods) Unloaded->Constructed
thelors_creditmod{1a} [The LORS Credit Mod] (creditmodbase.zip) Unloaded->Errored
LWJGL: 2.4.2
OpenGL: GeForce GTX 660 Ti/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Texture Pack: Default
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException: net.thelors.creditmod.creditmodbase
at cpw.mods.fml.common.LoadController.transition(LoadController.java:142)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:513)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:160)
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:410)
at net.minecraft.client.MinecraftAppletImpl.func_71384_a(SourceFile:56)
at net.minecraft.client.Minecraft.run(Minecraft.java:732)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: net.thelors.creditmod.creditmodbase
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at cpw.mods.fml.common.ModClassLoader.loadClass(ModClassLoader.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425)
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:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)
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:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:503)
... 5 more
Caused by: java.lang.NullPointerException
at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:227)
... 32 more
--- END ERROR REPORT cbc4aad6 ----------

 

Here is the list of ALL the files in my mod:

creditmodbase.class

ItemCoin.class

ItemDollar.class

ItemEightBill.class

ItemSixteenBill.class

ItemThirtytwoBill.class

ItemSixtyfourBill.class

1dollar.png

8dollar.png

16dollar.png

32dollar.png

64dollar.png

coin.png

 

Also, here is the code for the main class file.\

 

package net.thelors.creditmod;

import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;

@Mod(modid = "thelors_creditmod", name = "The LORS Credit Mod", version = "1a")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class creditmodbase {

public static Item sixtyfourbill;
public static Item thirtytwobill;
public static Item sixteenbill;
public static Item eightbill;
public static Item bill;
public static Item coin;

@Init
public void load(FMLInitializationEvent event)
{
	coin = new ItemCoin(5000).setUnlocalizedName("coin").setMaxStackSize(;
	LanguageRegistry.addName(coin, "$.16");

	bill = new ItemDollar(5001).setUnlocalizedName("bill").setMaxStackSize(;
	LanguageRegistry.addName(bill, "$1");

	eightbill = new ItemEightBill(5002).setUnlocalizedName("eightbill").setMaxStackSize(;
	LanguageRegistry.addName(eightbill, "$8");

	sixteenbill = new ItemSixteenBill(5003).setUnlocalizedName("sixteenbill").setMaxStackSize(;
	LanguageRegistry.addName(sixteenbill, "$16");

	thirtytwobill = new ItemThirtyTwoBill(5004).setUnlocalizedName("sixteenbill").setMaxStackSize(;
	LanguageRegistry.addName(thirtytwobill, "$32");

	sixtyfourbill = new ItemSixtyFourBill(5005).setUnlocalizedName("sixtyfourbill").setMaxStackSize(;
	LanguageRegistry.addName(sixtyfourbill, "$64");

	recipes();







}

public void recipes() {

	GameRegistry.addRecipe(new ItemStack(bill), new Object[] {
		"xxx", "x x", "xxx", 'x', coin
	}); 

	GameRegistry.addRecipe(new ItemStack(eightbill), new Object[] {
		"xxx", "x x", "xxx", 'x', bill
	});

	GameRegistry.addShapelessRecipe(new ItemStack(sixteenbill), new Object[] {
		new ItemStack(eightbill), new ItemStack(eightbill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(thirtytwobill), new Object[] {
		new ItemStack(sixteenbill), new ItemStack(sixteenbill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(sixtyfourbill), new Object[] {
		new ItemStack(thirtytwobill), new ItemStack(thirtytwobill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(thirtytwobill, 2), new Object[] {
		new ItemStack(sixtyfourbill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(sixteenbill, 2), new Object[] {
		new ItemStack(thirtytwobill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(eightbill, 2), new Object[] {
		new ItemStack(sixteenbill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(bill, , new Object[] {
		new ItemStack(eightbill)
	});

	GameRegistry.addShapelessRecipe(new ItemStack(coin, , new Object[] {
		new ItemStack(bill)
	});




}
}

 

Ask if you need any more info!

 

 

Posted

Your structure must look like this:

<zip root>

      |- net

            |- thelors

                  |- creditmod

                        |- <class files>

      |- mods

            |- MYMODNAME

                  |- textures

                        |- items

                              |- <png files>

 

The folder structure for one class file must match it's packet definition, meaning if you have the packet set to "mypacket.subpacket.mod", the folder structure must be "/mypacket/subpacket/mod/classfile.class"

 

If you don't override the registerIcons method in your items and instead use the unlocalized name for texture specifying, you have to prepend MYMODNAME: (with the colon) to your unlocalized name, MYMODNAME is a custom mod name (in both, the unloc-name and the folder name). Here's an example:

"ClaySoldiers:horseDoll"

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

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.