Jump to content

[1.7.2] "Ore" not spawning


Kieroon

Recommended Posts

Hi all (again), I have been following another tutorial on how to make my custom block from before generate in the world. I supposed I could use an ore generation method but just increase the Y value. I've used three different methods and tutorials to help me achieve this but I can never seem to make my block spawn or at least I haven't seen it. All help is appreciated, and as before please excuse the name of my mod and blocks/items...

 

Main

package org.dodge.dildomod;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDynamicLiquid;
import net.minecraft.block.BlockStaticLiquid;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
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.registry.GameRegistry;

import org.dodge.dildomod.help.Reference;

@Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION)
public class Main
{


//Creative Tab
public static CreativeTabs dildo = new CreativeTabs("DildoMod"){
public Item getTabIconItem(){
	return lubei;
}
};

//Blocks
public static Block lube;
//Items
public static Item lubei;
public static Item plastic;
public static Item mplastic;
public static Item dildohead;
public static Item dildoshaft;
public static Item dildoball;
public static Item moltendildo;
public static Item dildoi;
public static Item cum;
public static Item semendish;
public static Item semendishcum;
public static Item cumbottle;
public static Block semenm;
public static Item.ToolMaterial dildom = EnumHelper.addToolMaterial("Dildo", 2, 562, 4.0F, 2.0F, ;
public static final Material semen = new MaterialLiquid(MapColor.snowColor);
public static final Material lubem = new MaterialLiquid(MapColor.snowColor);
public static Fluid cumlake;
public static Block semenw;


@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
//Blocks
lube = new BlockLube(semen);
cumlake = new Fluid("CumLake");
FluidRegistry.registerFluid(cumlake);
semenw = new BlockCumLake(semen);
GameRegistry.registerBlock(semenw, "Semen");
//Items
cumbottle = new ItemCumBottle();
lubei = new ItemLube();
plastic = new ItemPlastic();
mplastic = new ItemMoltenPlastic();
dildohead = new ItemDildoHead();
dildoshaft = new ItemDildoShaft();
dildoball = new ItemDildoBall();
moltendildo = new ItemMoltenDildo();
dildoi = new ItemDildo(dildom);
cum = new ItemCum(3, 1, false);
semendish = new ItemSemenDish(Blocks.air);
semendishcum = new ItemSemenDish(semenw).setTextureName("dildomod:semendishcum").setUnlocalizedName("SemendishCum");
//Registry
GameRegistry.registerBlock(lube, "Lube Block");
GameRegistry.registerItem(lubei, "Lube");
GameRegistry.registerItem(plastic, "Plastic");
GameRegistry.registerItem(mplastic, "MoltenPlastic");
GameRegistry.registerItem(dildohead, "DildoHead");
GameRegistry.registerItem(dildoshaft, "DildoShaft");
GameRegistry.registerItem(dildoball, "DildoBall");
GameRegistry.registerItem(moltendildo, "MoltenDildo");
GameRegistry.registerItem(dildoi, "DildoItem");
GameRegistry.registerItem(cum, "Cum");
GameRegistry.registerItem(semendish, "Semendish");
GameRegistry.registerItem(semendishcum, "Semendish of cum");
GameRegistry.registerItem(cumbottle, "CumBottle");


}

@EventHandler
public void init(FMLInitializationEvent e)
{
//Stacks
ItemStack slime = new ItemStack(Items.slime_ball);
ItemStack lubec = new ItemStack(lubei);
ItemStack plasticm = new ItemStack(mplastic);
ItemStack iron = new ItemStack(Items.iron_ingot);
ItemStack bottle = new ItemStack(Items.glass_bottle);
//Crafting
GameRegistry.addShapelessRecipe(new ItemStack(plastic, 1), plasticm, plasticm, new ItemStack(Items.water_bucket));
GameRegistry.addShapedRecipe(new ItemStack(lubei, 5), "xx", "xx", 'x', slime);
GameRegistry.addShapedRecipe(new ItemStack(lube, 1), "xx", "xx", 'x', lubec);
GameRegistry.addShapedRecipe(new ItemStack(plastic, 1), "xxx", "xyx", "xxx", 'x', lubec, 'y', new ItemStack(Blocks.stone));
GameRegistry.addShapedRecipe(new ItemStack(dildohead, 1), " x ", "xyx", "xxx", 'x', plasticm, 'y', new ItemStack(Items.redstone));
GameRegistry.addShapedRecipe(new ItemStack(dildoshaft, 1), " x ", " y ", " x ", 'x', plasticm, 'y', new ItemStack(Items.redstone));
GameRegistry.addShapedRecipe(new ItemStack(dildoball, 1), " x ", "xyx", " x ", 'x', plasticm, 'y', new ItemStack(Items.redstone));
GameRegistry.addShapedRecipe(new ItemStack(moltendildo, 1), " x ", " y ", "z z", 'x', new ItemStack(dildohead), 'y', new ItemStack(dildoshaft), 'z', new ItemStack(dildoball));
GameRegistry.addShapelessRecipe(new ItemStack(dildoi, 1), new ItemStack(moltendildo), new ItemStack(Items.water_bucket));
GameRegistry.addShapedRecipe(new ItemStack(semendish, 3), "   ", "x x", " x ", 'x', iron);
GameRegistry.addShapelessRecipe(new ItemStack(cumbottle, 3), new ItemStack(semendishcum), bottle, bottle, bottle);
//Smelting
GameRegistry.addSmelting(plastic, plasticm, 5.0F);
//WorldGen
GameRegistry.registerWorldGenerator(new GenerateLube(), 0);
}

@EventHandler
public void postInit(FMLPostInitializationEvent e)
{
}
}

 

GenerateLube.java

package org.dodge.dildomod;

import java.util.Random;
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;
import net.minecraftforge.event.terraingen.TerrainGen;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.registry.GameRegistry;

public class GenerateLube 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(world, random, chunkX * 16, chunkZ * 16);
break;
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
default:
}
}

private void generateEnd(World world, Random random, int x, int z)
{

}

private void generateSurface(World world, Random random, int x, int z)
{

}

private void generateNether(World world, Random random, int x, int z)
{

}

public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block generateIn)
{


int heightRange = maxY - minY;
WorldGenMinable worldgenminable = new WorldGenMinable(Main.lube, 13, Blocks.air);
for (int k1 = 0; k1 < chancesToSpawn; ++k1)
{
int xrand = random.nextInt(16);
int yrand = random.nextInt(heightRange) + minY;
int zrand = random.nextInt(16);
worldgenminable.generate(world, random, chunk_x+xrand, 64, chunk_z+zrand);
}
}
}

Link to comment
Share on other sites

first of all, wow... Ehmm.... That's gotta be the first MC mod about this that I'll see :P

Second, You made the world generator class and functions and everything, but you forgot to add the actual generation for this block.

I assume you want to add this block in the overworld, so you basically have to add the generateOre(blablabla); in the generateSurface.

Something like this:

private void generateSurface(World world, Random random, int x, int z)
{
generateOre(//Here go the needed things);
}

I think it should work after you do that :)

 

Good luck with your mod, whatever your intentions are haha :P

 

 

Link to comment
Share on other sites

first of all, wow... Ehmm.... That's gotta be the first MC mod about this that I'll see :P

Second, You made the world generator class and functions and everything, but you forgot to add the actual generation for this block.

I assume you want to add this block in the overworld, so you basically have to add the generateOre(blablabla); in the generateSurface.

Something like this:

private void generateSurface(World world, Random random, int x, int z)
{
generateOre(//Here go the needed things);
}

I think it should work after you do that :)

 

Good luck with your mod, whatever your intentions are haha :P

 

Oh wow -.- The things tiredness do to you :P

 

Thanks a lot, how could I miss that?

Link to comment
Share on other sites

Hate to be a nuisance again, but it seems it has now stopped working completely. One day it decided to stop working, and then the ore just stopped generating. This is the code

package org.dodge.dildomod;

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;

import java.util.Random;
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;
import net.minecraftforge.event.terraingen.TerrainGen;
import cpw.mods.fml.common.IWorldGenerator;
import cpw.mods.fml.common.registry.GameRegistry;

public class GenerateLube 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(world, random, chunkX * 16, chunkZ * 16);
break;
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
break;
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
break;
default:
}
}

private void generateEnd(World world, Random random, int x, int z)
{

}

private void generateSurface(World world, Random random, int x, int z)
{
this.generateOre(Main.lube, world, random, x, z, x * 16, z * 16, 2, 5, 0, 128, Blocks.air);
//this.generateOre(Main.semenw, world, random, x, z, x * 16, z * 16, 1, 1, 64, 256, Blocks.air);
}

private void generateNether(World world, Random random, int x, int z)
{

}


public void generateOre(Block block, World world, Random random, int chunk_x, int chunk_z, int maxX, int maxZ, int maxVeinSize, int chancesToSpawn, int minY, int maxY, Block generateIn)
{


int heightRange = maxY - minY;
WorldGenMinable worldgenminable = new WorldGenMinable(block, maxVeinSize, generateIn);
for (int k1 = 0; k1 < chancesToSpawn; ++k1)
{
int xrand = random.nextInt(16);
int yrand = random.nextInt(heightRange) + minY;
int zrand = random.nextInt(16);
worldgenminable.generate(world, random, chunk_x+xrand, 64, chunk_z+zrand);
}
}

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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