So Im working on updating a mod from 1.4.7 to 1.5.2 and everything was going great until I started up a test game and went to check out the blocks. All my texture fixes seem to be working properly but now I have three major issues all linked to the the blocks metadata. My first issue has to deal with the inventory item names. All the blocks have the same item name as the highest metadata value block. The second issue has to do with block direction on placement into the world, again, when placed they take the last metadata value. Finally my "ore generation" for metadata blocks doesnt seem to generate at all in the world, I have checked both the nether and the end just to see if it was generating there also but nothing. I believe all three issues are linked to one problem but cant seem to find anything wrong in the coding.
Here is my code:
Main Mod Code
package DecorativeChimney;
import java.io.File;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.src.BaseMod;
import net.minecraft.src.ModLoader;
import net.minecraftforge.client.MinecraftForgeClient;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.Property;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.client.registry.RenderingRegistry;
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;
import DecorativeChimney.Blocks.*;
import DecorativeChimney.Items.*;
import DecorativeChimney.Models.*;
import DecorativeChimney.TileEntitys.*;
import DecorativeChimney.TileEntityRenders.*;
@Mod(modid="DecorativeChimneyCore", name="Decorative Chimneys", version="Beta 1.0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class DecorativeChimneyCore
{
public static CreativeTabs tabChimney = new TabChimney("tabChimney");
public int blockChimneyBricksBlockID;
static int blockChimneyHolllowBricksBlockID;
static int blockLogsOnBlockID;
static int blockLogsOffBlockID;
public static boolean blockChimneyMarbleCraftable = false;
public static int blockHollowBricksModelID;
public static Block blockChimneyBricks;
public static Block blockChimneyHollowBricks;
public static Block blockLogsOn;
public static Block blockLogsOff;
public static DecorativeChimneyWorldGen genMarble = new DecorativeChimneyWorldGen();
TileEntityLogsRender tileentity1 = new TileEntityLogsRender();
private static final String[] blockChimneyBricksNames =
{
"Black Marble", "Gray Marble", "White Marble", "Black Marble Bricks",
"Small Black Marble Bricks", "Small Stone Bricks", "White Marble Bricks", "Small White Marble Bricks"
};
private static final String[] blockChimneyBrickTypeNames =
{
"Black Marble", "Gray Marble", "White Marble", "Black Marble Bricks", "Small Black Marble Bricks",
"Stone Bricks", "Small Stone Bricks", "Stone", "Cobblestone", "White Marble Bricks",
"Small White Marble Bricks", "Nether Brick", "Brick", "Emerald", "Gold", "Diamond"
};
@SidedProxy(clientSide="DecorativeChimney.Client.ClientProxy", serverSide="DecorativeChimney.CommonProxy")
public static CommonProxy proxy;
@Instance("DecorativeChimney")
public static DecorativeChimneyCore instance;
@PreInit
public void preInit(FMLPreInitializationEvent event)
{
Configuration configuration = new Configuration(event.getSuggestedConfigurationFile());
configuration.load();
blockChimneyBricksBlockID = configuration.getBlock("Block", "Chimney Brick Blocks", 200).getInt();
blockChimneyHolllowBricksBlockID = configuration.getBlock("Block", "Hollow Chimney Brick Blocks", 201).getInt();
blockLogsOnBlockID = configuration.getBlock("Block", "Logs On", 202).getInt();
blockLogsOffBlockID = configuration.getBlock("Block", "Logs Off", 203).getInt();
blockChimneyMarbleCraftable = configuration.get("General", "Marble Crafting Recipe", false, "Set to true to enable the crafting of marble.").getBoolean(false);
configuration.save();
}
@Init
public void load(FMLInitializationEvent event)
{
proxy.registerRenderers();
proxy.initRendering();
blockChimneyBricks = (new BlockChimneyBrick(blockChimneyBricksBlockID));
blockChimneyHollowBricks = (new BlockChimneyHollow(blockChimneyHolllowBricksBlockID));
blockLogsOn = (new BlockLogsOn(blockLogsOnBlockID, TileEntityLogs.class));
blockLogsOff = (new BlockLogsOff(blockLogsOffBlockID, TileEntityLogs.class));
GameRegistry.registerWorldGenerator(genMarble);
LanguageRegistry.instance().addStringLocalization("itemGroup.tabChimney", "en_US", "Fireplaces and Chimneys");
GameRegistry.registerBlock(blockChimneyBricks, ItemBlockChimneyBrick.class, "Chimney Bricks");
GameRegistry.registerBlock(blockChimneyHollowBricks, ItemBlockChimneyHollow.class, "Hollow Chimney Bricks");
GameRegistry.registerBlock(blockLogsOn, "Ignited Logs");
GameRegistry.registerBlock(blockLogsOff, "Logs");
ModLoader.registerTileEntity(TileEntityLogs.class, "LogsOn", tileentity1);
ModLoader.registerTileEntity(TileEntityLogs.class, "LogsOff", tileentity1);
//Tool Tip Name
for (int i = 0; i < 8; i++)
{
ItemStack blockChimneyBricksStack = new ItemStack(blockChimneyBricks, 64, i);
LanguageRegistry.addName(blockChimneyBricksStack, blockChimneyBricksNames[blockChimneyBricksStack.getItemDamage()]);
}
for (int i = 0; i < 16; i++)
{
ItemStack blockChimneyHollowBricksStack = new ItemStack(blockChimneyHollowBricks, 64, i);
LanguageRegistry.addName(blockChimneyHollowBricksStack, "Hollow " + blockChimneyBrickTypeNames[blockChimneyHollowBricksStack.getItemDamage()]);
}
LanguageRegistry.addName(blockLogsOn, "Logs");
LanguageRegistry.addName(blockLogsOff, "Logs");
//Recipes
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 0), "stoneMarble", new ItemStack(Item.dyePowder, 1, 0)));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 0), "stoneMarbleGray", new ItemStack(Item.dyePowder, 1, 0)));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 1), "stoneMarble", new ItemStack(Item.dyePowder, 1, 8)));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 1), "stoneMarbleBlack", new ItemStack(Item.dyePowder, 1, 8)));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 2), "stoneMarbleGray", new ItemStack(Item.dyePowder, 1, 15)));
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(new ItemStack(blockChimneyBricks, 1, 2), "stoneMarbleBlack", new ItemStack(Item.dyePowder, 1, 15)));
if(blockChimneyMarbleCraftable == true)
{
GameRegistry.addShapelessRecipe(new ItemStack(blockChimneyBricks, 1, 0), Item.clay, new ItemStack(Item.dyePowder, 1, 0));
GameRegistry.addShapelessRecipe(new ItemStack(blockChimneyBricks, 1, 1), Item.clay, new ItemStack(Item.dyePowder, 1, 8));
GameRegistry.addShapelessRecipe(new ItemStack(blockChimneyBricks, 1, 2), Item.clay, new ItemStack(Item.dyePowder, 1, 15));
}
GameRegistry.addRecipe(new ItemStack(blockChimneyBricks, 4, 3), "LL", "LL",
Character.valueOf('L'), new ItemStack(blockChimneyBricks, 1, 0));
GameRegistry.addRecipe(new ItemStack(blockChimneyBricks, 9, 4), "LLL", "LLL", "LLL",
Character.valueOf('L'), new ItemStack(blockChimneyBricks, 1, 0));
GameRegistry.addRecipe(new ItemStack(blockChimneyBricks, 9, 5), "SSS", "SSS", "SSS",
Character.valueOf('S'), Block.stone);
GameRegistry.addRecipe(new ItemStack(blockChimneyBricks, 4, 6), "SS", "SS",
Character.valueOf('S'), new ItemStack(blockChimneyBricks, 1, 2));
GameRegistry.addRecipe(new ItemStack(blockChimneyBricks, 9, 7), "LLL", "LLL", "LLL",
Character.valueOf('L'), new ItemStack(blockChimneyBricks, 1, 2));
GameRegistry.addRecipe(new ItemStack(blockLogsOff, 4, 7), " L ", "LLL", Character.valueOf('L'), Block.wood);
addHollowRecipe(0, "stoneMarbleBlack", "stoneMarbleBlack");
addHollowRecipe(1, "stoneMarbleGray", "stoneMarbleGray");
addHollowRecipe(2, "stoneMarble", "stoneMarble");
addHollowRecipe(3, new ItemStack(blockChimneyBricks, 1, 3), new ItemStack(blockChimneyBricks, 1, 3));
addHollowRecipe(4, new ItemStack(blockChimneyBricks, 1, 4), new ItemStack(blockChimneyBricks, 1, 4));
addHollowRecipe(5, Block.stoneBrick, Block.stoneBrick);
addHollowRecipe(6, new ItemStack(blockChimneyBricks, 1, 5), new ItemStack(blockChimneyBricks, 1, 5));
addHollowRecipe(7, Block.stone, Block.stone);
addHollowRecipe(8, Block.cobblestone, Block.cobblestone);
addHollowRecipe(9, new ItemStack(blockChimneyBricks, 1, 6), new ItemStack(blockChimneyBricks, 1, 6));
addHollowRecipe(10, new ItemStack(blockChimneyBricks, 1, 7), new ItemStack(blockChimneyBricks, 1, 7));
addHollowRecipe(11, Block.netherBrick, Block.netherBrick);
addHollowRecipe(12, Block.brick, Block.brick);
addHollowRecipe(13, Block.glass, Item.emerald);
addHollowRecipe(14, Block.planks, Item.ingotGold);
addHollowRecipe(15, Block.glass, Item.diamond);
}
public static void addHollowRecipe(int i, Object obj1, Object obj2)
{
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(blockChimneyHollowBricks, 2, i), "I J", " ", "J J",
Character.valueOf('I'), obj1,
Character.valueOf('J'), obj2));
}
@PostInit
public void postInit(FMLPostInitializationEvent event)
{
}
}
Client Proxy Code
package DecorativeChimney.Client;
import net.minecraftforge.client.MinecraftForgeClient;
import DecorativeChimney.CommonProxy;
import DecorativeChimney.DecorativeChimneyCore;
import DecorativeChimney.Blocks.InvBlock;
import DecorativeChimney.TileEntityRenders.*;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy
{
@Override
public void registerRenderers()
{
}
public void preInitLoading()
{
}
public void initRendering()
{
DecorativeChimneyCore.blockHollowBricksModelID = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(DecorativeChimneyCore.blockHollowBricksModelID, new InvBlock());
ClientRegistry.bindTileEntitySpecialRenderer(DecorativeChimney.TileEntitys.TileEntityLogs.class, new TileEntityLogsRender());
}
}
Common Proxy Code
package DecorativeChimney;
import cpw.mods.fml.common.registry.GameRegistry;
public class CommonProxy
{
public void registerRenderers()
{
}
public void initRendering()
{
}
public void registerTileEntities()
{
}
}
Multi Block Code
package DecorativeChimney.Blocks;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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.ItemStack;
import net.minecraft.util.Icon;
import DecorativeChimney.CommonProxy;
import DecorativeChimney.DecorativeChimneyCore;
public class BlockChimneyBrick extends Block
{
public BlockChimneyBrick(int id)
{
super(id, Material.rock);
setHardness(5.0F);
setResistance(1.0F);
setStepSound(Block.soundStoneFootstep);
setUnlocalizedName("blockChimneyBricks");
setCreativeTab(CreativeTabs.tabBlock);
}
@SideOnly(Side.CLIENT)
public void getSubBlocks(int i, CreativeTabs tab, List subitems)
{
for (int jx = 0; jx < 8; jx++) {
subitems.add(new ItemStack(this, 1, jx));
}
}
@SideOnly(Side.CLIENT)
private Icon[] icons;
private static final String[] blockChimneyBricksNames =
{
"BlackMarble", "GrayMarble", "WhiteMarble", "BlackLargeBrick", "BlackSmallBrick", "StoneSmallBrick", "WhiteLargeBrick", "WhiteSmallBrick"
};
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconregister)
{
icons = new Icon[8];
for(int i = 0; i < icons.length; i++)
{
ItemStack blockChimneyBricksStack = new ItemStack(DecorativeChimneyCore.blockChimneyBricks, 64, i);
icons[i] = iconregister.registerIcon("DecorativeChimney" + ":" + blockChimneyBricksNames[blockChimneyBricksStack.getItemDamage()]);
}
}
@SideOnly(Side.CLIENT)
public Icon getIcon(int par1, int meta)
{
return icons[meta];
}
public int idDropped(int metadata, Random random)
{
return blockID;
}
public int damageDropped(int metadata)
{
return metadata;
}
public int quantityDropped(Random random)
{
return 1;
}
public int getMobilityFlag()
{
return 0;
}
}
Multi Block Item Code
package DecorativeChimney.Items;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockChimneyBrick extends ItemBlock
{
public ItemBlockChimneyBrick(int id)
{
super(id);
setMaxDamage(0);
setHasSubtypes(true);
setUnlocalizedName("blockChimneyBricks");
}
public int getMetadata(int metadata)
{
return metadata;
}
public String getItemNameIS(ItemStack itemStack)
{
switch (itemStack.getItemDamage())
{
case 0:
return getUnlocalizedName() + ".blackmarble";
case 1:
return getUnlocalizedName() + ".graymarble";
case 2:
return getUnlocalizedName() + ".whitemarble";
case 3:
return getUnlocalizedName() + ".blackbrick";
case 4:
return getUnlocalizedName() + ".smallblackbrick";
case 5:
return getUnlocalizedName() + ".smallstonebrick";
case 6:
return getUnlocalizedName() + ".whitebrick";
case 7:
return getUnlocalizedName() + ".smallwhitebrick";
default:
return getUnlocalizedName() + ".blackmarble";
}
}
}
Directional Block Code
package DecorativeChimney.Blocks;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import DecorativeChimney.TileEntitys.TileEntityLogs;
import DecorativeChimney.CommonProxy;
import DecorativeChimney.DecorativeChimneyCore;
public class BlockLogsOff extends BlockContainer
{
private Random random = new Random();
public BlockLogsOff(int id, Class class1)
{
super(id, Material.wood);
anEntityClass = class1;
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
setHardness(1.5F);
setResistance(1.0F);
setStepSound(Block.soundWoodFootstep);
setUnlocalizedName("blockLogsOff");
setCreativeTab(DecorativeChimneyCore.tabChimney);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister iconregister)
{
this.blockIcon = iconregister.registerIcon("DecorativeChimney:Logs");
}
public int idDropped(int par1, Random par2Random, int par3)
{
return blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityplayer, int l, float m, float n, float p)
{
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID)
{
int q = world.getBlockMetadata(i, j, k);
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
entityplayer.getCurrentEquippedItem().damageItem(1, entityplayer);
world.setBlock(i, j, k, DecorativeChimneyCore.blockLogsOn.blockID);
world.setBlockMetadataWithNotify(i, j, k, q, 2);
return true;
}
else
{
return false;
}
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public int getRenderType()
{
return -1;
}
public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving)
{
int l = MathHelper.floor_double((double)((entityliving.rotationYaw * 4F) / 360F) + 0.5D) & 3;
world.setBlockMetadataWithNotify(i, j, k, l, 2);
}
public TileEntity createNewTileEntity(World world)
{
return new TileEntityLogs();
}
private Class anEntityClass;
public boolean getBlocksMovement(IBlockAccess iblockaccess, int i, int j, int k)
{
return false;
}
public void addCollidingBlockToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
{
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity);
}
}
Directional Block TileEntity Code
package DecorativeChimney.TileEntityRenders;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import DecorativeChimney.Models.ModelLogs;
import DecorativeChimney.TileEntitys.TileEntityLogs;
public class TileEntityLogsRender extends TileEntitySpecialRenderer
{
public TileEntityLogsRender()
{
model = new ModelLogs();
}
public void renderAModelAt(TileEntityLogs tile, double d, double d1, double d2, float f)
{
int i = tile.getBlockMetadata(); //this is for rotation
int j = 0;
if (i == 0)
{
j = 0;
}
if (i == 1)
{
j = 90;
}
if (i == 2)
{
j = 180;
}
if (i == 3)
{
j = 270;
}
bindTextureByName("/mods/DecorativeChimney/textures/LogModel.png"); //texture
GL11.glPushMatrix(); //start
GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
GL11.glRotatef(j, 0.0F, 1.0F, 0.0F); //rotate based on metadata
GL11.glScalef(1.0F, -1F, -1F); //if you read this comment out this line and you can see what happens
model.renderModel(0.0625F); //renders, 0.0625 is 1 block size
GL11.glPopMatrix(); //end
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((TileEntityLogs) tileentity, d, d1, d2, f); //where to render
}
private ModelLogs model;
}
Please let me know if you see something in the code that looks out of the normal. Ive been testing a lot of different things and nothing seems to fixed the issues. Thanks for your time.
Thanks for the suggestion. I reviewed the post with no success. That post though seemed to be about making metadata items and not blocks. Also nothing in that post would explain why my other model rendered block isnt facing the directions I place it at. I think its all related to one problem in my coding but cant seem to figure out what it is. I am open to other suggestions.
First off Ive tried the LanguageRegistry.addName way you listed and it didnt change. Secondly lets say you have a stack of logs when facing north or south I want the stack running east to west and when facing east to west I want the stack running north to south. Exactly how the anvil or stair renders work when they are placed by the player.
Here is the worldGen code which also calls upon some of the metadata from one of the blocks.
package mods.DecorativeChimney;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.feature.WorldGenMinable;
import cpw.mods.fml.common.IWorldGenerator;
public class DecorativeChimneyWorldGen implements IWorldGenerator
{
private int minableBlockId;
private int metadata;
private int numberOfBlocks;
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);
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
case 1:
generateEnd(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 a = 0; a < 15; a++)
{
int i = chunkX + random.nextInt(16);
int j = random.nextInt(100);
int k = chunkZ + random.nextInt(16);
new WorldGenMinable(DecorativeChimneyCore.blockChimneyBricks.blockID, 0, 15).generate(world, random, i, j, k);
new WorldGenMinable(DecorativeChimneyCore.blockChimneyBricks.blockID, 1, 15).generate(world, random, i, j, k);
new WorldGenMinable(DecorativeChimneyCore.blockChimneyBricks.blockID, 2, 15).generate(world, random, i, j, k);
}
}
private void generateNether(World world, Random random, int chunkX, int chunkZ)
{
}
}
As you can see, its a generic world generation code.
I figured out what the issue was with the naming of the blocks. Simply put in my Item code I had " public String getItemNameIs(ItemStack itemStack)" when it should have been " public String getUnlocalizedName(ItemStack itemStack)". Ive tried " public String getUnlocalizedNameIs(ItemStack itemStack)" in the past but I missed the Is which is where I got thrown off. The direction of the logs and the world generation are still issues Im trying to fix.
Figured out the rotational part. In my method "public void onBlockPlacedBy(World world, int i, int j, int k, EntityLiving entityliving, ItemStack itemstack)" I didnt have the "ItemStack itemstack" which was added after 1.4.7. All that leaves now is the world gen part. The code for the world gen is listed in my previous reply in a spoiler. Im so close, thanks for your advice and help.
Thanks for all the Ideas and help. Ive used your code in testing before but found out it only works for a block id metadata of 0. After looking through the world gen java class I found the code I needed though even then it took some trial and error to get it to work.
I had to replace:
(new WorldGenMinableNether(Block.blockGold.blockID, 20)).generate(world, random, xCoord, yCoord, zCoord);
with
(new WorldGenMinableNether(Block.blockGold.blockID, 0, 20, 1)).generate(world, random, xCoord, yCoord, zCoord);
The 0 is the metadata it generates, and the 1 is the "target". I tried replacing the 1 with a 0 and got nothing, then a 2 and it generated in on the surface of select biomes only. I was trying to find a list of what the target int does but have been unsuccessful, all I know is 1 seems to generated in the stone level across all biomes.
Here is my code:
Main Mod Code
Client Proxy Code
Common Proxy Code
Multi Block Code
Multi Block Item Code
Directional Block Code
Directional Block TileEntity Code
Please let me know if you see something in the code that looks out of the normal. Ive been testing a lot of different things and nothing seems to fixed the issues. Thanks for your time.
Here is the worldGen code which also calls upon some of the metadata from one of the blocks.
As you can see, its a generic world generation code.
I had to replace:
with
The 0 is the metadata it generates, and the 1 is the "target". I tried replacing the 1 with a 0 and got nothing, then a 2 and it generated in on the surface of select biomes only. I was trying to find a list of what the target int does but have been unsuccessful, all I know is 1 seems to generated in the stone level across all biomes.