Jump to content

Recommended Posts

Posted

Hi. I am Mantes from Germany!

 

I has got a question:

 

My Block with metadata don't work... The textures are Not load when the block is placed in world or placed Defauld Block

My Code:

 

package cpw.mods.Futurepack;

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.ItemStack;
import net.minecraft.src.Material;

public class BlockGitter extends BlockFP 
{
public BlockGitter(int par1, int par2, Material material,boolean isOpaqueCube)
{
	super(par1, par2, Material.iron,true);
	this.setCreativeTab(CreativeTabs.tabBlock);	
}
    
    public int getBlockTextureFromSideAndMetadata(int par1, int par2)
    {
        switch (par2)
        {
            case 1:
                return 33;
            case 2:
                return 34;
            case 3:
                return 35;
            case 4:
                return 36;
            case 5:
                return 37;
            case 6:
                return 38;
            case 7:
                return 39;
            case 8:
                return 40;
            case 9:
                return 41;
            case 10:
                return 42;
            case 11:
                return 43;
            case 12:
                return 44;
            case 13:
                return 45;
            case 14:
                return 46;
            case 15:
                return 47;
            default:
                return 32;
        }
    }
    
    @SideOnly(Side.CLIENT)

    /**
     * Determines the damage on the item the block drops. Used in cloth and wood.
     */
    protected int damageDropped(int par1)
    {
        return par1;
    }

    @SideOnly(Side.CLIENT)

    /**
     * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
     */
    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    {
        for (int var4 = 0; var4 < 16; ++var4)
        {
            par3List.add(new ItemStack(par1, 1, var4));
        }
    }
}

 

Please help me Mantes

Posted

@mod class, Item Block class, Naming class? Go look at Helfull's Tutorials. There one for Block with Metadata its for 1.2.5 but also works for 1.3.2

could you link it, or is it in the tutorials section, i need a good metadata tutorial

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.

×
×
  • Create New...

Important Information

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