Jump to content

Metadata block dropping metadata 0


tattyseal

Recommended Posts

My Metadeta block only drops metadata 0.

 

Block

 

 

package tattyseal.e.energyCollector;

 

 

 

import java.util.ArrayList;

import java.util.List;

 

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.item.ItemStack;

import net.minecraft.tileentity.TileEntity;

import net.minecraft.util.Icon;

import net.minecraft.world.World;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class EnergyCollector extends BlockContainer

{

@SideOnly(Side.CLIENT)

public static Icon[] texture = new Icon[5];

 

public EnergyCollector(int id)

{

super(id, Material.glass);

}

 

public TileEntity createNewTileEntity(World world)

{

return new TileEnergyCollector();

}

 

@SideOnly(Side.CLIENT)

public void registerIcons(IconRegister i)

{

texture[0] = i.registerIcon("ee:collector");

texture[1] = i.registerIcon("ee:collector_front");

texture[2] = Block.glowStone.getIcon(0, 0);

texture[3] = i.registerIcon("ee:collector_dm");

texture[4] = i.registerIcon("ee:collector_rm");

}

 

@SideOnly(Side.CLIENT)

public Icon getIcon(int side, int meta)

{

if(side == 0 || side == 1)

{

if(meta == 0)

{

return texture[0];

}

else if(meta == 1)

{

return texture[3];

}

else if(meta == 2)

{

return texture[4];

}

else

{

return null;

}

}

else

{

return texture[2];

}

}

 

@SideOnly(Side.CLIENT)

public void getSubBlocks(int id, CreativeTabs c, List l)

{

for(int i = 0; i < 3; i++)

{

l.add(new ItemStack(id, 1, i));

}

}

 

public int getDamageDropped(int meta)

{

return meta;

}

}

 

 

 

 

ItemBlock

 

 

package tattyseal.e.energyCollector;

 

import net.minecraft.item.ItemBlock;

import net.minecraft.item.ItemStack;

 

public class ItemEnergyCollector extends ItemBlock

{

 

public ItemEnergyCollector(int par1)

{

super(par1);

setHasSubtypes(true);

}

 

public String getUnlocalizedName(ItemStack itemstack)

{

String name = "";

 

switch(itemstack.getItemDamage())

{

case 0:

{

name = "ee.energyCollector";

break;

}

case 1:

{

name = "ee.energyCollectorMk1";

break;

}

case 2:

{

name = "ee.energyCollectorMk2";

break;

}

default:

{

name = "broken";

}

}

 

return name;

}

 

public int getMetadata(int par1)

{

return par1;

}

 

}

 

 

 

 

Help!  :(

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.