• 0

    posted a message on [1.5.1] Modding Support: World Generation Help!
    Bumpyed Bump
    Posted in: Java Edition Support
  • 1

    posted a message on [1.5.1] Modding Support: World Generation Help!
    Hi everyone,

    I am fairly new to modding and java and have begun construction a mod using;

    MCP 744
    Forge Build 1.5.1-7.7.0.610
    Eclipse SDK 4.2.2

    My mod consists of a new block, which i wish to generate around the world like a ore.
    I created my block and was able to a place it in creative, I then added a new World
    Generation class which I set to generate my new block, after hours of searching I concluded
    that the block was not spawning.

    Problem: My new block is not generating around my world.

    BaseMod.java

    package mods.TFD.minecraft.BaseMod;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraftforge.common.MinecraftForge;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.Init;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.Mod.PostInit;
    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.FMLPostInitializationEvent;
    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 = "BaseMod", name = "BaseMod", version = "1.0.0.0")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
    public class BaseMod {
    @Instance("BaseMod")
    public static BaseMod instance;
    @SidedProxy(clientSide = "mods.TFD.minecraft.BaseMod.client.ClientProxy", serverSide = "mods.TFD.minecraft.BaseMod.CommonProxy")
    public static CommonProxy proxy;
    public static Block BaseBlock;
    @PreInit
    public void preInit(FMLPreInitializationEvent event) {
    }
    @Init
    public void load(FMLInitializationEvent event) {
      loadBlock();
      harvestLevel();
      registerLanguage();
      registerGame();
     
      GameRegistry.registerWorldGenerator(new BaseWorldGen());
    }
    @PostInit
    public void postInit(FMLPostInitializationEvent event) {
    }
    // EDIT THIS TO CHANGE FEATURES OF BLOCK
    private void loadBlock() {
      BaseBlock = new BaseBlock(3000, Material.rock,
        "TFD/minecraft/BaseMod:BaseBlock")
        .setUnlocalizedName("BaseBlock").setHardness(4.0F)
        .setResistance(50.0F).setStepSound(Block.soundStoneFootstep);
    }
    private void harvestLevel() {
      // 0 = wood, 1 = stone, 2 = iron, 3 = diamond
      MinecraftForge.setBlockHarvestLevel(BaseBlock, "pickaxe", 1);
    }
    private void registerLanguage() {
      LanguageRegistry.addName(BaseBlock, "Base Block");
    }
    private void registerGame() {
      GameRegistry.registerBlock(BaseBlock,
        "BaseMod" + BaseBlock.getUnlocalizedName2());
    }
    }



    BaseBlock.java

    package mods.TFD.minecraft.BaseMod;
    import java.util.Random;
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    public class BaseBlock extends Block{
    private String location;
    public BaseBlock(int id, Material material,String location) {
    super(id, material);
    
    this.location = location;
    setCreativeTab(CreativeTabs.tabBlock);
    }
    @Override
    public void registerIcons(IconRegister iconReg) {
    blockIcon = iconReg.registerIcon(location);
    
    }
    //CHANGE DROPS
    public int idDropped(int par1, Random rand, int par2){
    return Item.redstone.itemID;
    }
    
    public int quantityDropped(Random rand){
    return rand.nextInt(5-1)+1;
    }
    }



    BaseWorldGen

    package mods.TFD.minecraft.BaseMod;
    import java.util.Random;
    import net.minecraft.world.World;
    import net.minecraft.world.chunk.IChunkProvider;
    import net.minecraft.world.gen.feature.WorldGenMinable;
    import cpw.mods.fml.common.IWorldGenerator;
    public class BaseWorldGen implements IWorldGenerator {
    @Override
    public void generate(Random random, int chunkX, int chunkZ, World world,
    IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
    switch (world.provider.dimensionId) {
    case 1:
    generateEnd(world, random, chunkX * 16, chunkZ * 16);
    case 0:
    generateSurface(world, random, chunkX * 16, chunkZ * 16);
    case -1:
    generateNether(world, random, chunkX * 16, chunkZ * 16);
    }
    }
    private void generateEnd(World world, Random random, int chunkX, int chunkZ) {
    }
    private void generateSurface(World world, Random random, int chunkX,
    int chunkZ) {
    for (int i = 0; i > 20; i++) {
    int coordX = random.nextInt(16) + chunkX;
    int coordY = random.nextInt(64);
    int coordZ = random.nextInt(16) + chunkZ;
    (new WorldGenMinable(BaseMod.BaseBlock.blockID,10)).generate(
    	 world, random, coordX, coordY, coordZ);
    }
    }
    private void generateNether(World world, Random random, int chunkX,
    int chunkZ) {
    }
    }


    Console:
    2013-04-29 01:59:22 [INFO] [ForgeModLoader] Forge Mod Loader version 5.1.8.611 for Minecraft 1.5.1 loading
    2013-04-29 01:59:22 [INFO] [ForgeModLoader] Java is Java HotSpot™ 64-Bit Server VM, version 1.7.0_21, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
    2013-04-29 01:59:22 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    2013-04-29 01:59:24 [INFO] [STDOUT] 229 recipes
    2013-04-29 01:59:24 [INFO] [STDOUT] 27 achievements
    2013-04-29 01:59:24 [INFO] [Minecraft-Client] Setting user: Player343
    2013-04-29 01:59:24 [INFO] [STDOUT] (Session ID is -)
    2013-04-29 01:59:24 [INFO] [STDERR] Client asked for parameter: server
    2013-04-29 01:59:24 [INFO] [Minecraft-Client] LWJGL Version: 2.4.2
    2013-04-29 01:59:24 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
    2013-04-29 01:59:24 [INFO] [STDOUT] MinecraftForge v7.7.1.611 Initialized
    2013-04-29 01:59:24 [INFO] [ForgeModLoader] MinecraftForge v7.7.1.611 Initialized
    2013-04-29 01:59:24 [INFO] [STDOUT] Replaced 85 ore recipies
    2013-04-29 01:59:24 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
    2013-04-29 01:59:24 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Jayden\Desktop\Workspace\forge\mcp\jars\config\logging.properties
    2013-04-29 01:59:24 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
    2013-04-29 01:59:25 [INFO] [ForgeModLoader] Searching C:\Users\Jayden\Desktop\Workspace\forge\mcp\jars\mods for mods
    2013-04-29 01:59:26 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
    2013-04-29 01:59:26 [INFO] [mcp] Activating mod mcp
    2013-04-29 01:59:26 [INFO] [FML] Activating mod FML
    2013-04-29 01:59:26 [INFO] [Forge] Activating mod Forge
    2013-04-29 01:59:26 [INFO] [BaseMod] Activating mod BaseMod
    2013-04-29 01:59:26 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
    2013-04-29 01:59:26 [INFO] [STDOUT]
    2013-04-29 01:59:26 [INFO] [STDOUT] Starting up SoundSystem...
    2013-04-29 01:59:26 [INFO] [STDOUT] Initializing LWJGL OpenAL
    2013-04-29 01:59:26 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
    2013-04-29 01:59:26 [INFO] [STDOUT] OpenAL initialized.
    2013-04-29 01:59:27 [INFO] [STDOUT]
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
    2013-04-29 01:59:27 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
    2013-04-29 01:59:28 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
    2013-04-29 01:59:28 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
    2013-04-29 01:59:28 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/blocks/water.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/items/clock.txt
    2013-04-29 01:59:29 [INFO] [Minecraft-Client] Found animation info for: textures/items/compass.txt
    2013-04-29 01:59:41 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.5.1
    2013-04-29 01:59:41 [INFO] [Minecraft-Server] Generating keypair
    2013-04-29 01:59:42 [INFO] [Minecraft-Server] Converting map!
    2013-04-29 01:59:42 [INFO] [Minecraft-Server] Scanning folders...
    2013-04-29 01:59:42 [INFO] [Minecraft-Server] Total conversion count is 0
    2013-04-29 01:59:42 [INFO] [ForgeModLoader] Loading dimension 0 (TEST) ([email protected])
    2013-04-29 01:59:42 [INFO] [ForgeModLoader] Loading dimension 1 (TEST) ([email protected])
    2013-04-29 01:59:42 [INFO] [ForgeModLoader] Loading dimension -1 (TEST) ([email protected])
    2013-04-29 01:59:42 [INFO] [Minecraft-Server] Preparing start region for level 0
    2013-04-29 01:59:43 [INFO] [Minecraft-Server] Preparing spawn area: 8%
    2013-04-29 01:59:44 [INFO] [Minecraft-Server] Preparing spawn area: 22%
    2013-04-29 01:59:45 [INFO] [Minecraft-Server] Preparing spawn area: 45%
    2013-04-29 01:59:46 [INFO] [Minecraft-Server] Preparing spawn area: 65%
    2013-04-29 01:59:47 [INFO] [Minecraft-Server] Preparing spawn area: 85%
    2013-04-29 01:59:48 [INFO] [Minecraft-Server] Player343[/127.0.0.1:0] logged in with entity id 118 at (195.5, 73.0, 255.5)
    2013-04-29 01:59:52 [INFO] [Minecraft-Server] Saving and pausing game...
    2013-04-29 01:59:52 [INFO] [Minecraft-Server] Saving chunks for level 'TEST'/Overworld


    I know it’s a lot of information, but it’s better to be overdone then lacking, any help would appreciated.

    Sincerely, TheDragonFather
    Posted in: Java Edition Support
  • 0

    posted a message on TweaKrafT [1.5.1] UPDATED!
    Hello TheReasonWhyGuy,

    If i might suggest I would rather like to see the bones gathered from animals used for basic like flint tools (Could also be used for making a crafting bench) and on a personal note i would like to see a config file to turn some freatues off and on :)

    Cheers TheDragonFather :)
    Posted in: Minecraft Mods
  • 0

    posted a message on [1.12] [Forge] [Universal] RareOres Classic version 1.0
    Hey Cup of Water,

    I think this mod adds a lovely touch to the game and was wondering if you could link MrTylon's sphax patch to the main page so new comers could easily find it and..... on a personal note I dont know how this would be possiable but if you could manage to create a config file that would alter some feaures off and on such as bows that would be epic!

    Cheers The DragonFather :)
    Posted in: Minecraft Mods
  • To post a comment, please or register a new account.