part 2 of conversion to multiItemBlock

This commit is contained in:
Progwml6 committed 2013-12-19 08:15:16 -05:00
1 parent 2ed4c115e4
commit 51e0833ae8
24 files changed
+93 -335

No files matched your search

@@ -4,11 +4,11 @@ import mantle.blocks.abstracts.MultiItemBlock;
public class GlassPaneItem extends MultiItemBlock
{
public static final String blockTypes[] = { "pure.pane", "soul.pane", "soul.pure.pane" };
public static final String blockTypes[] = { "pure", "soul", "soul.pure" };
public GlassPaneItem(int id)
{
super(id, "block.glass", blockTypes);
super(id, "block.glass", "pane", blockTypes);
setMaxDamage(0);
setHasSubtypes(true);
}
@@ -2,34 +2,22 @@ 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;
public class MetalItemBlock extends ItemBlock
public class MetalItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Tin", "Aluminum", "AlBrass", "Alumite", "Steel", "Ender" };
public static final String blockTypes[] = { "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Tin", "Aluminum", "AlBrass", "Alumite", "Steel", "Ender" };
public MetalItemBlock(int id)
{
super(id);
super(id, "StorageMetals", 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("StorageMetals.").append(blockType[pos]).toString();
}
@Override
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
@@ -2,34 +2,24 @@ 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.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
public class MetalOreItemBlock extends ItemBlock
public class MetalOreItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" };
public static final String blockTypes[] = { "NetherSlag", "Cobalt", "Ardite", "Copper", "Tin", "Aluminum", "Slag" };
public MetalOreItemBlock(int id)
{
super(id);
super(id, "MetalOre", 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("MetalOre.").append(blockType[pos]).toString();
}
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
if (stack.hasTagCompound())
@@ -2,37 +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 MultiBrickFancyItem extends ItemBlock
public class MultiBrickFancyItem extends MultiItemBlock
{
static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
static String blockTypes[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
"stone", "stone.road" };
public MultiBrickFancyItem(int id)
{
super(id);
super(id, "block.fancybrick", 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.fancybrick.").append(blockType[pos]).toString();
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
@@ -2,6 +2,7 @@ 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;
@@ -10,29 +11,18 @@ import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class MultiBrickItem extends ItemBlock
public class MultiBrickItem extends MultiItemBlock
{
static String blockType[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
static String blockTypes[] = { "obsidian", "sandstone", "netherrack", "stone.refined", "iron", "gold", "lapis", "diamond", "redstone", "bone", "slime", "blueslime", "endstone", "obsidian.ingot",
"stone.road", "stone.refined.road" };
public MultiBrickItem(int id)
{
super(id);
super(id, "block.brick", 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.brick.").append(blockType[pos]).toString();
}
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
@@ -3,12 +3,10 @@ package tconstruct.items.blocks;
import java.util.List;
import tconstruct.common.TRepo;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.common.IPlantable;
@@ -16,13 +14,14 @@ import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class OreberryBushItem extends ItemBlock
public class OreberryBushItem extends MultiItemBlock
{
public int blockID;
public static final String blockTypes[] = { "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" };
public OreberryBushItem(int id)
{
super(id);
super(id, "block.oreberry", blockTypes);
blockID = id + 256;
setHasSubtypes(true);
}
@@ -60,16 +59,6 @@ public class OreberryBushItem extends ItemBlock
return false;
}
/* Block name in inventory */
@Override
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.oreberry.").append(blockType[pos]).toString();
}
public static final String blockType[] = { "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin", "iron", "gold", "copper", "tin" };
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
@@ -3,7 +3,7 @@ package tconstruct.items.blocks;
import java.util.List;
import tconstruct.common.TRepo;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
@@ -16,13 +16,14 @@ import net.minecraft.util.StatCollector;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class OreberryBushSecondItem extends ItemBlock
public class OreberryBushSecondItem extends MultiItemBlock
{
public int blockID;
public static final String blockTypes[] = { "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "" };
public OreberryBushSecondItem(int id)
{
super(id);
super(id, "block.oreberry", blockTypes);
blockID = id + 256;
setHasSubtypes(true);
}
@@ -64,16 +65,6 @@ public class OreberryBushSecondItem extends ItemBlock
return false;
}
/* Block name in inventory */
@Override
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.oreberry.").append(blockType[pos]).toString();
}
public static final String blockType[] = { "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "", "aluminum", "essence", "", "" };
@Override
@SideOnly(Side.CLIENT)
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
@@ -1,28 +1,19 @@
package tconstruct.items.blocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class SearedSlabItem extends ItemBlock
public class SearedSlabItem extends MultiItemBlock
{
public static final String blockType[] = { "brick", "stone", "cobble", "paver", "road", "fancy", "square", "creeper" };
public static final String blockTypes[] = { "brick", "stone", "cobble", "paver", "road", "fancy", "square", "creeper" };
public SearedSlabItem(int id)
{
super(id);
super(id, "block.searedstone.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.searedstone.slab.").append(blockType[pos]).toString();
}
}
@@ -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 SearedTableItemBlock extends ItemBlock
public class SearedTableItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "Table", "Faucet", "Basin" };
public static final String blockTypes[] = { "Table", "Faucet", "Basin" };
public SearedTableItemBlock(int id)
{
super(id);
super(id, "SearedBlock", 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("SearedBlock.").append(blockType[pos]).toString();
}
}
@@ -1,33 +1,16 @@
package tconstruct.items.blocks;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class SlimeGelItemBlock extends ItemBlock
public class SlimeGelItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "blue", "green", "purple", "magma", "yellow", "red", "metal" };
public static final String blockTypes[] = { "blue", "green", "purple", "magma", "yellow", "red", "metal" };
public SlimeGelItemBlock(int id)
{
super(id);
super(id, "block.slime.congealed", 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.slime.congealed.").append(blockType[pos]).toString();
}
}
@@ -1,33 +1,16 @@
package tconstruct.items.blocks;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class SlimeGrassItemBlock extends ItemBlock
public class SlimeGrassItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "blue", "dirt" };
public static final String blockTypes[] = { "blue", "dirt" };
public SlimeGrassItemBlock(int id)
{
super(id);
super(id, "block.slime.grass", 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.slime.grass.").append(blockType[pos]).toString();
}
}
@@ -4,30 +4,21 @@ import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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;
public class SlimeLeavesItemBlock extends ItemBlock
public class SlimeLeavesItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "blue" };
public static final String blockTypes[] = { "blue" };
public SlimeLeavesItemBlock(int id)
{
super(id);
super(id, "block.slime.leaves", 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.slime.leaves.").append(blockType[pos]).toString();
}
}
@@ -1,33 +1,17 @@
package tconstruct.items.blocks;
import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
public class SlimeSaplingItemBlock extends ItemBlock
public class SlimeSaplingItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "bluegreen" };
public static final String blockTypes[] = { "bluegreen" };
public SlimeSaplingItemBlock(int id)
{
super(id);
super(id, "block.slime.sapling", 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.slime.sapling.").append(blockType[pos]).toString();
}
}
@@ -1,39 +1,30 @@
package tconstruct.items.blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.util.Icon;
import net.minecraft.util.MathHelper;
import tconstruct.common.TRepo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class SlimeTallGrassItem extends ItemBlock
public class SlimeTallGrassItem extends MultiItemBlock
{
public static final String blockType[] = { "tallgrass", "tallgrass.fern" };
public static final String blockTypes[] = { "tallgrass", "tallgrass.fern" };
public SlimeTallGrassItem(int id)
{
super(id);
super(id,"block.slime", blockTypes );
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage (int meta)
{
int arr = MathHelper.clamp_int(meta, 0, blockType.length);
int arr = MathHelper.clamp_int(meta, 0, this.blockType.length);
return TRepo.slimeTallGrass.getIcon(0, arr);
}
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("block.slime.").append(blockType[pos]).toString();
}
}
@@ -4,33 +4,23 @@ import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
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;
public class SmelteryItemBlock extends ItemBlock
public class SmelteryItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "Controller", "Drain", "Brick", "Furnace", "Stone", "Cobblestone", "Paver", "Brick.Cracked", "Road", "Brick.Fancy", "Brick.Square" };
public static final String blockTypes[] = { "Controller", "Drain", "Brick", "Furnace", "Stone", "Cobblestone", "Paver", "Brick.Cracked", "Road", "Brick.Fancy", "Brick.Square" };
public SmelteryItemBlock(int id)
{
super(id);
super(id, "Smeltery", 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("Smeltery.").append(blockType[pos]).toString();
}
@Override
@SideOnly(Side.CLIENT)
@@ -5,7 +5,6 @@ import java.util.List;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.entity.player.EntityPlayer;
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;
@@ -2,35 +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;
public class SpeedBlockItem extends ItemBlock
public class SpeedBlockItem extends MultiItemBlock
{
public static final String blockType[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
"brownstone.smooth.chiseled" };
public SpeedBlockItem(int id)
{
super(id);
super(id, "block", 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]).toString();
}
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
int metadata = stack.getItemDamage();
@@ -2,41 +2,29 @@ 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;
public class SpeedSlabItem extends ItemBlock
public class SpeedSlabItem extends MultiItemBlock
{
public static final String blockType[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road", "brownstone.smooth.fancy",
"brownstone.smooth.chiseled" };
public static final String blockTypes[] = { "brownstone.rough", "brownstone.rough.road", "brownstone.smooth", "brownstone.smooth.brick", "brownstone.smooth.road",
"brownstone.smooth.fancy", "brownstone.smooth.chiseled" };
public SpeedSlabItem(int id)
{
super(id);
super(id, "block", "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.").append(blockType[pos]).append(".slab").toString();
}
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
{
int metadata = stack.getItemDamage() % 8;
if (metadata == 1 || metadata == 4)
list.add(StatCollector.translateToLocal("speedblock.slab1.tooltip"));
list.add(StatCollector.translateToLocal("speedblock1.tooltip"));
else
list.add(StatCollector.translateToLocal("speedblock.slab2.tooltip"));
list.add(StatCollector.translateToLocal("speedblock2.tooltip"));
}
}
@@ -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 StainedGlassClearItem extends ItemBlock
public class StainedGlassClearItem extends MultiItemBlock
{
public static final String blockType[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
public StainedGlassClearItem(int id)
{
super(id);
super(id, "block.stainedglass", 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.stainedglass.").append(blockType[pos]).toString();
}
}
@@ -1,28 +1,17 @@
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 StainedGlassClearPaneItem extends ItemBlock
public class StainedGlassClearPaneItem extends MultiItemBlock
{
public static final String blockType[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan", "purple", "blue", "brown", "green", "red", "black" };
public static final String blockTypes[] = { "white", "orange", "magenta", "lightblue", "yellow", "lime", "pink", "gray", "lightgray", "cyan",
"purple", "blue", "brown", "green", "red", "black" };
public StainedGlassClearPaneItem(int id)
{
super(id);
super(id, "block.stainedglass", "pane", 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.stainedglass.").append(blockType[pos]).append(".pane").toString();
}
}
@@ -1,30 +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 ToolStationItemBlock extends ItemBlock
public class ToolStationItemBlock extends MultiItemBlock
{
public static final String blockType[] = { "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper",
public static final String blockTypes[] = { "Crafter", "Parts", "Parts", "Parts", "Parts", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternChest", "PatternShaper",
"PatternShaper", "PatternShaper", "PatternShaper", "CastingTable" };
public ToolStationItemBlock(int id)
{
super(id);
super(id, "ToolStation", blockTypes);
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
@Override
public String getUnlocalizedName (ItemStack itemstack)
{
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, blockType.length - 1);
return (new StringBuilder()).append("ToolStation.").append(blockType[pos]).toString();
}
}
@@ -1,38 +1,27 @@
package tconstruct.items.blocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemDye;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class WoolSlab1Item extends ItemBlock
public class WoolSlab1Item extends MultiItemBlock
{
int blockID;
Block block;
public WoolSlab1Item(int id)
{
super(id);
super(id, "", "slab", ItemDye.dyeColorNames);
this.setSpecialIndex(7, 15);
this.blockID = id + 256;
this.block = Block.blocksList[id + 256];
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 7);
return super.getUnlocalizedName() + "." + ItemDye.dyeColorNames[15 - i] + ".slab";
}
@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)
{
@@ -1,35 +1,27 @@
package tconstruct.items.blocks;
import mantle.blocks.abstracts.MultiItemBlock;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.*;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class WoolSlab2Item extends ItemBlock
public class WoolSlab2Item extends MultiItemBlock
{
int blockID;
Block block;
public WoolSlab2Item(int id)
{
super(id);
super(id, "", "slab" ,ItemDye.dyeColorNames);
this.setSpecialIndex(7,7);
this.blockID = id + 256;
this.block = Block.blocksList[id + 256];
setMaxDamage(0);
setHasSubtypes(true);
}
public int getMetadata (int meta)
{
return meta;
}
public String getUnlocalizedName (ItemStack par1ItemStack)
{
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 7);
return super.getUnlocalizedName() + "." + ItemDye.dyeColorNames[7 - i] + ".slab";
}
@Override
public boolean onItemUse (ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ)