mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user