Moved ItemBlockHolder over from FM mod
Designed to be a very simple ItemBlock class to be used with a block for better metadata control.
This commit is contained in:
parent
866c254aa7
commit
1cc40cf6dc
1 changed files with 30 additions and 0 deletions
30
src/dark/core/items/ItemBlockHolder.java
Normal file
30
src/dark/core/items/ItemBlockHolder.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
package dark.core.items;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
/** Simple itemBlock class for quick use with a block
|
||||||
|
*
|
||||||
|
* @author Darkguardsman */
|
||||||
|
public class ItemBlockHolder extends ItemBlock
|
||||||
|
{
|
||||||
|
public ItemBlockHolder(int id)
|
||||||
|
{
|
||||||
|
super(id);
|
||||||
|
this.setMaxDamage(0);
|
||||||
|
this.setHasSubtypes(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMetadata(int damage)
|
||||||
|
{
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUnlocalizedName(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
return Block.blocksList[this.getBlockID()].getUnlocalizedName() + "." + itemStack.getItemDamage();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue