Hi I have a small question about placing texture files in mods.
My "mod" consists of a few custom blocks, and I want to make it in modloaderformat, meaning I simply drop the zip into the mods-folder and be done with it.
The zip itself has a single class-file and a folder called textures in it. The blocktextures themselves are in a simple terrain.png.
But what exactly do I have to enter in this line to allow Minecraft to find terrain.png inside my mod's texture folder?
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");
This is what I have currently, but MC always crashes because the textures cant be found... what am I doing wrong? Is the adress case-sensitive?
If I didnt provide any information please tell me.
Hi I have a small question about placing texture files in mods.
My "mod" consists of a few custom blocks, and I want to make it in modloaderformat, meaning I simply drop the zip into the mods-folder and be done with it.
The zip itself has a single class-file and a folder called textures in it. The blocktextures themselves are in a simple terrain.png.
But what exactly do I have to enter in this line to allow Minecraft to find terrain.png inside my mod's texture folder?
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");
This is what I have currently, but MC always crashes because the textures cant be found... what am I doing wrong? Is the adress case-sensitive?
If I didnt provide any information please tell me.
Thanks.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");
make sure its all matching case and its in the exact same format. so for what you have there it would be a folder called mods, with a folder called textures inside of a folder called "Book of Blocks", which inside of that would be your terrain.png image. so it would be exactly as you have it there /mods/Book of Blocks/textures/terrain.png
This is one of the most helpful mod tuts ever i think if you could just kind of give the basics and not write 50 paragraphs i would have the time to read it all but what i read was incredibly useful and gave me a new understanding!
I'll ask again, what do need to do now? I mean, I've added in three Java files. mod_core, Core_Block, and ModLoader so that it stops throwing up errors, but I still can't get it to work.
I'll ask again, what do need to do now? I mean, I've added in three Java files. mod_core, Core_Block, and ModLoader so that it stops throwing up errors, but I still can't get it to work.
Once again, basically saying "it doesn't work" doesn't help us. What isn't working?
When life gives you a potato, wonder why the heck life just gave you a potato. Why not something else? Like money? Or a combustable lemon? No, you get a potato. Nothing else.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");
make sure its all matching case and its in the exact same format. so for what you have there it would be a folder called mods, with a folder called textures inside of a folder called "Book of Blocks", which inside of that would be your terrain.png image. so it would be exactly as you have it there /mods/Book of Blocks/textures/terrain.png
Does it matter that "Book of Blocks" is a zip file? I want to achieve something similar to other mods which are zipped and have a texture folder inside of them. Unzipping a mod in the modfolder feels like its circumventing the purpose of using modloader in the first place. ^^'
I have absolutely no idea now, as of now beign that I have made three files.
File 1, was mod_core
File 2, was Core_Block
File 3, was ModLoader
I have absolutely no idea if I'm doing coding wrong or if there is something in the MCP folder that I'm not using.
Coding:
mod_core
package net.minecraft.src;
public class mod_core extends BaseMod
{
public static final Block mod_core = new Block(200, 0, Material.rock).setBlockName("Core_Block").setHardness(3F).setResistance(4F).setLightValue(12F);
public void load()
{
mod_core.blockIndexInTexture = ModLoader.addOverride("/gui/item.png", "/C:/Users/Anthony/Desktop/core.png");
ModLoader.registerBlock(mod_core);
ModLoader.addName(mod_core, "Core_Block");
ModLoader.addRecipe(new ItemStack(mod_core, 1), new Object [] {"#", '#', Block.dirt});
}
public String getVersion()
{
return "1.3.1";
}
}
Core_Block
package net.minecraft.src;
import java.util.Random;
public class Core_Block extends Block
{
public Core_Block(int i, int j)
{
super(200, 0, Material.rock);
}
public int id200(int i, Random random, int j)
{
return mod_core.mod_core.blockID;
}
public int quantity1(Random random)
{
return 1;
}
}
ModLoader
package net.minecraft.src;
public class mod_*** extends BaseMod
{
public void load()
{
}
public String getVersion()
{
return "1.3";
}
}
In the MCP folder, I've used all of the RUN files, and I have no clue what any, but three (Decompile, getchangedsrc, and cleanup), do. If there is something I'm supposed to do AFTER coding, then that would help a lot, if you told me.
When I run MC with my mod, it gives me a black screen.
Code mod_GlowWool
package net.minecraft.src;
public class mod_GlowWool extends BaseMod
{
public static final Block GlowWool = new GlowWool(165, 0).setBlockName(GlowWool)setHardness
(2F).setPesistance(5F).setLightValue(13F);
public void load()
{
GlowWool.blockIndexInTexture = ModLoader.addOverride(/gui/terrain/.png, /mods/GlowWool.png)
ModLoader.registerBlock(GlowWool)
ModLoader.addName(GlowWool, Glow Wool)
ModLoader.addRecipe(new ItemStack(itemtoreceive, quantity), new Object [5] {@#@, #@#, @#@,
Character.valueOf(#), Item.lightStoneDust, Character.valueOf(@), Block.wool});
}
public String getVersion()
{
return 1.3.1;
}
}
Another Code BlockGlowWool
package net.minecraft.src;
import java.util.Random;
public class BlockGlowWool extends mod_GlowWool
{
public GlowWool(int i, int j)
{
super(i, j, Material.Leaves)
}
public int idDropped(int i, 1 1, int j)
{
return mod_Block.nameHere.blockID;
}
public int quantityDropped(1 1)
{
return 1.3.1;
}
}
I have absolutely no idea now, as of now beign that I have made three files.
File 1, was mod_core
File 2, was Core_Block
File 3, was ModLoader
I have absolutely no idea if I'm doing coding wrong or if there is something in the MCP folder that I'm not using.
Coding:
mod_core
package net.minecraft.src;
public class mod_core extends BaseMod
{
public static final Block mod_core = new Block(200, 0, Material.rock).setBlockName("Core_Block").setHardness(3F).setResistance(4F).setLightValue(12F);
public void load()
{
mod_core.blockIndexInTexture = ModLoader.addOverride("/gui/item.png", "/C:/Users/Anthony/Desktop/core.png");
ModLoader.registerBlock(mod_core);
ModLoader.addName(mod_core, "Core_Block");
ModLoader.addRecipe(new ItemStack(mod_core, 1), new Object [] {"#", '#', Block.dirt});
}
public String getVersion()
{
return "1.3.1";
}
}
Core_Block
package net.minecraft.src;
import java.util.Random;
public class Core_Block extends Block
{
public Core_Block(int i, int j)
{
super(200, 0, Material.rock);
}
public int id200(int i, Random random, int j)
{
return mod_core.mod_core.blockID;
}
public int quantity1(Random random)
{
return 1;
}
}
ModLoader
package net.minecraft.src;
public class mod_*** extends BaseMod
{
public void load()
{
}
public String getVersion()
{
return "1.3";
}
}
In the MCP folder, I've used all of the RUN files, and I have no clue what any, but three (Decompile, getchangedsrc, and cleanup), do. If there is something I'm supposed to do AFTER coding, then that would help a lot, if you told me.
This is every one of my problems in one go.
You don't need to make file 3, its included in your other files, its the base of a modloader class
Does it matter that "Book of Blocks" is a zip file? I want to achieve something similar to other mods which are zipped and have a texture folder inside of them. Unzipping a mod in the modfolder feels like its circumventing the purpose of using modloader in the first place. ^^'
When you are still coding, you it shouldn't be a zip file. When you done coding and you are ready to make it public, that's when you put it in a zip file with all the textures and stuff.
Thanks for replying - I have tried this but all it does it make it take longer to mine whilst still giving the block at the end. I looked at the code used for other ores and it seems that they have their own separate class (BlockOre rather than Block). I tried messing around with this
public static final BlockOre oreGranite = (new BlockOre(160, 0)).setHardness(3F).setResistance(5F).setBlockName("oreGranite");
but it gives the error: "type mismatch: cannot convert Block to BlockOre"
It should be public static final Block oreGranite.
It's giving me errors because modloader is in the coding, should I be worried, do I have to change anything?
And, did you check the coding of my first two files?
Alos, no one is explaining anythign to my question of what are all teh run files in MCP supposed to do?
You won't need most of the run files but here are the ones you need to know. updatemcp.bat updates mcp obviously. decompile.bat decompiles the jar file for you. recompile.bat recompiles everything you coded with the game so that it is ready for reobfuscating. reobfuscate.bat is used to get all the class files you need to put into your MC to install your mod. All of these class files go to reobf folder after running reobfuscate.bat. startclient.bat and startserver.bat are only needed if you are not using eclipse as far as I know.
When I run MC with my mod, it gives me a black screen.
Code mod_GlowWool
package net.minecraft.src;
public class mod_GlowWool extends BaseMod
{
public static final Block GlowWool = new GlowWool(165, 0).setBlockName(GlowWool)setHardness
(2F).setPesistance(5F).setLightValue(13F);
public void load()
{
GlowWool.blockIndexInTexture = ModLoader.addOverride(/gui/terrain/.png, /mods/GlowWool.png)
ModLoader.registerBlock(GlowWool)
ModLoader.addName(GlowWool, Glow Wool)
ModLoader.addRecipe(new ItemStack(itemtoreceive, quantity), new Object [5] {@#@, #@#, @#@,
Character.valueOf(#), Item.lightStoneDust, Character.valueOf(@), Block.wool});
}
public String getVersion()
{
return 1.3.1;
}
}
Another Code BlockGlowWool
package net.minecraft.src;
import java.util.Random;
public class BlockGlowWool extends mod_GlowWool
{
public GlowWool(int i, int j)
{
super(i, j, Material.Leaves)
}
public int idDropped(int i, 1 1, int j)
{
return mod_Block.nameHere.blockID;
}
public int quantityDropped(1 1)
{
return 1.3.1;
}
}
You don't need to make file 3, its included in your other files, its the base of a modloader class
Uhmm, your code is messed up. Here are the ones causing you errors.
You have to put a period before setHardness.
You spelled setResistance wrong.
setBlockName should be like this:
You forgot to put what item to recieve, and what quantity. You don't put 5 inside the [] after object. You put it in the quantity. Also, you have to enclose the characters inside a "".
It should be like this.
I'm about to give up... using Eclipse I can start Mincraft without crasjing, but the Texture is not displayed correctly. I dont even recognize it from my terrain.png!
And if I recompile and reobfuscate my mod, Minecraft crashes with this ErrorLog telling me terrain.png not found:
java.lang.RuntimeException: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1596)
at ModLoader.onTick(ModLoader.java:1170)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.loadImage(ModLoader.java:1090)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1588)
... 5 more
My class-file:
package net.minecraft.src;
public class mod_BookOfBlocks extends BaseMod
{
//Constructor, Empty for the Moment
public mod_BookOfBlocks()
{
}
public void load()
{
//This adds "Blast-Resistant Glass"
ModLoader.registerBlock(BlastResistantGlass);
ModLoader.addName(BlastResistantGlass, "Blast-Resistant Glass");
//"BookOfBlocks" is the zip file I drop in the "Mods" folder in my MC-Folder.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/BookOfBlocks/terrain.png");
}
public String getVersion()
{
return "[1.3.1]Book of Blocks v1.0";
}
//These are the properties of the Custom Blocks
public static final Block BlastResistantGlass = (new BlockGlass(188, 0, Material.glass, false)).setHardness(3.0F).setResistance(2000.0F).setStepSound(Block.soundGlassFootstep).setBlockName("BlastResistantGlass");
}
I have the recompiled class-file and the texture-fil inside a zip like this:
BookOfBlocks.zip/mod_BookOfBlocks.class
BookOfBlocks.zip/terrain.png
The zip is dropped into the mods-folder in Minecraft.
I'm about to give up... using Eclipse I can start Mincraft without crasjing, but the Texture is not displayed correctly. I dont even recognize it from my terrain.png!
And if I recompile and reobfuscate my mod, Minecraft crashes with this ErrorLog telling me terrain.png not found:
java.lang.RuntimeException: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1596)
at ModLoader.onTick(ModLoader.java:1170)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.loadImage(ModLoader.java:1090)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1588)
... 5 more
My class-file:
package net.minecraft.src;
public class mod_BookOfBlocks extends BaseMod
{
//Constructor, Empty for the Moment
public mod_BookOfBlocks()
{
}
public void load()
{
//This adds "Blast-Resistant Glass"
ModLoader.registerBlock(BlastResistantGlass);
ModLoader.addName(BlastResistantGlass, "Blast-Resistant Glass");
//"BookOfBlocks" is the zip file I drop in the "Mods" folder in my MC-Folder.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/BookOfBlocks/terrain.png");
}
public String getVersion()
{
return "[1.3.1]Book of Blocks v1.0";
}
//These are the properties of the Custom Blocks
public static final Block BlastResistantGlass = (new BlockGlass(188, 0, Material.glass, false)).setHardness(3.0F).setResistance(2000.0F).setStepSound(Block.soundGlassFootstep).setBlockName("BlastResistantGlass");
}
I have the recompiled class-file and the texture-fil inside a zip like this:
BookOfBlocks.zip/mod_BookOfBlocks.class
BookOfBlocks.zip/terrain.png
The zip is dropped into the mods-folder in Minecraft.
What am I doing wrong?
You can't use terrain files with this. You have to use individual images. Otherwise you'll have to use FML, which isn't updated yet.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I'm about to give up... using Eclipse I can start Mincraft without crasjing, but the Texture is not displayed correctly. I dont even recognize it from my terrain.png!
And if I recompile and reobfuscate my mod, Minecraft crashes with this ErrorLog telling me terrain.png not found:
java.lang.RuntimeException: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.registerAllTextureOverrides(ModLoader.java:1596)
at ModLoader.onTick(ModLoader.java:1170)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.loadImage(ModLoader.java:1090)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1588)
... 5 more
My class-file:
package net.minecraft.src;
public class mod_BookOfBlocks extends BaseMod
{
//Constructor, Empty for the Moment
public mod_BookOfBlocks()
{
}
public void load()
{
//This adds "Blast-Resistant Glass"
ModLoader.registerBlock(BlastResistantGlass);
ModLoader.addName(BlastResistantGlass, "Blast-Resistant Glass");
//"BookOfBlocks" is the zip file I drop in the "Mods" folder in my MC-Folder.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/BookOfBlocks/terrain.png");
}
public String getVersion()
{
return "[1.3.1]Book of Blocks v1.0";
}
//These are the properties of the Custom Blocks
public static final Block BlastResistantGlass = (new BlockGlass(188, 0, Material.glass, false)).setHardness(3.0F).setResistance(2000.0F).setStepSound(Block.soundGlassFootstep).setBlockName("BlastResistantGlass");
}
I have the recompiled class-file and the texture-fil inside a zip like this:
BookOfBlocks.zip/mod_BookOfBlocks.class
BookOfBlocks.zip/terrain.png
The zip is dropped into the mods-folder in Minecraft.
What am I doing wrong?
Ok, lets do a step-by-step here.
First create a folder on your desktop called "mods". Spell it exactly how it appears: mods
go inside that folder and make another folder called "BookOfBlocks" Spelled EXACTLY like that: BookOfBlocks
Now take your terrain.png and put it inside that "BookOfBlocks" folder.
This is the part where you need 7zip or similar. If you have an archiving tool already, skip this step, if not keep reading.
Assuming you have windows, you would download "7-Zip for 32-bit Windows" for a 32(x86) system and: "7-Zip for 64-bit Windows x64 (Intel 64 or AMD64)" for a 64-bit system.
If you dont know what you have go to control panel>System and Security>System
next to "System Type" will say what you have.
Download accordingly.
Install 7zip following the installer.
Now, Right click the folder you made earlier on your desktop after 7zip installs. There should now be something that says "7-zip" in your menu. Just go to 7-zip>add to <namehere>.zip. its down towards the bottom of the 7zip menu.
When it makes the archive, you should have your folders inside of that archive with your image in the proper folder. From there you can just drag your .class files into the zip and drop the zip folder into your mods folder of minecraft to test it.
But the path "/mods/*zipfolder*/texture.png" is correct?
I watched out for lower- and uppercase letters, I took care of properly zipping everything and I seperated the block-texture.png from the terrain.png (and made sure the texturepath inside the code was changed accordingly). Still crash because of "not found".
i believe it has to be some kind of mistake with the pathing. Is the only way to make this work to force everything into the jar to make sure minecraft is able to find that damn texture?
"/terrain.png" means that minecraft looks for the file "terrain.png" inside the minecraft.jar
"/BlastResistantGlass.png"... where exactly would this one be? inside the Minecraft.jar? Or the Mod.zip?
Is there a working code I can have a look at? I mean one with a texture inside a zipfolder inside the minecraftmod-folder...
EDIT:
I found my mistake:
it was the starting location of "/BlastResistantGlass.png": For some reason I assumed the 2nd "/" started at the same location as the first "/".
But "/BlastResistantGlass.png" means minecraft will look for the png inside the zipped folder, not in the minecraft.jar.
Other then that It seemes like everything was done correctly and is working now.
Thanks to everyone who helped, and maybe there should be a note explaining where the "/"s are really starting. Its easy to conclude that "/terrain.png" adresses the png inside your Minecraft.jar, but its a bit harder to find out where the customtextures are adressed. Or maybe it was just me^^
Thanks anyway!
Maybe there should be a note explaining where the "/"s are really starting. Its easy to conclude that "/terrain.png" adresses the png inside your Minecraft.jar, but its a bit harder to find out where the customtextures are adressed. Or maybe it was just me^^
Thanks anyway!
There is an entire spoiler on textures and how to use them; including their placement in the correct directory.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
} Srry if thats not enof info Srry bout me failing at spoilres I dont know where to put the little ^s Ill try though Also there is ^ under some of my } but i dont no which 1s
My "mod" consists of a few custom blocks, and I want to make it in modloaderformat, meaning I simply drop the zip into the mods-folder and be done with it.
The zip itself has a single class-file and a folder called textures in it. The blocktextures themselves are in a simple terrain.png.
But what exactly do I have to enter in this line to allow Minecraft to find terrain.png inside my mod's texture folder?
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");This is what I have currently, but MC always crashes because the textures cant be found... what am I doing wrong? Is the adress case-sensitive?
If I didnt provide any information please tell me.
Thanks.
BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/Book of Blocks/textures/terrain.png");make sure its all matching case and its in the exact same format. so for what you have there it would be a folder called mods, with a folder called textures inside of a folder called "Book of Blocks", which inside of that would be your terrain.png image. so it would be exactly as you have it there /mods/Book of Blocks/textures/terrain.png
//Bucket of Chocolate Milk chocmilk.iconIndex = ModLoader.addOverride("/gui/items.png", "/BoCM.png"); ModLoader.addName(chocmilk, "Chocolate Milk"); ModLoader.addRecipe(new ItemStack(mod_nether.chocmilk, 1), new Object [] {" @ ", " @ ", " # ", Character.valueOf('@'), Item.dyePowder, 1, 3, Character.valueOf('#'), Item.bucketMilk});What's wrong with this crafting recipe? Everytime I try to load minecraft to test it, it never loads..?
-
View User Profile
-
View Posts
-
Send Message
Retired StaffGiving us code and saying "it doesn't work" doesn't tell us too much. Are you getting an error?
Once again, basically saying "it doesn't work" doesn't help us. What isn't working?
Does it matter that "Book of Blocks" is a zip file? I want to achieve something similar to other mods which are zipped and have a texture folder inside of them. Unzipping a mod in the modfolder feels like its circumventing the purpose of using modloader in the first place. ^^'
File 1, was mod_core
File 2, was Core_Block
File 3, was ModLoader
I have absolutely no idea if I'm doing coding wrong or if there is something in the MCP folder that I'm not using.
Coding:
package net.minecraft.src; public class mod_core extends BaseMod { public static final Block mod_core = new Block(200, 0, Material.rock).setBlockName("Core_Block").setHardness(3F).setResistance(4F).setLightValue(12F); public void load() { mod_core.blockIndexInTexture = ModLoader.addOverride("/gui/item.png", "/C:/Users/Anthony/Desktop/core.png"); ModLoader.registerBlock(mod_core); ModLoader.addName(mod_core, "Core_Block"); ModLoader.addRecipe(new ItemStack(mod_core, 1), new Object [] {"#", '#', Block.dirt}); } public String getVersion() { return "1.3.1"; } }package net.minecraft.src; import java.util.Random; public class Core_Block extends Block { public Core_Block(int i, int j) { super(200, 0, Material.rock); } public int id200(int i, Random random, int j) { return mod_core.mod_core.blockID; } public int quantity1(Random random) { return 1; } }package net.minecraft.src; public class mod_*** extends BaseMod { public void load() { } public String getVersion() { return "1.3"; } }In the MCP folder, I've used all of the RUN files, and I have no clue what any, but three (Decompile, getchangedsrc, and cleanup), do. If there is something I'm supposed to do AFTER coding, then that would help a lot, if you told me.
This is every one of my problems in one go.
Code mod_GlowWool
package net.minecraft.src; public class mod_GlowWool extends BaseMod { public static final Block GlowWool = new GlowWool(165, 0).setBlockName(GlowWool)setHardness (2F).setPesistance(5F).setLightValue(13F); public void load() { GlowWool.blockIndexInTexture = ModLoader.addOverride(/gui/terrain/.png, /mods/GlowWool.png) ModLoader.registerBlock(GlowWool) ModLoader.addName(GlowWool, Glow Wool) ModLoader.addRecipe(new ItemStack(itemtoreceive, quantity), new Object [5] {@#@, #@#, @#@, Character.valueOf(#), Item.lightStoneDust, Character.valueOf(@), Block.wool}); } public String getVersion() { return 1.3.1; } }package net.minecraft.src; import java.util.Random; public class BlockGlowWool extends mod_GlowWool { public GlowWool(int i, int j) { super(i, j, Material.Leaves) } public int idDropped(int i, 1 1, int j) { return mod_Block.nameHere.blockID; } public int quantityDropped(1 1) { return 1.3.1; } }You don't need to make file 3, its included in your other files, its the base of a modloader class
And, did you check the coding of my first two files?
Alos, no one is explaining anythign to my question of what are all teh run files in MCP supposed to do?
When you are still coding, you it shouldn't be a zip file. When you done coding and you are ready to make it public, that's when you put it in a zip file with all the textures and stuff.
It should be public static final Block oreGranite.
You won't need most of the run files but here are the ones you need to know. updatemcp.bat updates mcp obviously. decompile.bat decompiles the jar file for you. recompile.bat recompiles everything you coded with the game so that it is ready for reobfuscating. reobfuscate.bat is used to get all the class files you need to put into your MC to install your mod. All of these class files go to reobf folder after running reobfuscate.bat. startclient.bat and startserver.bat are only needed if you are not using eclipse as far as I know.
Uhmm, your code is messed up. Here are the ones causing you errors.
You have to put a period before setHardness.
You spelled setResistance wrong.
setBlockName should be like this:
.setBlockName("GlowWool")In this part of code:
It should be like this. You forgot to put a ; at the end of the line too.
GlowWool.blockIndexInTexture = ModLoader.addOverride("/gui/terrain/.png", "/mods/GlowWool.png");You always forget to put ; at the end of each line. DONT FORGET.
In this line,
It should be like this.
Strings should be enclosed in these. ""
And also, end it with a ; !
In this line,
ModLoader.addRecipe(new ItemStack(itemtoreceive, quantity), new Object [5] {@#@, #@#, @#@,Character.valueOf(#), Item.lightStoneDust, Character.valueOf(@), Block.wool});You forgot to put what item to recieve, and what quantity. You don't put 5 inside the [] after object. You put it in the quantity. Also, you have to enclose the characters inside a "".
It should be like this.
ModLoader.addRecipe(new ItemStack(GlowWool, 5), new Object [] {"@#@", "#@#", "@#@", Character.valueOf('#'), Item.lightStoneDust, Character.valueOf('@'), Block.wool});Though I don't think you can just add wools to a recipe like that since they use metadata.
And in the last part, cover 1.3.1 with two ".
EDIT: Also, your Block code is messed up too. Try to do what TechGuy does.
And if I recompile and reobfuscate my mod, Minecraft crashes with this ErrorLog telling me terrain.png not found:
at ModLoader.registerAllTextureOverrides(ModLoader.java:1596)
at ModLoader.onTick(ModLoader.java:1170)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.J(SourceFile:607)
at net.minecraft.client.Minecraft.run(SourceFile:535)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.Exception: Image not found: /mods/BookOfBlocks/terrain.png
at ModLoader.loadImage(ModLoader.java:1090)
at ModLoader.registerAllTextureOverrides(ModLoader.java:1588)
... 5 more
My class-file:
package net.minecraft.src; public class mod_BookOfBlocks extends BaseMod { //Constructor, Empty for the Moment public mod_BookOfBlocks() { } public void load() { //This adds "Blast-Resistant Glass" ModLoader.registerBlock(BlastResistantGlass); ModLoader.addName(BlastResistantGlass, "Blast-Resistant Glass"); //"BookOfBlocks" is the zip file I drop in the "Mods" folder in my MC-Folder. BlastResistantGlass.blockIndexInTexture = ModLoader.addOverride ("/terrain.png", "/mods/BookOfBlocks/terrain.png"); } public String getVersion() { return "[1.3.1]Book of Blocks v1.0"; } //These are the properties of the Custom Blocks public static final Block BlastResistantGlass = (new BlockGlass(188, 0, Material.glass, false)).setHardness(3.0F).setResistance(2000.0F).setStepSound(Block.soundGlassFootstep).setBlockName("BlastResistantGlass"); }I have the recompiled class-file and the texture-fil inside a zip like this:
BookOfBlocks.zip/mod_BookOfBlocks.class
BookOfBlocks.zip/terrain.png
The zip is dropped into the mods-folder in Minecraft.
What am I doing wrong?
You can't use terrain files with this. You have to use individual images. Otherwise you'll have to use FML, which isn't updated yet.
together they are powerful beyond imagination."
Ok, lets do a step-by-step here.
First create a folder on your desktop called "mods". Spell it exactly how it appears: mods
go inside that folder and make another folder called "BookOfBlocks" Spelled EXACTLY like that: BookOfBlocks
Now take your terrain.png and put it inside that "BookOfBlocks" folder.
This is the part where you need 7zip or similar. If you have an archiving tool already, skip this step, if not keep reading.
To get 7zip go here: http://www.7-zip.org/download.html
Assuming you have windows, you would download "7-Zip for 32-bit Windows" for a 32(x86) system and: "7-Zip for 64-bit Windows x64 (Intel 64 or AMD64)" for a 64-bit system.
If you dont know what you have go to control panel>System and Security>System
next to "System Type" will say what you have.
Download accordingly.
Install 7zip following the installer.
Now, Right click the folder you made earlier on your desktop after 7zip installs. There should now be something that says "7-zip" in your menu. Just go to 7-zip>add to <namehere>.zip. its down towards the bottom of the 7zip menu.
When it makes the archive, you should have your folders inside of that archive with your image in the proper folder. From there you can just drag your .class files into the zip and drop the zip folder into your mods folder of minecraft to test it.
If this doesn't help any, I don't know what can.
This as well, derp. Forgot about that as well. xD
I watched out for lower- and uppercase letters, I took care of properly zipping everything and I seperated the block-texture.png from the terrain.png (and made sure the texturepath inside the code was changed accordingly). Still crash because of "not found".
i believe it has to be some kind of mistake with the pathing. Is the only way to make this work to force everything into the jar to make sure minecraft is able to find that damn texture?
Ok, lets try this another way:
ModLoader.addOverride ("/terrain.png", "/BlastResistantGlass.png");- "/terrain.png" means that minecraft looks for the file "terrain.png" inside the minecraft.jar
- "/BlastResistantGlass.png"... where exactly would this one be? inside the Minecraft.jar? Or the Mod.zip?
Is there a working code I can have a look at? I mean one with a texture inside a zipfolder inside the minecraftmod-folder...EDIT:
I found my mistake:
it was the starting location of "/BlastResistantGlass.png": For some reason I assumed the 2nd "/" started at the same location as the first "/".
But "/BlastResistantGlass.png" means minecraft will look for the png inside the zipped folder, not in the minecraft.jar.
Other then that It seemes like everything was done correctly and is working now.
Thanks to everyone who helped, and maybe there should be a note explaining where the "/"s are really starting. Its easy to conclude that "/terrain.png" adresses the png inside your Minecraft.jar, but its a bit harder to find out where the customtextures are adressed. Or maybe it was just me^^
Thanks anyway!
There is an entire spoiler on textures and how to use them; including their placement in the correct directory.
together they are powerful beyond imagination."
When I recompile i get alot of random errors all saying Detected errors: class, interface, enum expected
This is my code
package
net.minecraft.src;
public
class PetRock {
}
public
PetRock(int i, int j)
{
super
(i, j, Material.rock);
}
public
int idDropped(int i, Random random, int j)
{
return
mod_Block.PetRock.blockID;
}
public
int quantityDropped(Random random)
{
return
1;
}
}
and my Mod_Block
package
net.minecraft.src;
public
class mod_Block {
}
public
static final Block PetRock = new PetRock(160, 0).setBlockName("PetRock").setHardness(3F).setResistance(4F).setLightValue(3F);
^
public
void load()
^
{
nameHere
.blockIndexInTexture = ModLoader.addOverride(
"/terrain.png", "/PetRock.png");
ModLoader.registerBlock(PetRock);
ModLoader.addName(PetRock
^,
"PetRock");
}
public
String getVersion()
^
{
return
"1.2.5";
}
}
Srry if thats not enof info
Srry bout me failing at spoilres