mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +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
@@ -1,28 +1,16 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
|
||||
public class GlassPaneItem extends ItemBlock
|
||||
public class GlassPaneItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "glass.pure", "glass.soul", "glass.soul.pure" };
|
||||
public static final String blockTypes[] = { "pure.pane", "soul.pane", "soul.pure.pane" };
|
||||
|
||||
public GlassPaneItem(int id)
|
||||
{
|
||||
super(id);
|
||||
super(id, "block.glass", 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.").append(blockType[pos]).append(".pane").toString();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user