mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-20 12:19:48 +00:00
part 1 of converting to using MultiItemBlock where appropriate
This commit is contained in:
1 parent
dcd19499bb
commit
d65baaecb0
9 files changed
+40
-118
No files matched your search
@@ -2,36 +2,25 @@ package tconstruct.items.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class SoilSlabItem extends ItemBlock
|
||||
public class SoilSlabItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "grass", "dirt", "mycelium", "slime", "grout", "blueslime", "graveyardsoil", "consecratedsoil" };
|
||||
public static final String blockTypes[] = { "grass", "dirt", "mycelium", "slime", "grout", "blueslime", "graveyardsoil", "consecratedsoil" };
|
||||
|
||||
public SoilSlabItem(int id)
|
||||
{
|
||||
super(id);
|
||||
super(id, "block.soil.slab", blockTypes );
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public int getMetadata (int meta)
|
||||
{
|
||||
return meta;
|
||||
}
|
||||
|
||||
public String getUnlocalizedName (ItemStack itemstack)
|
||||
{
|
||||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
|
||||
return (new StringBuilder()).append("block.soil.slab.").append(blockType[pos]).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
|
||||
Reference in new issue
Block a user