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,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 CastingChannelItem extends ItemBlock
|
||||
public class CastingChannelItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "Channel" };
|
||||
public static final String blockTypes[] = { "Channel" };
|
||||
|
||||
public CastingChannelItem(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();
|
||||
}
|
||||
}
|
||||
@@ -4,34 +4,30 @@ 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 CraftedSoilItemBlock extends ItemBlock
|
||||
public class CraftedSoilItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil", "blue", "dirt", "Grout" };
|
||||
public static final String blockTypes[] = { "Slime", "Grout", "BlueSlime", "GraveyardSoil", "ConsecratedSoil", "blue", "dirt", "Grout" };
|
||||
|
||||
public CraftedSoilItemBlock(int id)
|
||||
{
|
||||
super(id);
|
||||
super(id, "CraftedSoil", 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);
|
||||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, this.blockType.length - 1);
|
||||
if (pos <= 4)
|
||||
return (new StringBuilder()).append("CraftedSoil.").append(blockType[pos]).toString();
|
||||
return (new StringBuilder()).append("block.slime.soil.").append(blockType[pos]).toString();
|
||||
return super.getUnlocalizedName(itemstack);
|
||||
return (new StringBuilder()).append("block.slime.soil.").append(this.blockType[pos]).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,33 +1,28 @@
|
||||
package tconstruct.items.blocks;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import mantle.blocks.abstracts.MultiItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class CraftingSlabItemBlock extends ItemBlock
|
||||
public class CraftingSlabItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" };
|
||||
public static final String blockTypes[] = { "tile.CraftingStation", "Crafter", "Parts", "PatternShaper", "PatternChest", "tile.ToolForge" };
|
||||
|
||||
public CraftingSlabItemBlock(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);
|
||||
int pos = MathHelper.clamp_int(itemstack.getItemDamage(), 0, this.blockType.length - 1);
|
||||
if (pos == 0 || pos == 5)
|
||||
{
|
||||
return blockType[pos];
|
||||
return this.blockType[pos];
|
||||
}
|
||||
return (new StringBuilder()).append("ToolStation.").append(blockType[pos]).toString();
|
||||
return super.getUnlocalizedName(itemstack);
|
||||
}
|
||||
}
|
||||
@@ -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.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class GlassBlockItem extends ItemBlock
|
||||
public class GlassBlockItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "glass.pure" };//, "glass.soul", "glass.soul.pure" };
|
||||
public static final String blockTypes[] = { "pure" };//, "soul", "soul.pure" };
|
||||
|
||||
public GlassBlockItem(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]).toString();
|
||||
}
|
||||
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
if (stack.hasTagCompound() && stack.getItemDamage() == 0)
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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 GravelOreItem extends ItemBlock
|
||||
public class GravelOreItem extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
|
||||
public static final String blockTypes[] = { "iron", "gold", "copper", "tin", "aluminum", "cobalt" };
|
||||
|
||||
public GravelOreItem(int id)
|
||||
{
|
||||
super(id);
|
||||
super(id, "block.ore.gravel", 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.ore.gravel.").append(blockType[pos]).toString();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -9,27 +10,18 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class LavaTankItemBlock extends ItemBlock
|
||||
public class LavaTankItemBlock extends MultiItemBlock
|
||||
{
|
||||
public static final String blockType[] = { "Tank", "Gague", "Window" };
|
||||
public static final String blockTypes[] = { "Tank", "Gague", "Window" };
|
||||
|
||||
public LavaTankItemBlock(int id)
|
||||
{
|
||||
super(id);
|
||||
super(id, "LavaTank", 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("LavaTank.").append(blockType[pos]).toString();
|
||||
}
|
||||
|
||||
public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4)
|
||||
{
|
||||
|
||||
@@ -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