Lately, I've been working on fixing my Granite mod. What's wrong with it?
Mods loaded: 1
ModLoader Beta 1.6.6
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT 72687359 --------
Generated 6/13/11 4:31 PM
Minecraft: Minecraft Beta 1.6.6
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_24, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: Intel(R) HD Graphics version 2.1.0 - Build 8.15.10.2302, Intel
java.lang.RuntimeException: java.lang.Exception: Image not found: /mods/CameronK/block/granite.png
at net.minecraft.src.ModLoader.RegisterAllTextureOverrides(ModLoader.java:1248)
at net.minecraft.src.ModLoader.OnTick(ModLoader.java:968)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:24)
at net.minecraft.client.Minecraft.run(Minecraft.java:514)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.Exception: Image not found: /mods/CameronK/block/granite.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:942)
at net.minecraft.src.ModLoader.RegisterAllTextureOverrides(ModLoader.java:1240)
... 4 more
--- END ERROR REPORT 50cdc89c ----------
I know that this means that Java couldn't locate the texture for the first block, Granite @ granite.png....but I've checked a hundred times; it's right there.
I've looked through ModLoader's Javadoc and everything, but I still don't know what I'm doing wrong. That error above shows up when I execute startclient.bat with MCP. When I load JUST ModLoader on my MC install, it works fine. Adding my Granite mod as well causes the game to black-screen after starting and close itself soon after.
So, I may be totally off-base here, and I can't say I have much minecraft modding exp, but perhaps its trying to use the absolute path of /mods/CameronK/blah blah blah ( rather that C:/blah/blah/blah ) instead of using it in a relative sense? Another thing would be to check what the working directory IS, if it's /MCP, or /MCP/temp/bin/minecraft ?
Again, this may be completely useless information, as I'm not really a modder, but hope it helps.
have you tried putting the png file actually IN the jar file? as in go into the jars folder, then bin, then open the minecraft.jar you have in there and actually insert the png file in where it would go.
I can almost guarantee you that's what the problem is :tongue.gif:
have you tried putting the png file actually IN the jar file? as in go into the jars folder, then bin, then open the minecraft.jar you have in there and actually insert the png file in where it would go.
I can almost guarantee you that's what the problem is :tongue.gif:
If that's the case, then why would my Minecraft crash when I loaded my mod onto my MC install?
1) I copy the classes for ModLoader to minecraft.jar
2) I copy the classes for Granite to minecraft.jar
3) I copy the /mods/CameronK/ folder into minecraft.jar
4) I delete the META-INF folder if it's there.
So, I may be totally off-base here, and I can't say I have much minecraft modding exp, but perhaps its trying to use the absolute path of /mods/CameronK/blah blah blah ( rather that C:/blah/blah/blah ) instead of using it in a relative sense? Another thing would be to check what the working directory IS, if it's /MCP, or /MCP/temp/bin/minecraft ?
Again, this may be completely useless information, as I'm not really a modder, but hope it helps.
I'm pretty sure that when using startclient.bat, MCP refers to what would be the contents of the jar in /temp/bin/minecraft, then adds the class files after. It worked that way up until 1.6, if I'm not mistaken.
EDIT: Notice that Java doesn't tell me that it can't find /terrain.png, which means that / is the root of what would be the minecraft.jar file, but is also /temp/bin/minecraft.
I do it like this.
1) I create a new folder wherever I want
2) I name it whatever I want
3) I put requested .png files in that folder
4) I put the folder in /bin/minecraft.jar
The code I add for my custom item/block is like this
public static Block blockShred;
//...
static
{
blockShred = (new BlockShred(98, ModLoader.addOverride("/terrain.png", "/myfolder/shredblock.png"));
}
And that's it for the graphic part.
That's the exact same thing as I have, except /myfolder/ has a root of /mods/.
EDIT: /bin/minecraft.jar, as in %APPDATA%, or /MCP/bin/? There's no jar there, so I assume option 1.
Also, if I load the mod onto Minecraft as I said, it crashes. Not using startclient.bat.
I do it like this.
1) I create a new folder wherever I want
2) I name it whatever I want
3) I put requested .png files in that folder
4) I put the folder in /bin/minecraft.jar
The code I add for my custom item/block is like this
public static Block blockShred;
//...
static
{
blockShred = (new BlockShred(98, ModLoader.addOverride("/terrain.png", "/myfolder/shredblock.png"));
}
And that's it for the graphic part.
this is exactly what I was talking about...
You can't just put the images you eluded to with modloader in the temp file... it doesn't work that way :tongue.gif: at least it never did with me. Try putting them into the folder you would have put them into with the regular file, and drop it in the minecraft.jar in the jars folder. If you're going to ask for help, you should at least TRY what people are telling you to do :tongue.gif:
And the .zip file is named after the author or something, or the mod? And how to I reference it with addOverride?
AFAIK the .zip name isn't relevant, it can be anything. You don't reference the .zip at all. I just do this and ModLoader finds the file by itself (the .zip has the folder containers inside its root and a bunch of .png's inside that):
FYI, I have "mod_Valthoron.java" as the class/source name and I don't use that name anywhere else except the class name. Putting the textures inside either mod_Valthoron.zip or valthoron.zip both work fine.
You can't just put the images you eluded to with modloader in the temp file... it doesn't work that way :tongue.gif: at least it never did with me. Try putting them into the folder you would have put them into with the regular file, and drop it in the minecraft.jar in the jars folder. If you're going to ask for help, you should at least TRY what people are telling you to do :tongue.gif:
I am trying. Unless I'm doing something really wrong, all of these ways still give me the same error, just with a different file URI. I'll try again.
Alright, I'm still confused (thanks to everyone for the responses, really appreciate it), so let me reword my question:
When I copy my class files and the folder with images over to %appdata%/bin/minecraft.jar, so that the file structure looks like this:
other folders
CameronK/granite/
other folders
other class files
mod_Granite.class
BlockGranite.class
etc.
other class files
and mod_Granite references images like this:
Granite = new BlockGranite(2258, ModLoader.addOverride("/terrain.png", "/CameronK/granite/granite.png")).setHardness(dh).setResistance(dr).setBlockName("Granite");
why do I receive errors? How should I change the above code so that ModLoader successfully locates the images?
-----------------------------------
EDIT: Just realized something.
I only receive the error with Java locating the images when I run startclient.bat, which means that the error could be in the way that I have my files set up.
When I copy my mod and folders over to minecraft.jar, Minecraft doesn't show the crash screen with the error; it just black-screens immediately after login and then dies about 20 seconds later. Since minecraft doesn't tell me what's wrong, I don't know if the error is with the images or not. It could be something else.
The thing that gets me is that my code compiles fine. I have no idea what I'm doing wrong.
I've had that error with MCP as well. As for the crashing when you put it directly in the .jar as a mod(in the .minecraft folder), look at the modloader.txt, it should tell you. But, looking at the code, perhaps it's becuase your ID for the block is so high.
Rollback Post to RevisionRollBack
Send Bitcoins to me, I'm in need: 1KrBZkD3fiJUgsrDjSW7fkrkvVqVcDsSdN
(Info about bitcoins, what they are and how to start found here http://www.bitcoin.org/ )
I've had that error with MCP as well. As for the crashing when you put it directly in the .jar as a mod(in the .minecraft folder), look at the modloader.txt, it should tell you. But, looking at the code, perhaps it's becuase your ID for the block is so high.
I've seen a mod with ID's something like 17000 and it worked. I'll switch around.
These ID's are just above the ID's of music discs :tongue.gif:
Lately, I've been working on fixing my Granite mod. What's wrong with it?
I know that this means that Java couldn't locate the texture for the first block, Granite @ granite.png....but I've checked a hundred times; it's right there.
I've looked through ModLoader's Javadoc and everything, but I still don't know what I'm doing wrong. That error above shows up when I execute startclient.bat with MCP. When I load JUST ModLoader on my MC install, it works fine. Adding my Granite mod as well causes the game to black-screen after starting and close itself soon after.
Thanks in advance for help.
~CameronK
Again, this may be completely useless information, as I'm not really a modder, but hope it helps.
I can almost guarantee you that's what the problem is :tongue.gif:
If that's the case, then why would my Minecraft crash when I loaded my mod onto my MC install?
1) I copy the classes for ModLoader to minecraft.jar
2) I copy the classes for Granite to minecraft.jar
3) I copy the /mods/CameronK/ folder into minecraft.jar
4) I delete the META-INF folder if it's there.
And it crashes, no other mods loaded.
I'm pretty sure that when using startclient.bat, MCP refers to what would be the contents of the jar in /temp/bin/minecraft, then adds the class files after. It worked that way up until 1.6, if I'm not mistaken.
EDIT: Notice that Java doesn't tell me that it can't find /terrain.png, which means that / is the root of what would be the minecraft.jar file, but is also /temp/bin/minecraft.
http://pastebin.com/g1PAA5nk
Note: I've tried moving
to right above the
code block (as I had it pre-1.6) but it obviously made no changes.
That's the exact same thing as I have, except /myfolder/ has a root of /mods/.
EDIT: /bin/minecraft.jar, as in %APPDATA%, or /MCP/bin/? There's no jar there, so I assume option 1.
Also, if I load the mod onto Minecraft as I said, it crashes. Not using startclient.bat.
And the .zip file is named after the author or something, or the mod? And how to I reference it with addOverride?
this is exactly what I was talking about...
You can't just put the images you eluded to with modloader in the temp file... it doesn't work that way :tongue.gif: at least it never did with me. Try putting them into the folder you would have put them into with the regular file, and drop it in the minecraft.jar in the jars folder. If you're going to ask for help, you should at least TRY what people are telling you to do :tongue.gif:
AFAIK the .zip name isn't relevant, it can be anything. You don't reference the .zip at all. I just do this and ModLoader finds the file by itself (the .zip has the folder containers inside its root and a bunch of .png's inside that):
FYI, I have "mod_Valthoron.java" as the class/source name and I don't use that name anywhere else except the class name. Putting the textures inside either mod_Valthoron.zip or valthoron.zip both work fine.
I am trying. Unless I'm doing something really wrong, all of these ways still give me the same error, just with a different file URI. I'll try again.
When I copy my class files and the folder with images over to %appdata%/bin/minecraft.jar, so that the file structure looks like this:
and mod_Granite references images like this:
why do I receive errors? How should I change the above code so that ModLoader successfully locates the images?
-----------------------------------
EDIT: Just realized something.
I only receive the error with Java locating the images when I run startclient.bat, which means that the error could be in the way that I have my files set up.
When I copy my mod and folders over to minecraft.jar, Minecraft doesn't show the crash screen with the error; it just black-screens immediately after login and then dies about 20 seconds later. Since minecraft doesn't tell me what's wrong, I don't know if the error is with the images or not. It could be something else.
The thing that gets me is that my code compiles fine. I have no idea what I'm doing wrong.
(Info about bitcoins, what they are and how to start found here http://www.bitcoin.org/ )
Landrover
I've seen a mod with ID's something like 17000 and it worked. I'll switch around.
These ID's are just above the ID's of music discs :tongue.gif:
EDIT: Changing to two above maps (id 360) throws
java.lang.ArrayIndexOutOfBoundsException: 360
Changing the item ID's somehow fixed the mod?
Zlyfire, thanks man. You're awesome. :biggrin.gif: