Jump to content

Landuros

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Landuros's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Is there any way to import or use other mods' (such as Buildcraft or IC2) items and blocks to use in my mod? Specifically, I want to use some of BuildCraft and Tinker's Construct ingots to use in my Gui block. Could someone kindly list the steps in order to do so?
  2. Oh, thank you, I will try that... My brain thought that Blocks.iron_ore was the material for some reason. Edit: Yup, that was the issue. Thank you to kremi151, jeffryfisher and Draco18s for quickly helping me with the problem.
  3. I'm newish to Minecraft coding and how the game works but I have some knowledge on other Java programs and mods. I recently tried to spawn an ore (called money ore) but it doesn't spawn. Could someone please check my code for any errors? package com.landuros.world; import java.util.Random; import com.landuros.blocks.MBlocks; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; public class MOre implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch(world.provider.dimensionId) { case -1: generateNether(random, chunkX * 16, chunkZ * 16, world); break; case 0: generateOverworld(random, chunkX * 16, chunkZ * 16, world); break; case 1: generateEnd(random, chunkX * 16, chunkZ * 16, world); break; } } private void addOre(Block block, Block blockspawn, Random random, World world, int posX, int posZ, int minY, int maxY, int minVein, int maxVein, int spawnChance) { for(int i = 0; i < spawnChance; i++) { int defaultChunkSize = 16; int xPos = posX + random.nextInt(defaultChunkSize); int yPos = minY + random.nextInt(maxY - minY); int zPos = posZ + random.nextInt(defaultChunkSize); new WorldGenMinable(block, (minVein + random.nextInt(maxVein - minVein)), blockspawn).generate(world, random, xPos, yPos, zPos); } } private void generateEnd(Random random, int chunkX, int chunkZ, World world) { } private void generateOverworld(Random random, int chunkX, int chunkZ, World world) { addOre(MBlocks.MoneyOre, Blocks.iron_ore, random, world, chunkX, chunkZ, 0, 150, 10, 50, 20); } private void generateNether(Random random, int chunkX, int chunkZ, World world) { } } I have another .java file that registers the World Gen and calls upon GameRegistry, and I don't think that's the problem. Also, could someone please confirm what the integers in this line of code represent? addOre(MBlocks.MoneyOre, Blocks.iron_ore, random, world, chunkX, chunkZ, 0, 150, 10, 50, 20); I'm pretty sure the first two are the minY and maxY values, and 50 is the spawn rate. Thanks
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.