I was just wondering if you could make me a custom ore mod, I really suck at this. All I want are rubys and the tools and armor, thanks! Make it like the best mineral like diamond.
I was just wondering if you could make me a custom ore mod, I really suck at this. All I want are rubys and the tools and armor, thanks! Make it like the best mineral like diamond.
Search the mods section here, or look on PMC. I'm 100% sure there is a mod like this out there :).
I think Ill just start fresh... it doesnt seem to be working.
Another thing I just noticed is, I load all me blocks and items into the PreInit constructor instead of the Init one, that could be causing your textures to not load, as Minecraft loads textures, before the Mojang screen shows up.
so... i have a serious problem... i found out the ores are indeed spawning but.... after removing stone, dirt, etc i found out where its spawning and...
it took all 3 ores, and jam packed them air tight into this vein that goes on forever. It's always at spawn.. the ore don't spawn anywhere else...
code
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.limestone, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.dirtDry, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.lavastone, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
so... i have a serious problem... i found out the ores are indeed spawning but.... after removing stone, dirt, etc i found out where its spawning and...
it took all 3 ores, and jam packed them air tight into this vein that goes on forever. It's always at spawn.. the ore don't spawn anywhere else...
code
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.limestone, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.dirtDry, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int i = 0; i < 70; i++)
{
int randPosX = chunkX + rand.nextInt(16);
int randPosY = rand.nextInt(256);
int randPosZ = chunkX + rand.nextInt(16);
(new WorldGenMinable(modMain.lavastone, 50)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
Your problem's right there in front of you. Well, two problems I can pinpoint in ore generation and 1 in your flower generation.
ORES
1. The i<70 is basically telling Minecraft how many times you want to spawn the ore per chunk. Keep that low if you want them to spawn more rarely. NOTE: This does not tell Minecraft the size of your veins for the ore.
2. 50. That number. It's extremely high. THAT'S what tells you about your vein size. Shrink that number down to make the veins smaller. (15 seems reasonable) I think the creator of this thread might have said it but if not, the ores spawn 50 per vein.
Random random;
int veinSize;
void ... {
for(...) {
...
random = new Random();
veinSize = random.nextInt(integer)+1; (Remember, set it one below what you want and then add the 1 because code starts from 0, not 1. I.e. 14)
(new WorldGenMinable(modMain.lavastone, veinSize)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
FLOWERS:
Easy fix. Make an if statement that says if the block is equal to dirt/grass, then it spawns. Else, don't spawn. Right now, it's probably only set to spawn at a height and that's that.
It still doesn't spawn any outide that vein... Yes the ores are less jam-packed but after flying away and searching again, there's absolutely no sign of it
the flowers spawn no where else but the spawn. It's not that they're being spawned on blocks that they shouldnt, i also have a bush block that is also being mass spawned in that location and the flowers are spawning on those as well.. so i have that nasty little cluster of flowers, bushes, and mushrooms, but they are nowhere else on the map.
edit: just confirmed that the ore is absolutely not spawning anywhere else via McEdit
It still doesn't spawn any outide that vein... Yes the ores are less jam-packed but after flying away and searching again, there's absolutely no sign of it
the flowers spawn no where else but the spawn. It's not that they're being spawned on blocks that they shouldnt, i also have a bush block that is also being mass spawned in that location and the flowers are spawning on those as well.. so i have that nasty little cluster of flowers, bushes, and mushrooms, but they are nowhere else on the map.
How far down did you set the i variable? It could be that you set it so far low that it just rarely spawns per chunk.
Flowers spawning around spawn only? I haven't actually tried doing floral spawning so I can't honestly help you out there. Sorry. 3:
Textures are different
to texture something you need to...
FIRST: create a new package in src/main/java called assets.YOURMODID.textures.blocks(or items, or armor, etc..depending on what you want to texture)
SECOND: create a texture for your object using GIMP or MSPaint(in my opinion MSPaint sucks)
THIRD: export the texture to "the forge folder on your desktop/src/main/java/assets/YOURMODID/textures/blocks(or items, or armor, etc...you get the idea)"
Fourth: put these lines of code when you type in your blocks/items/etc.. contructor, for example
FOR BLOCKS
yourBlock = new YourBlock(Material.rock).setCreativeTab(tabName).setBlockName("canBeAnything")
put after that(you may already know from seeing my block tut), .setBlockTextureName(MODID + ":" + "THENAMEOFTHETEXTUREYOUCREATED.png");
Someone correct me if I'm wrong, but you shouldn't be adding .png to the end of your texture name, since this is handled automatically (unless the filename of your texture is, in fact, sometexture.png.png. Appending the extension unnecessarily will trigger a FileNotFoundException.
Another thing I just noticed is, I load all me blocks and items into the PreInit constructor instead of the Init one, that could be causing your textures to not load, as Minecraft loads textures, before the Mojang screen shows up.
That shouldn't make any bit of difference. These loading stages are what forge uses to load mods both cleanly and logically, especially when multiple mods require friendly interaction. They discourage you the modder from trying to add a recipe for a block that hasn't been registered yet, whether it be a recipe for a block within your own mod or a recipe for block123 in modXYZ. While you may know where and when things load in your own mod (and can easily prevent referencing something too early,) you may not know when modXYZ's block123 is being registered. Which is what makes these loading stages so handy. For example, if the modder for modXYZ is following proper convention, he will be registering his blocks in preinit() so that you can safely register recipes during init() that references his blocks. Forge executes the preinit() of all active mods before executing the init() of all active mods and so on.
As far as I understand, the requisite Minecraft resources are always going to load before forge ever executes the preinit() stage of any active mods, which is by design.
I think Ill just start fresh... it doesnt seem to be working.
I was having an annoying referencing issue too when attempting to load textures. Post your console output (from the Console window/tab in Eclipse.) If it's failing to load your texture, there will probably be an Exception being thrown which is being output to the console. I can almost guarantee it will be a FileNotFoundException.
Would you mind showing how to create custom slabs and get them to stack and when middle click it return the custom slab instead of a stone slab. I been trying to do this with obsidian. I get the slab but everything else does not work for me.
In the Main Mod File, use this line of code:
In the Block File, where you setBlockName, make that name the same as the "public static Block blockName;". Also, the texture name needs to be:
With all of this being said, everything should work. If it doesn't, try moving everything in the Main Mod File from Init, to PreInit.
Search the mods section here, or look on PMC. I'm 100% sure there is a mod like this out there :).
No problem
Another thing I just noticed is, I load all me blocks and items into the PreInit constructor instead of the Init one, that could be causing your textures to not load, as Minecraft loads textures, before the Mojang screen shows up.
it took all 3 ores, and jam packed them air tight into this vein that goes on forever. It's always at spawn.. the ore don't spawn anywhere else...
code
for (int i = 0; i < 70; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(256); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.limestone, 50)).generate(world, rand, randPosX, randPosY, randPosZ); } for (int i = 0; i < 70; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(256); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.dirtDry, 50)).generate(world, rand, randPosX, randPosY, randPosZ); } for (int i = 0; i < 70; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(256); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.lavastone, 50)).generate(world, rand, randPosX, randPosY, randPosZ); } }My Planetminecraft Page
it looks like the same thing is happening with my flowers
My Planetminecraft Page
Your problem's right there in front of you. Well, two problems I can pinpoint in ore generation and 1 in your flower generation.
ORES
1. The i<70 is basically telling Minecraft how many times you want to spawn the ore per chunk. Keep that low if you want them to spawn more rarely. NOTE: This does not tell Minecraft the size of your veins for the ore.
2. 50. That number. It's extremely high. THAT'S what tells you about your vein size. Shrink that number down to make the veins smaller. (15 seems reasonable) I think the creator of this thread might have said it but if not, the ores spawn 50 per vein.
int veinSize;
void ... {
for(...) {
...
random = new Random();
veinSize = random.nextInt(integer)+1; (Remember, set it one below what you want and then add the 1 because code starts from 0, not 1. I.e. 14)
(new WorldGenMinable(modMain.lavastone, veinSize)).generate(world, rand, randPosX, randPosY, randPosZ);
}
}
FLOWERS:
Easy fix. Make an if statement that says if the block is equal to dirt/grass, then it spawns. Else, don't spawn. Right now, it's probably only set to spawn at a height and that's that.
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
the flowers spawn no where else but the spawn. It's not that they're being spawned on blocks that they shouldnt, i also have a bush block that is also being mass spawned in that location and the flowers are spawning on those as well.. so i have that nasty little cluster of flowers, bushes, and mushrooms, but they are nowhere else on the map.
edit: just confirmed that the ore is absolutely not spawning anywhere else via McEdit
My Planetminecraft Page
How far down did you set the i variable? It could be that you set it so far low that it just rarely spawns per chunk.
Flowers spawning around spawn only? I haven't actually tried doing floral spawning so I can't honestly help you out there. Sorry. 3:
YouTube: UnitatoGaming
Minecraft: DOOMsolider45
CEO/Co-Founder of Rinato Games and CEO/Founder of Hybridia Studios
edit: apparently the flowers are spawning underground too.....
package com.lecapria.client.core.handlers; import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS; import static net.minecraftforge.event.terraingen.OreGenEvent.GenerateMinable.EventType.DIRT; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenFlowers; import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.OreGenEvent; import net.minecraftforge.event.terraingen.TerrainGen; import com.lecapria.modMain.modMain; import cpw.mods.fml.common.IWorldGenerator; public class WorldGenMod implements IWorldGenerator { public WorldGenerator mushroomGlowGen; public WorldGenerator flowerPurpleGen; public WorldGenerator flowerWhiteGen; public WorldGenerator fireLilyGen; public WorldGenerator oreMythrilEndGen; public WorldGenerator bushesGen; @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId){ case -1: generateInNether(world, random, chunkX * 16, chunkZ * 16); break; case 0: generateInOverworld(world, random, chunkX * 16, chunkZ * 16); break; case 1: generateInEnd(world, random, chunkX * 16, chunkZ * 16); break; } } private void generateInEnd(World world, Random random, int x, int z) { this.decorateEnd(world, random, x, z); } private void generateInOverworld(World world, Random rand, int chunkX, int chunkZ) { for (int i = 0; i < 1; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(64); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.oreMythril, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } for (int i = 0; i < 5; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(200); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.limestone, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } for (int i = 0; i < 5; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(200); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.dirtDry, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } for (int i = 0; i < 5; i++) { int randPosX = chunkX + rand.nextInt(16); int randPosY = rand.nextInt(200); int randPosZ = chunkX + rand.nextInt(16); (new WorldGenMinable(modMain.lavastone, 10)).generate(world, rand, randPosX, randPosY, randPosZ); } this.decorateOverWorld(world, rand, chunk_X, chunk_Z); } private void generateInNether(World world, Random random, int i, int j) { this.decorateNether(world, random, i, j); } public void decorateOverWorld(World par1World, Random par2Random, int par3, int par4) { this.flowerPurpleGen = new WorldGenFlowers(modMain.flowerPurple); this.flowerWhiteGen = new WorldGenFlowers(modMain.flowerWhite); this.mushroomGlowGen = new WorldGenFlowers(modMain.mushroomGlow); this.bushesGen = new WorldGenModShrub(modMain.bush, bushesPerChunk); if (this.currentWorld != null) { throw new RuntimeException("Already decorating!!"); } else { this.currentWorld = par1World; this.randomGenerator = par2Random; this.chunk_X = par3; this.chunk_Z = par4; this.decorateOverWorld(); this.currentWorld = null; this.randomGenerator = null; } } public void decorateNether(World par1World, Random par2Random, int par3, int par4) { this.fireLilyGen = new WorldGenFlowers(modMain.fireLily); if (this.currentWorld != null) { throw new RuntimeException("Already decorating!!"); } else { this.currentWorld = par1World; this.randomGenerator = par2Random; this.chunk_X = par3; this.chunk_Z = par4; this.decorateNether(); this.currentWorld = null; this.randomGenerator = null; } } public void decorateEnd(World par1World, Random par2Random, int par3, int par4) { this.oreMythrilEndGen = new WorldGenEndMinable(modMain.oreMythrilEnd, 32); if (this.currentWorld != null) { throw new RuntimeException("Already decorating!!"); } else { this.currentWorld = par1World; this.randomGenerator = par2Random; this.chunk_X = par3; this.chunk_Z = par4; this.decorateEnd(); this.currentWorld = null; this.randomGenerator = null; } } public int flowersPerChunk; public int mushroomsPerChunk; public int orePerChunk; public int bushesPerChunk; protected void decorateOverWorld() { int i1; int j; int k; this.flowersPerChunk = 2; this.mushroomsPerChunk = 2; this.bushesPerChunk = 1; int l; boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); for (j = 0; doGen && j < this.flowersPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(128); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.flowerWhiteGen.generate(this.currentWorld, this.randomGenerator, k, l, i1); if (this.randomGenerator.nextInt(3) == 0) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(128); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.flowerPurpleGen.generate(this.currentWorld, this.randomGenerator, k, l, i1); } } for (j = 0; doGen && j < this.mushroomsPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(128); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.mushroomGlowGen.generate(this.currentWorld, this.randomGenerator, k, l, i1); } for (j = 0; doGen && j < this.bushesPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(128); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.bushesGen.generate(this.currentWorld, this.randomGenerator, k, l, i1); } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); } protected void decorateNether() { int i1; int j; int k; this.flowersPerChunk = 3; int l; boolean doGen = TerrainGen.decorate(currentWorld, randomGenerator, chunk_X, chunk_Z, FLOWERS); for (j = 0; doGen && j < this.flowersPerChunk; ++j) { k = this.chunk_X + this.randomGenerator.nextInt(16) + 8; l = this.randomGenerator.nextInt(256); i1 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; this.fireLilyGen.generate(this.currentWorld, this.randomGenerator, k, l, i1); } MinecraftForge.EVENT_BUS.post(new DecorateBiomeEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); } protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) { for (int l = 0; l < par1; ++l) { int i1 = this.chunk_X + this.randomGenerator.nextInt(16); int j1 = this.randomGenerator.nextInt(par4 - par3) + par3; int k1 = this.chunk_Z + this.randomGenerator.nextInt(16); par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, i1, j1, k1); } } protected void decorateEnd() { int j; this.orePerChunk = 3; boolean doGen = TerrainGen.generateOre(currentWorld, randomGenerator, oreMythrilEndGen, chunk_X, chunk_Z, DIRT); for (j = 0; doGen && j < this.orePerChunk; ++j) { this.genStandardOre1(20, this.oreMythrilEndGen, 0, 128); } MinecraftForge.ORE_GEN_BUS.post(new OreGenEvent.Pre(currentWorld, randomGenerator, chunk_X, chunk_Z)); } }My Planetminecraft Page
That shouldn't make any bit of difference. These loading stages are what forge uses to load mods both cleanly and logically, especially when multiple mods require friendly interaction. They discourage you the modder from trying to add a recipe for a block that hasn't been registered yet, whether it be a recipe for a block within your own mod or a recipe for block123 in modXYZ. While you may know where and when things load in your own mod (and can easily prevent referencing something too early,) you may not know when modXYZ's block123 is being registered. Which is what makes these loading stages so handy. For example, if the modder for modXYZ is following proper convention, he will be registering his blocks in preinit() so that you can safely register recipes during init() that references his blocks. Forge executes the preinit() of all active mods before executing the init() of all active mods and so on.
As far as I understand, the requisite Minecraft resources are always going to load before forge ever executes the preinit() stage of any active mods, which is by design.
I was having an annoying referencing issue too when attempting to load textures. Post your console output (from the Console window/tab in Eclipse.) If it's failing to load your texture, there will probably be an Exception being thrown which is being output to the console. I can almost guarantee it will be a FileNotFoundException.
Just make an item, extend the ItemFood class, and add (int heal, int saturation, boolean wolfmeat) to the method.
The setup command for Mac is much different than Windows.
Run these commands via Terminal in order:
cd (drag your forge folder in here)
./gradlew setupDecompWorkspace eclipse
./gradlew --refresh-dependencies
./gradlew setupDecompWorkspace --debug
./gradlew eclipse --debug
After that, you should be good to go. (If the seconds step fails, retry it and it will work than).
To compile your mod, type "./gradlew build".
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumCheck out this mod, which now has a 1.8 brother to the 1.7 version.
hi i need help making mobs drop stuff from my mod such as calamari or muttonEDIT: after a bit of experimenting i fixed it