blob: da7b2a2270de825c72ed3f6350ed9da10fd55e33 [file] [log] [blame] [raw]
package li.cil.oc.common.item
import li.cil.oc.Settings
import net.minecraft.item.ItemStack
class HardDiskDrive(val parent: Delegator, val tier: Int) extends traits.Delegate with traits.ItemTier with traits.FileSystemLike {
override val unlocalizedName = super.unlocalizedName + tier
val kiloBytes = Settings.get.hddSizes(tier)
val platterCount = Settings.get.hddPlatterCounts(tier)
override def displayName(stack: ItemStack) = {
val localizedName = parent.internalGetItemStackDisplayName(stack)
Some(if (kiloBytes >= 1024) {
localizedName + s" (${kiloBytes / 1024}MB)"
}
else {
localizedName + s" (${kiloBytes}KB)"
})
}
}