public void actionPerformed(GuiButton GuiReforcementTable)
{
}
}
BlockReforcementTable
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class BlockGuiReforcementTable extends Block
{
protected BlockGuiReforcementTable(int i, int j)
{
super(i, j, Material.rock);
}
public void onBlockRightClicked(World world, int i, int j, int k, EntityPlayer entityplayer)
{
mc.displayGuiScreen(new GuiReforcementTable());
ModLoader.openGUI(entityplayer, new GuiReforcementTable());
}
public Minecraft mc = ModLoader.getMinecraftInstance();
}
Oh, and I know that I spelt Reinforcement wrong, I fixed it where I needed to ;D
TechGuy doesn't cover GUI's, so I am not going to help you in this thread. Go to the Mod Development forum.
Hello everyone!
Firstly, thanks for awesome guide!
Today I made a mod with three ores but they are spawning next to each another.
Is there any way to fix that?
SOURCE CODE
public void generateSurface(World world, Random rand, int chunkX, int chunkZ){
for (int a=0; a<8; a++){
int randPosX = chunkX + rand.nextInt(5);
int randPosY = rand.nextInt(38);
int randPosZ = chunkZ + rand.nextInt(5);
(new WorldGenMinable(SapphireOre.blockID, 6)) .generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int b=0; b<8; b++){
int randPosX = chunkX + rand.nextInt(5);
int randPosY = rand.nextInt(38);
int randPosZ = chunkZ + rand.nextInt(5);
(new WorldGenMinable(RubyOre.blockID, 6)) .generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int c=0; c<8; c++){
int randPosX = chunkX + rand.nextInt(5);
int randPosY = rand.nextInt(38);
int randPosZ = chunkZ + rand.nextInt(5);
(new WorldGenMinable(EmeraldOre.blockID, 6)) .generate(world, rand, randPosX, randPosY, randPosZ);
}
}
Sorry, but you can't specify exactly how your ores generate. It is a random game function.
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_02\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_LightGoldBlock.java:12: error: cannot find s
ymbol
ModLoader.addRecipe(new ItemStack(LightGold, 1), new Object [] {
"###", "#*#", "###", Character.valueOf('#'), StrongGold, Character.valueOf('*'),
GoldPowder});
^
symbol: variable StrongGold
location: class mod_LightGoldBlock
src\minecraft\net\minecraft\src\mod_LightGoldBlock.java:12: error: cannot find s
ymbol
ModLoader.addRecipe(new ItemStack(LightGold, 1), new Object [] {
"###", "#*#", "###", Character.valueOf('#'), StrongGold, Character.valueOf('*'),
GoldPowder});
^
symbol: variable GoldPowder
location: class mod_LightGoldBlock
2 errors
==================
!! Can not find server sources, try decompiling !!
Press any key to continue . . .
mod_LightGoldBlock
package net.minecraft.src;
public class mod_LightGoldBlock extends BaseMod
{
public static final Block LightGold = new BlockLightGold(163, 0).setBlockName("LightGold").setHardness(3F).setResistance(4F).setLightValue(1.5F);
public void load()
{
LightGold.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Texture/image.png");
ModLoader.registerBlock(LightGold);
ModLoader.addName(LightGold, "Light Gold");
ModLoader.addRecipe(new ItemStack(LightGold, 1), new Object [] {"###", "#*#", "###", Character.valueOf('#'), StrongGold, Character.valueOf('*'), GoldPowder});
}
public String getVersion()
{
return "1.2.5";
}
}
mod_StrongGold
package net.minecraft.src;
public class mod_StrongGold extends BaseMod
{
public static final Item StrongGold = new ItemStrongGold(162).setItemName("StrongGold");
public void load()
{
StrongGold.iconIndex = ModLoader.addOverride("/gui/items.png", "/Texture/test2.png");
ModLoader.addName(StrongGold, "Reinforced Gold ");
ModLoader.addRecipe(new ItemStack(StrongGold, 1), new Object [] {"##", Character.valueOf('#'), Item.ingotGold});
}
public String getVersion()
{
return "1.2.5";
}
}
mod_GoldPowder
package net.minecraft.src;
public class mod_GoldPowder extends BaseMod
{
public static final Item GoldPowder = new ItemGoldPowder(161).setItemName("GoldPowder");
public void load()
{
GoldPowder.iconIndex = ModLoader.addOverride("/gui/items.png", "/Texture/test.png");
ModLoader.addName(GoldPowder, "Gold Powder");
ModLoader.addRecipe(new ItemStack(GoldPowder, 1), new Object [] {"#", "*", Character.valueOf('#'), Item.ingotGold, Character.valueOf('*'), Item.glassBottle});
ModLoader.addShapelessRecipe(new ItemStack(GoldPowder, 1), new Object[] {Item.coal, Item.wheat});
}
public int addFuel(int i, int j)
{
if(i == GoldPowder.shiftedIndex)
return 2750;
return 0;
}
public String getVersion()
{
return "1.2.5";
}
}
i want it so when you craft the lightgold block it uses these items any ides please ?
You have to reference where your things are. mod_StrongGold.StrongGold for example instead of just StrongGold. Are you using Eclipse? It should have detected these problems if you are.
Hello all, I have a slight problem with my code. Whenever I run it, there are no errors AT ALL, except that when I try the crafting recipes, they simply don't work.
This is the code for the crafting recipes (no bugs in eclipse, its all set up properly):
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Item.wheat});
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Block.tallGrass});
No errors, I have no idea why this is happening. Any help?
Hello all, I have a slight problem with my code. Whenever I run it, there are no errors AT ALL, except that when I try the crafting recipes, they simply don't work.
This is the code for the crafting recipes (no bugs in eclipse, its all set up properly):
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Item.wheat});
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Block.tallGrass});
No errors, I have no idea why this is happening. Any help?
Is Haybale in the same class as this recipe?. If so. i dont know. But if its not. You have to make it. (new ItemStack(NAMEOFCLASS.Haybale, 1)
Ouh andyeah. Make Character.valueOf('#'), Item.wheat. and the same for grass
Is Haybale in the same class as this recipe?. If so. i dont know. But if its not. You have to make it. (new ItemStack(NAMEOFCLASS.Haybale, 1)
Ouh andyeah. Make Character.valueOf('#'), Item.wheat. and the same for grass
Hi Gbear605, i think i can see the problem, try this
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", " # ", Character.valueOf('#'), Item.wheat});
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", " # ", Character.valueOf('#'), Block.tallGrass});
That should work fine now.
I hope i helped
- Matho
Just tried, didn't work. :/ No errors, just doesn't work.
How to you make your item like a bucket, so when you use it in a crafting recipe you get it back like you get the buckets back when you craft cake.
Put
.setContainerItem()
in the items public static final line.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Are you on Windows, OSX, or Linux? I use Macs, and StuffIt is the program I use. On Windows, I have heard that 7-Zip or WinRar work fine. As for Linux, I am not sure. I could find out if you want me to though.
Hey, me again, I have followed the instructions of your mod tutorial, but for some strange reason Minecraft cant find my textures.
I have tried to work this out on my own, but really haven't found a solution. So just take a look at my code and errors, and if you see what I have done wrong, point it out for me. Thanks
The Error (While running minecraft)
java.lang.RuntimeException: java.lang.Exception: Image not found: /Gui/NethSword.png
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1451)
at net.minecraft.src.ModLoader.onTick(ModLoader.java:1104)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:922)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: Image not found: /Gui/NethSword.png
at net.minecraft.src.ModLoader.loadImage(ModLoader.java:1024)
at net.minecraft.src.ModLoader.registerAllTextureOverrides(ModLoader.java:1443)
... 5 more
--- END ERROR REPORT 843d9314 ----------
Yes, this is in the same file as the code for the tools themselves.
If you are wondering why the heck I didn't just post on here in the first place, its because I'm trying to learn how to troubleshoot and be able to mod and write code on my own. After all, I plan to make a mod to release, so I don't want to be bothering everyone with questions all the time.
(No it wont just be lame netherrack tools, these are me learning how to mod, but they will still be in the initial release. )
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 20c3c3db --------
Generated 4/30/12 3:38 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_04-ea, Oracle Corporation
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 4200 Series version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.ArrayIndexOutOfBoundsException: -90
at net.minecraft.src.ExtendedBlockStorage.setExtBlockID(ExtendedBlockStorage.java:83)
at net.minecraft.src.Chunk.<init>(Chunk.java:113)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:290)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:93)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:119)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:654)
at net.minecraft.src.World.getBlockId(World.java:547)
at net.minecraft.src.SpawnerAnimals.canCreatureTypeSpawnAtLocation(SpawnerAnimals.java:204)
at net.minecraft.src.SpawnerAnimals.performSpawning(SpawnerAnimals.java:118)
at net.minecraft.src.World.tick(World.java:2851)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1903)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT e3d0cc92 ----------
While it may slow down the client slightly having multiple mod_ classes, it doesn't really matter. However, it makes it a lot easier to keep it all in one mod_ class.
so your saying i stem all my mods from one "mod_" class? if so what should i name it?
Name it what you want, but it still must have the mod_ at the beginning. Its easiest to name it the mod's name. The only thing that matters is the "mod_" For example, my basic mod's name is "mod_NetherTools.java"
i still feel like an idoit, if i want multiple blocks to have the exact same properties but different textures, would i need multi classes such as Mod_greenstonelight, Mod_bluestonelight and Mod_purplestonelight. or would i just need to make extensions of a Mod_colorlights? If i need extensions, how to i do so?
i sill feel like an idoit, if i want multiple blocks to have the exact same properties but different textures, would i need multi classes such as Mod_greenstonelight, Mod_bluestonelight and Mod_purplestonelight. or would i just need to make extensions of a Mod_colorlights? If i need extensions, how to i do so?
I would just go with making separate Block***** classes for each with copy paste (with some changes to fit it).
TechGuy doesn't cover GUI's, so I am not going to help you in this thread. Go to the Mod Development forum.
Make a loop for each ore, and then loops for your structures.
Everytime I try to double click on decompile.bat on the getting started step, it comes up with this message:
The system cannot find the path specified.
Press any key to continue...
How do I get it to work?
-Edit-
I re downloaded mcp and now I cant even put the bin folder into 'jars'...
RenderBipedCopy: http://pastebin.com/3kj5MEL
ModelBipedCopy: http://pastebin.com/kF5EAZk5
Sorry, but you can't specify exactly how your ores generate. It is a random game function.
You have to reference where your things are. mod_StrongGold.StrongGold for example instead of just StrongGold. Are you using Eclipse? It should have detected these problems if you are.
This is the code for the crafting recipes (no bugs in eclipse, its all set up properly):
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Item.wheat});
ModLoader.addRecipe(new ItemStack(Haybale, 1), new Object [] {"###", "###", '#', Block.tallGrass});
No errors, I have no idea why this is happening. Any help?
Is Haybale in the same class as this recipe?. If so. i dont know. But if its not. You have to make it. (new ItemStack(NAMEOFCLASS.Haybale, 1)
Ouh andyeah. Make Character.valueOf('#'), Item.wheat. and the same for grass
Just tried, didn't work. :/ No errors, just doesn't work.
And yes, same class.
Post your code so I can give you an example.
He changed your recipe when he posted it. Try it with the Character.valueOfs but make sure it is the correct recipe.
Put
in the items public static final line.
together they are powerful beyond imagination."
Are you on Windows, OSX, or Linux? I use Macs, and StuffIt is the program I use. On Windows, I have heard that 7-Zip or WinRar work fine. As for Linux, I am not sure. I could find out if you want me to though.
I have tried to work this out on my own, but really haven't found a solution. So just take a look at my code and errors, and if you see what I have done wrong, point it out for me. Thanks
The Error (While running minecraft)
Heres my code (NetherTools once again )
Yes, this is in the same file as the code for the tools themselves.
If you are wondering why the heck I didn't just post on here in the first place, its because I'm trying to learn how to troubleshoot and be able to mod and write code on my own. After all, I plan to make a mod to release, so I don't want to be bothering everyone with questions all the time.
(No it wont just be lame netherrack tools, these are me learning how to mod, but they will still be in the initial release. )
Although this is an amazing tutorial.
Mods loaded: 2
ModLoader 1.2.5
mod_Krity 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 20c3c3db --------
Generated 4/30/12 3:38 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_04-ea, Oracle Corporation
VM: Java HotSpot™ 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Mobility Radeon HD 4200 Series version 3.2.9704 Compatibility Profile Context, ATI Technologies Inc.
java.lang.ArrayIndexOutOfBoundsException: -90
at net.minecraft.src.ExtendedBlockStorage.setExtBlockID(ExtendedBlockStorage.java:83)
at net.minecraft.src.Chunk.<init>(Chunk.java:113)
at net.minecraft.src.ChunkProviderGenerate.provideChunk(ChunkProviderGenerate.java:290)
at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:93)
at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:119)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:654)
at net.minecraft.src.World.getBlockId(World.java:547)
at net.minecraft.src.SpawnerAnimals.canCreatureTypeSpawnAtLocation(SpawnerAnimals.java:204)
at net.minecraft.src.SpawnerAnimals.performSpawning(SpawnerAnimals.java:118)
at net.minecraft.src.World.tick(World.java:2851)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1903)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:870)
at net.minecraft.client.Minecraft.run(Minecraft.java:801)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT e3d0cc92 ----------
so your saying i stem all my mods from one "mod_" class? if so what should i name it?
Name it what you want, but it still must have the mod_ at the beginning. Its easiest to name it the mod's name. The only thing that matters is the "mod_" For example, my basic mod's name is "mod_NetherTools.java"
i still feel like an idoit, if i want multiple blocks to have the exact same properties but different textures, would i need multi classes such as Mod_greenstonelight, Mod_bluestonelight and Mod_purplestonelight. or would i just need to make extensions of a Mod_colorlights? If i need extensions, how to i do so?
I would just go with making separate Block***** classes for each with copy paste (with some changes to fit it).