Collapsed BlockDecoration's Singleton into its instance class

This commit is contained in:
Robert S 2014-10-18 09:48:04 -04:00
parent 2529dda2c5
commit 9485ad241a

View file

@ -19,37 +19,30 @@ import resonantinduction.core.Reference
* @author Calclavia * @author Calclavia
* *
*/ */
object BlockDecoration class BlockDecoration extends SpatialBlock(Material.rock)
{ {
var iconNames = Array("material_stone_brick", "material_stone_brick2", "material_stone_chiseled", "material_stone_cobble", "material_stone_cracked", "material_stone", "material_stone_slab", "material_stone_mossy", "material_steel_dark", "material_steel_tint", "material_steel") var iconNames = Array("material_stone_brick", "material_stone_brick2", "material_stone_chiseled", "material_stone_cobble", "material_stone_cracked", "material_stone", "material_stone_slab", "material_stone_mossy", "material_steel_dark", "material_steel_tint", "material_steel")
var icons = new Array[IIcon](iconNames.length) var icons = new Array[IIcon](iconNames.length)
}
class BlockDecoration extends SpatialBlock(Material.rock) // Constructor
{
name = "industrialStone" name = "industrialStone"
blockHardness = 1 blockHardness = 1
stepSound = Block.soundTypeStone stepSound = Block.soundTypeStone
this.itemBlock = classOf[ItemBlockMetadata] this.itemBlock = classOf[ItemBlockMetadata]
def damageDropped(par1: Int): Int =
{
return par1
}
override def getIcon(side: Int, metadata: Int): IIcon = override def getIcon(side: Int, metadata: Int): IIcon =
{ {
return BlockDecoration.icons(metadata) return icons(metadata)
} }
override def registerIcons(register: IIconRegister) override def registerIcons(register: IIconRegister)
{ {
super.registerIcons(register) super.registerIcons(register)
(0 until BlockDecoration.icons.size) foreach (i => BlockDecoration.icons(i) = register.registerIcon(Reference.prefix + BlockDecoration.iconNames(i))) (0 until icons.size) foreach (i => icons(i) = register.registerIcon(Reference.prefix + iconNames(i)))
} }
override def getSubBlocks(item: Item, par2CreativeTabs: CreativeTabs, list: List[_]) override def getSubBlocks(item: Item, par2CreativeTabs: CreativeTabs, list: List[_])
{ {
(0 until BlockDecoration.iconNames.length) foreach (i => list.add(new ItemStack(item, 1, i))) (0 until iconNames.length) foreach (i => list.add(new ItemStack(item, 1, i)))
} }
} }