package com.harry9137.ct.block; import com.harry9137.ct.CTTab; import com.harry9137.ct.reference.reference; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public abstract class BlockCT extends Block { public int renderType; public String textureName; public BlockCT(Material material){ super(material); this.setCreativeTab(CTTab.CTTab); } @Override public String getUnlocalizedName() { return String.format("tile.%s%s", reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName())); } @Override public Block setUnlocalizedName(String name){ this.setTextureName(name); return super.setUnlocalizedName(name); } protected String getUnwrappedUnlocalizedName(String unlocalizedName) { return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1); } public BlockCT setRenderType(int id) { this.renderType = id; return this; } public abstract TileEntity createNewTileEntity(World world, int metadata); public void setTextureName(String texture){ this.textureName = texture; } public String getTextureName(){ return this.textureName; } }