“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Can you post your code please. Also, Modoader.addBiome adds the biome into generation.
You're not following my tutorial closely enough. Hint:
load() should be the contructor.
package net.minecraft.src;
public class mod_*** extends BaseMod
{
public static final Block Narcissus = new BlockNarcissusFlower(163, 0).setBlockName("Narcissus");
public static final Block Adonis = new BlockAdonisFlower(164, 0).setBlockName("Adonis");
public void load()
{
Narcissus.blockIndexInTexture = 3;
ModLoader.registerBlock(Narcissus);
ModLoader.addName(Narcissus, "Narcissus");
Adonis.blockIndexInTexture = 4;
ModLoader.registerBlock(Adonis);
ModLoader.addName(Adonis, "Adonis");
}
public void generateSurface(World world, Random random, int y, int z)
{
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = world.getHeightValue(randPosX, randPosZ);
int randPosZ = z + random.nextInt(16);
(new WorldGenMinable(Narcissus.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = world.getHeightValue(randPosX, randPosZ);
int randPosZ = z + random.nextInt(8);
(new WorldGenMinable(Adonis.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
Why can't I put the code correctly. Ugh. Damn font and color is showing up in the code.
package net.minecraft.src;
public class mod_*** extends BaseMod
{
public static final Block Narcissus = new BlockNarcissusFlower(163, 0).setBlockName("Narcissus");
public static final Block Adonis = new BlockAdonisFlower(164, 0).setBlockName("Adonis");
public void load()
{
Narcissus.blockIndexInTexture = 3;
ModLoader.registerBlock(Narcissus);
ModLoader.addName(Narcissus, "Narcissus");
Adonis.blockIndexInTexture = 4;
ModLoader.registerBlock(Adonis);
ModLoader.addName(Adonis, "Adonis");
}
public void generateSurface(World world, Random random, int y, int z)
{
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = world.getHeightValue(randPosX, randPosZ);
int randPosZ = z + random.nextInt(16);
(new WorldGenMinable(Narcissus.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = world.getHeightValue(randPosX, randPosZ);
int randPosZ = z + random.nextInt(8);
(new WorldGenMinable(Adonis.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
public String getVersion()
{
return "1.2.5";
}
}
Why can't I put the code correctly. Ugh. Damn font and color is showing up in the code.
Sorry, I thought you were generating a structure. Change it back to how you had it before:
public void generateSurface(World world, Random random, int y, int z)
{
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = random.nextInt(64);//or whatever value you had it set to
int randPosZ = z + random.nextInt(16);
(new WorldGenMinable(Narcissus.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = random.nextInt(64);//or whatever value you had it set to
int randPosZ = z + random.nextInt(8);
(new WorldGenMinable(Adonis.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
What problems were you having with it, if any? Sorry if you just told me, I'm really busy at the moment and have a lot on my mind.
Hi
I'm actually working on a mod where I need to have a dyable block. As I don't want to do it the "bad way" = creating a new block for each color
I would like to know if you know how to do it... ?
Mod Development or source code of Minecraft. It shows exactly how to do it.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
In the Ore Generation part, what does the "25" mean after the blockID? I am not experienced in Java, so I don't know...
It isn't so much Java, but rather just the ModLoader method for generating ores. Anyway, I believe the 25 is the number of blocks in the vein. I'm not sure, but I think I did explain that in the "Understanding the code" section of the tutorial.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Something weird happend when i set up my PATH variable. I copypasted the text in getting started without deleting the text that was already in PATH. SO i tried the MCP decompiler and it says it cant find the path specified. .
Heres whats in PATH: C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
Is it because i already have a PATH java thing in it? Or is it that there is supposed to be something different in path aside from JDK 1.6 or whatever. Thanks, -Krag
Sorry, I thought you were generating a structure. Change it back to how you had it before:
public void generateSurface(World world, Random random, int y, int z)
{
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = random.nextInt(64);//or whatever value you had it set to
int randPosZ = z + random.nextInt(16);
(new WorldGenMinable(Narcissus.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 12; i++)
{
int randPosX = y + random.nextInt(16);
int randPosY = random.nextInt(64);//or whatever value you had it set to
int randPosZ = z + random.nextInt(8);
(new WorldGenMinable(Adonis.blockID, 25)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
What problems were you having with it, if any? Sorry if you just told me, I'm really busy at the moment and have a lot on my mind.
Mod Development or source code of Minecraft. It shows exactly how to do it.
Uhmm, I want my flower to generate on the top of the block. With the code you gave me, it only showed me the errors once I created or load a world.
Its kind of irratating trying your adding an item method because u put ItemNameHere and i dont know wether to rename it as ItemMyItemName or Myitemname....its annoying ive tried for ages and all i get is errors because of it and i cant fix it
Dude, you need the create another class file with the same name you chose. If you put IteMyItemName then that's what you name your class file. Gosh, if you want to mod you have to understand everything carefully and patiently.
Dude, you need the create another class file with the same name you chose. If you put IteMyItemName then that's what you name your class file. Gosh, if you want to mod you have to understand everything carefully and patiently.
This. And if you don't know how to call a variable go and learn some basic java.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Uhmm, I want my flower to generate on the top of the block. With the code you gave me, it only showed me the errors once I created or load a world.
Create a new WorldGenFlowers and change it to suit your block instead of BlockFlower. Then just call it in the generateSurface method like you would any other WorldGen class(not the same as ores, check out the structure gen tutorials if you're not sure).
I've looked at BiomeGenOcean, BiomeGenRiver, and BiomeGenBase but it makes no sense, try looking at it yourself.
You should be looking at WorldGen classes, not BiomeGen classes. Go look at WorldGenLakes.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey, is it possible to spawn a structure only in one location? For example, at (0,0) (center of the world) coordinates?
In the structure gen tutorial here, the person makes the structure generate only at the spawn point. There may be a way to modify that to allow certain coordinates, but I'm not sure how to do it.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Another question, in my blocks code, I always import arraylist then put the method for making them show in creative mode. This day I added some more blocks and do the same, but it keeps giving me some errors while viewing the Creative Mode inventory. This is the error.
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 459cd966 --------
Generated 5/11/12 6:01 PM
Minecraft: Minecraft 1.2.5
OS: Windows XP (x86) version 5.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2/3DNOW! version 2.1.2, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.ItemStack.getIconIndex(ItemStack.java:106)
at net.minecraft.src.RenderItem.renderItemIntoGUI(RenderItem.java:389)
at net.minecraft.src.GuiContainer.drawSlotInventory(GuiContainer.java:223)
at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:72)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:970)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:869)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ee6b6928 ----------
I tried removing the things that allow them to show in creative but it still gives me some error. It also errors when I put something in the workbench. Why? What's the meaning of the code?
Make sure you registered the block. Not registering it normally give crashes like that because it tries to render it but it can't because it hasn't been registered.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Something weird happend when i set up my PATH variable. I copypasted the text in getting started without deleting the text that was already in PATH. SO i tried the MCP decompiler and it says it cant find the path specified. .
Heres whats in PATH: C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
Is it because i already have a PATH java thing in it? Or is it that there is supposed to be something different in path aside from JDK 1.6 or whatever. Thanks, -Krag
????
together they are powerful beyond imagination."
Why can't I put the code correctly. Ugh. Damn font and color is showing up in the code.
Sorry, I thought you were generating a structure. Change it back to how you had it before:
What problems were you having with it, if any? Sorry if you just told me, I'm really busy at the moment and have a lot on my mind.
Mod Development or source code of Minecraft. It shows exactly how to do it.
together they are powerful beyond imagination."
It isn't so much Java, but rather just the ModLoader method for generating ores. Anyway, I believe the 25 is the number of blocks in the vein. I'm not sure, but I think I did explain that in the "Understanding the code" section of the tutorial.
together they are powerful beyond imagination."
Heres whats in PATH: C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
Is it because i already have a PATH java thing in it? Or is it that there is supposed to be something different in path aside from JDK 1.6 or whatever. Thanks, -Krag
Uhmm, I want my flower to generate on the top of the block. With the code you gave me, it only showed me the errors once I created or load a world.
I mean like a new type of lake like size, shape, depth, material.
Dude, you need the create another class file with the same name you chose. If you put IteMyItemName then that's what you name your class file. Gosh, if you want to mod you have to understand everything carefully and patiently.
Just look at how the current lakes are made, then duplicate it, make your changes and then call it with the generateSurface method.
This. And if you don't know how to call a variable go and learn some basic java.
together they are powerful beyond imagination."
I've looked at BiomeGenOcean, BiomeGenRiver, and BiomeGenBase but it makes no sense, try looking at it yourself.
Create a new WorldGenFlowers and change it to suit your block instead of BlockFlower. Then just call it in the generateSurface method like you would any other WorldGen class(not the same as ores, check out the structure gen tutorials if you're not sure).
You should be looking at WorldGen classes, not BiomeGen classes. Go look at WorldGenLakes.
together they are powerful beyond imagination."
In the structure gen tutorial here, the person makes the structure generate only at the spawn point. There may be a way to modify that to allow certain coordinates, but I'm not sure how to do it.
together they are powerful beyond imagination."
Mods loaded: 5
ModLoader 1.2.5
mod_ThePercyJacksonMod 1.2.5
mod_PJModStructures 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT 459cd966 --------
Generated 5/11/12 6:01 PM
Minecraft: Minecraft 1.2.5
OS: Windows XP (x86) version 5.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2/3DNOW! version 2.1.2, NVIDIA Corporation
java.lang.NullPointerException
at net.minecraft.src.ItemStack.getIconIndex(ItemStack.java:106)
at net.minecraft.src.RenderItem.renderItemIntoGUI(RenderItem.java:389)
at net.minecraft.src.GuiContainer.drawSlotInventory(GuiContainer.java:223)
at net.minecraft.src.GuiContainer.drawScreen(GuiContainer.java:72)
at net.minecraft.src.EntityRenderer.updateCameraAndRender(EntityRenderer.java:970)
at net.minecraft.src.EntityRendererProxy.updateCameraAndRender(EntityRendererProxy.java:20)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:869)
at net.minecraft.client.Minecraft.run(Minecraft.java:747)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT ee6b6928 ----------
I tried removing the things that allow them to show in creative but it still gives me some error. It also errors when I put something in the workbench. Why? What's the meaning of the code?
together they are powerful beyond imagination."
Heres whats in PATH: C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jre6\bin
Is it because i already have a PATH java thing in it? Or is it that there is supposed to be something different in path aside from JDK 1.6 or whatever. Thanks, -Krag
Thanks for the tip, it looks like it should work.