Jump to content

Block meta data names


TheGrovesyProject101

Recommended Posts

Hey guys im new to modding and im trying out the meta data ive got the blocks to show up in game but the names are blank i have been using the command  LanguageRegistry.instance().addStringLocalization("tile.glass.first.name", "first");

the  ItemBlockGlass looks like this:

 

package TheCivilizationMod;

 

import net.minecraft.src.Block;

import net.minecraft.src.ItemBlock;

import net.minecraft.src.ItemStack;

 

public class ItemBlockOres extends ItemBlock

{

public ItemBlockOres(int par1, Block block)

{

  super(par1);

  setHasSubtypes(true);

}

 

public String getItemNameIS(ItemStack itemstack)

{

  String name = "";

  switch(itemstack.getItemDamage())

  {

  case 0:

  {

    name = "ore";

    break;

  }

  case 1:

  {

    name = "netherore";

    break;

  }

  default: name = "ore";

  }

  return getItemName() + "." + name;

}

 

public int getMetadata(int par1)

    {

        return par1;

    }

}

 

 

and the glass looks like this:

 

 

package TheCivilizationMod;

 

import java.util.List;

import java.util.Random;

 

import cpw.mods.fml.common.Side;

import cpw.mods.fml.common.asm.SideOnly;

 

import net.minecraft.src.Block;

import net.minecraft.src.CreativeTabs;

import net.minecraft.src.Item;

import net.minecraft.src.ItemStack;

import net.minecraft.src.Material;

 

public class glass extends Block

{

    public glass(int par1, int par2)

    {

        super(par1, par2, Material.rock);

        this.setCreativeTab(CreativeTabs.tabBlock);

        this.setRequiresSelfNotify();

    }

   

    public int getBlockTextureFromSideAndMetadata(int par1, int par2)

{

  switch (par2)

  {

  case 0:

  return 0;

  case 1:

  return 1;

  default:

  return 0;

  }

}

   

    public String getTextureFile()

    {

            return "/TutTextures.png";

    }

   

   

 

   

   

    @SideOnly(Side.CLIENT)

    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)

    {

        for (int var4 = 0; var4 < 2; ++var4)

        {

            par3List.add(new ItemStack(par1, 1, var4));

        }

    }

}

 

 

and the item list thing looks like this:

 

Item.itemsList[oreblockId] = new ItemBlockGlass(onewayglassId-256, onewayglass).setItemName("glass");

 

My youtube channel for forge tutorials: http://www.youtube.com/user/TheGrovesyProject101?feature=mhee

 

if i helped please press thank you

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.