Collapsed BlockDecoration's Singleton into its instance class
This commit is contained in:
parent
2529dda2c5
commit
9485ad241a
|
@ -19,37 +19,30 @@ import resonantinduction.core.Reference
|
|||
* @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 icons = new Array[IIcon](iconNames.length)
|
||||
}
|
||||
|
||||
class BlockDecoration extends SpatialBlock(Material.rock)
|
||||
{
|
||||
|
||||
// Constructor
|
||||
name = "industrialStone"
|
||||
blockHardness = 1
|
||||
stepSound = Block.soundTypeStone
|
||||
this.itemBlock = classOf[ItemBlockMetadata]
|
||||
|
||||
def damageDropped(par1: Int): Int =
|
||||
{
|
||||
return par1
|
||||
}
|
||||
|
||||
override def getIcon(side: Int, metadata: Int): IIcon =
|
||||
{
|
||||
return BlockDecoration.icons(metadata)
|
||||
return icons(metadata)
|
||||
}
|
||||
|
||||
override def registerIcons(register: IIconRegister)
|
||||
{
|
||||
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[_])
|
||||
{
|
||||
(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)))
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue