Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.