hmm... wish I could help you more, but I haven't done more than skim over the tutorial for generation, but if you look in it, there might be something... sorry I couldn't be of more assistance...
Well... at least you tried!
I clicked the button to say thanks.
EDIT:
At least I have other stuff to do on my mod.
I managed to make the block generate, but I can't tell if it's too common or too rare
But now there's one single thing that scares me a bit:
Everytime I create a new world, it says that there's a stronghold that was placed in an invalid biome at (coords).
EDIT:
Nevermind, it doesn't happen anymore... don't know why.
I managed to make the block generate, but I can't tell if it's too common or too rare
But now there's one single thing that scares me a bit:
Everytime I create a new world, it says that there's a stronghold that was placed in an invalid biome at (coords).
EDIT:
Nevermind, it doesn't happen anymore... don't know why.
how did you end up resolving the issue? just out of curiosity..
Ok I am trying to make a new block. But when ever I try to recompile it gives me a ton of errors.
Is there something wrong with my code?
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block Lightdirt = new Lightdirt(125, 0).setBlockName("Lightdirt").setHardness
(0.5F).setResistance(0.5F).setLightValue(1F);
public void load()
{
Lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Lightdirt.png");
ModLoader.registerBlock(Lightdirt);
ModLoader.addName(Lightdirt, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(Lightdirt, 2), new Object [] {"###", "#|#", "###", Character.valueOf('#'), Block.dirt, Character.valueOf('|')
('Item.lightStoneDust')
});
}
public String getVersion()
{ return "1.2.5";
}
}
And here is my BlockLightdirt.java code:
package net.minecraft.src;
import java.util.Random;
public class BlockLightdirt extends Block
{
public BlockLightdirt(int i, int j)
{
super(i, j, Material.ground);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Lightdirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
Ok I am trying to make a new block. But when ever I try to recompile it gives me a ton of errors.
Is there something wrong with my code?
package net.minecraft.src;
public class mod_Block extends BaseMod
{
public static final Block Lightdirt = new Lightdirt(125, 0).setBlockName("Lightdirt").setHardness
(0.5F).setResistance(0.5F).setLightValue(1F);
public void load()
{
Lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Lightdirt.png");
ModLoader.registerBlock(Lightdirt);
ModLoader.addName(Lightdirt, "In-Game Name Here");
ModLoader.addRecipe(new ItemStack(Lightdirt, 2), new Object [] {"###", "#|#", "###", Character.valueOf('#'), Block.dirt, Character.valueOf('|')
('Item.lightStoneDust')
});
}
public String getVersion()
{ return "1.2.5";
}
}
And here is my BlockLightdirt.java code:
package net.minecraft.src;
import java.util.Random;
public class BlockLightdirt extends Block
{
public BlockLightdirt(int i, int j)
{
super(i, j, Material.ground);
}
public int idDropped(int i, Random random, int j)
{
return mod_Block.Lightdirt.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}}
K Thanks in advance.
Post the errors please. If you don't know how to copy from DOS; you just right click on the window, click select all, press enter then paste it here, preferably inbetween code tags.
[CODE.]
error here!
[/CODE.]
Without the fullstops.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Hey Techguy
I Really like your tuttorial but i dont know how to make world gen with my block
Sooo...
can you teach me??and how to make .java file to .class file
im NEWBIE in modding :Dand how to make .java file to .class file
im NEWBIE in modding
public static final Block TestBlock = new Block(160, 0).setBlockName("Test Block").setHardness(3F).setResistance(4F).setLightValue(1F);
it should be more along the lines of
public static final Block TestBlock = new BlockStone(160, 0).setBlockName("Test Block").setHardness(3F).setResistance(4F).setLightValue(1F);
This is right, but it's not the only thing that causes errors. You don't put new Block because you have to direct your class file for your Block. If you used new = MyBlock, then you have to create MyBlock. The error is caused by this.
how did you end up resolving the issue? just out of curiosity..
I put the following code in mod_***:
for(int k = 0; k < 6; k++)
{
int RandPosX = chunkX + random.nextInt(16);
int RandPosY = random.nextInt(256);
int RandPosZ = chunkZ + random.nextInt(16);
(new WorldGenStarBlock()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
And I deleted some lines in the WorldGenStarBlock code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenStarBlock extends WorldGenerator
{
public WorldGenStarBlock()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.grass.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k))
{
world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4));
}
if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.sand.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k))
{
world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4));
}
return true;
}
}
And... that's all.
EDIT MADE 3 SECONDS AFTER POSTING:
As you can see, I made it so the block can generate on sand, too. I might add something so that the block would be more common in mushroom biomes.
for(int k = 0; k < 6; k++)
{
int RandPosX = chunkX + random.nextInt(16);
int RandPosY = random.nextInt(256);
int RandPosZ = chunkZ + random.nextInt(16);
(new WorldGenStarBlock()).generate(world, random, RandPosX, RandPosY, RandPosZ);
}
And I deleted some lines in the WorldGenStarBlock code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenStarBlock extends WorldGenerator
{
public WorldGenStarBlock()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.grass.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k))
{
world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4));
}
if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.sand.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k))
{
world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4));
}
return true;
}
}
And... that's all.
EDIT MADE 3 SECONDS AFTER POSTING:
As you can see, I made it so the block can generate on sand, too. I might add something so that the block would be more common in mushroom biomes.
Awesome I'll have to remember that if I want to generate a block in a world, and I have a feeling I will
Also, @zildjian97 I'll remember that next time I'm helping someone I just thought giving the "easier" way would be, well, easier so I hadn't thought about that
If possible someone could make a modloader basic file class(only with the block information) and a block class, and post it here for download so I could check what I am doing wrong. Can someone do it ?
If possible someone could make a modloader basic file class(only with the block information) and a block class, and post it here for download so I could check what I am doing wrong. Can someone do it ?
Just compare with the code on the op under the block tutorial, it will provide the most accurate comparison since you are using this tutorial.
Well... at least you tried!
I clicked the button to say thanks.
EDIT:
At least I have other stuff to do on my mod.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumThank you
I managed to make the block generate, but I can't tell if it's too common or too rare
But now there's one single thing that scares me a bit:
Everytime I create a new world, it says that there's a stronghold that was placed in an invalid biome at (coords).
EDIT:
Nevermind, it doesn't happen anymore... don't know why.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumhow did you end up resolving the issue? just out of curiosity..
Is there something wrong with my code?
package net.minecraft.src; public class mod_Block extends BaseMod { public static final Block Lightdirt = new Lightdirt(125, 0).setBlockName("Lightdirt").setHardness (0.5F).setResistance(0.5F).setLightValue(1F); public void load() { Lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Lightdirt.png"); ModLoader.registerBlock(Lightdirt); ModLoader.addName(Lightdirt, "In-Game Name Here"); ModLoader.addRecipe(new ItemStack(Lightdirt, 2), new Object [] {"###", "#|#", "###", Character.valueOf('#'), Block.dirt, Character.valueOf('|') ('Item.lightStoneDust') }); } public String getVersion() { return "1.2.5"; } }And here is my BlockLightdirt.java code:
package net.minecraft.src; import java.util.Random; public class BlockLightdirt extends Block { public BlockLightdirt(int i, int j) { super(i, j, Material.ground); } public int idDropped(int i, Random random, int j) { return mod_Block.Lightdirt.blockID; } public int quantityDropped(Random random) { return 1; }}K Thanks in advance.
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumpackage net.minecraft.src; public class mod_Block extends BaseMod { public static final Block Lightdirt = new BlockDirt(125, 0).setBlockName("Lightdirt").setHardness (0.5F).setResistance(0.5F).setLightValue(1F); public void load() { Lightdirt.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Lightdirt.png"); ModLoader.registerBlock(Lightdirt); ModLoader.addName(Lightdirt, "In-Game Name Here"); ModLoader.addRecipe(new ItemStack(Lightdirt, 2), new Object [] {"###", "#|#", "###", Character.valueOf('#'), Block.dirt, Character.valueOf('|') ('Item.lightStoneDust') }); } public String getVersion() { return "1.2.5"; } }Hey thanks for your time but I still cant get it to work.
Post the errors please. If you don't know how to copy from DOS; you just right click on the window, click select all, press enter then paste it here, preferably inbetween code tags.
[CODE.]
error here!
[/CODE.]
Without the fullstops.
together they are powerful beyond imagination."
I Really like your tuttorial but i dont know how to make world gen with my block
Sooo...
can you teach me??and how to make .java file to .class file
im NEWBIE in modding :Dand how to make .java file to .class file
im NEWBIE in modding
This is right, but it's not the only thing that causes errors. You don't put new Block because you have to direct your class file for your Block. If you used new = MyBlock, then you have to create MyBlock. The error is caused by this.
ModLoader.addName([b]testblock[/b],"Test Block"); ModLoader.registerBlock(testblock); testblock.blockIndexInTexture = ModLoader.addOverride("/terrain.png","/russo/testblock.png"); ModLoader.addRecipe(new ItemStack(testblock,1), new Object []{ "X", Character.valueOf('X'), Block.dirt});testblock there should be TestBlock, because that's what you stated in the public static final line. That's all.
The file reobfuscate.bat converts your java files into class files. Make sure you run recompile.bat first before running reobfuscate.bat.
I put the following code in mod_***:
for(int k = 0; k < 6; k++) { int RandPosX = chunkX + random.nextInt(16); int RandPosY = random.nextInt(256); int RandPosZ = chunkZ + random.nextInt(16); (new WorldGenStarBlock()).generate(world, random, RandPosX, RandPosY, RandPosZ); }And I deleted some lines in the WorldGenStarBlock code:
package net.minecraft.src; import java.util.Random; public class WorldGenStarBlock extends WorldGenerator { public WorldGenStarBlock() { } public boolean generate(World world, Random random, int i, int j, int k) { if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.grass.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k)) { world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4)); } if(world.isAirBlock(i, j, k) && world.getBlockId(i, j - 1, k) == Block.sand.blockID && mod_DatMod.StarBlock.canPlaceBlockAt(world, i, j, k)) { world.setBlockAndMetadata(i, j, k, mod_DatMod.StarBlock.blockID, random.nextInt(4)); } return true; } }And... that's all.
EDIT MADE 3 SECONDS AFTER POSTING:
As you can see, I made it so the block can generate on sand, too. I might add something so that the block would be more common in mushroom biomes.
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumAwesome
Also, @zildjian97 I'll remember that next time I'm helping someone
If possible someone could make a modloader basic file class(only with the block information) and a block class, and post it here for download so I could check what I am doing wrong. Can someone do it ?
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumJust compare with the code on the op under the block tutorial, it will provide the most accurate comparison since you are using this tutorial.
-
View User Profile
-
View Posts
-
Send Message
Curse Premium... It seems like we are going in circles here
This is the error: http://imgur.com/ATlTv
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI probably should have asked this at the same time, but can you post the current code you have? (both classes)