Jump to content

dylbet121

Members
  • Posts

    3
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

dylbet121's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey I've been watching all of the tutorials, So I have just tried to make a simple Ore generation, but again I am still unable to load a block for generation. Here is my code. -------------------------------------------------------------------------------------------------------------------------- package geodeMod; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="medmod", name="Med Mod", version="1.1") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class main { @SidedProxy(clientSide = "mod_medmod.ClientProxymod_medmod", serverSide = "mod_medmod.common.CommonProxymod_medmod") public static ClientProxymod_medmod proxy = new ClientProxymod_medmod(); Block GeodeBlock; int GeodeBlockID; @PreInit public void preInti(FMLPreInitializationEvent event){ Configuration config = new Configuration(event.getSuggestedConfigurationFile()); GeodeBlockID = config.get("Block ID's", "GeodeBlock ID", 700).getInt(); config.save(); config.load(); } @Init public void load(FMLInitializationEvent event) { GeodeBlock = new BlockGeodeBlock(GeodeBlockID, 3, Material.rock).setHardness(42F).setResistance(5F).setBlockName("GeodeBlock"); gameRegisters(); languageRegisters(); proxy.registerRender(); } public void gameRegisters(){ GameRegistry.registerBlock(GeodeBlock); GameRegistry.registerWorldGenerator(new WorldGenGeode()); } public void languageRegisters(){ LanguageRegistry.addName(GeodeBlock, "Geode Block"); } @PreInit public void init(FMLPreInitializationEvent preEvent) { } } ------------------------------------------------------------------------------------------ package geodeMod; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class BlockGeodeBlock extends Block{ public BlockGeodeBlock(int id, int texture, Material mat){ super(id, texture, mat); this.setCreativeTab(CreativeTabs.tabBlock); } public String getTextureFile(){ return "/mod_medmod/spritesheet.png"; } } ------------------------------------------------------------------------------------------------------ package geodeMod; import java.util.Random; import cpw.mods.fml.common.IWorldGenerator; import net.minecraft.src.*; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; public class WorldGenGeode implements IWorldGenerator { public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider){ switch(world.provider.dimensionId){ case 0: generateSurface(world, random, chunkX*16, chunkZ*16); } } public void generateSurface(World world, Random random, int blockX, int blockZ){ int Xcoord = blockX + random.nextInt(16); int Ycoord = random.nextInt(60); int Zcoord = blockZ + random.nextInt(16); (new WorldGenMinable(geodeMod.BlockGeodeBlock.blockID, 12)).generate(world, random, Xcoord, Ycoord, Zcoord); } public void generateNether(){ } } ------------------------------------------------------------------------------------------------------ As usual the error is under (new WorldGenMinable(geodeMod.BlockGeodeBlock.blockID, If you can find something wrong please tell me. I'm also wondering if it is my project setup, my project goes as following geodeMod (package) main(class) Also last time Mazetar posted that I should use @mod annotations, but I am unsure of how to use that, If anyone has a good tutorial please tell me. thanks
  2. Hello there recently I have wanted to include a medditeranean village as part of my mod, To make this I need to include blocks from my mod but when I reference them like so public boolean generate(World world, Random rand, int i, int j, int k) { world.setBlockWithNotify(i, j, k, Block.blockDiamond.blockID); world.setBlockWithNotify(i + 1, j, k, mod_medmod.BlockTileBlock.blockID); return true; } the error is under mod_medmod.BlockTileBlock.blockID); the only suggestion from eclipse is to make blockID static this is obviously not the solution here is the rest of my code if it helps this is in the same package as the rest of my mod -------------------------------------------------------------------------------- package mod_medmod; import java.util.Random; import net.minecraft.src.BaseMod; import net.minecraft.world.World; public class mod_medmodextensionvillage extends BaseMod{ public Random ChunkGenRand; public int ChunkGenRandNum = 0; @Override public String getVersion() { return null; } @Override public void load() { } public void generateSurface(World world, Random rand, int i, int j) { ChunkGenRand = new Random(); ChunkGenRandNum = ChunkGenRand.nextInt( + 1; if(ChunkGenRandNum == 1) { for(int k = 0; k < 2; k++) { int RandPosX = i + rand.nextInt(16); int RandPosZ = j + rand.nextInt(16); int j1 = world.getHeightValue(RandPosX, RandPosZ); (new WorldGenVillageMed()).generate(world, rand, RandPosX, j1, RandPosZ); } } } } ---------------------------------------------------------------------------------------------- package mod_medmod; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import mod_medmod.main; ; public class WorldGenVillageMed extends WorldGenerator { public WorldGenVillageMed() { } public boolean generate(World world, Random rand, int i, int j, int k) { world.setBlockWithNotify(i, j, k, Block.blockDiamond.blockID); return true; } } --------------------------------------------------------------------------- Also If you know how, it would be highly appreciated if you could show me a method to put in so these blocks do not spawn on top of oceans and rivers, thankyou
×
×
  • Create New...

Important Information

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