| package li.cil.oc.common.event |
| import cpw.mods.fml.common.eventhandler.SubscribeEvent |
| import li.cil.oc.Settings |
| import li.cil.oc.api.event.FileSystemAccessEvent |
| import li.cil.oc.api.internal.Rack |
| import li.cil.oc.common.tileentity.Case |
| import li.cil.oc.common.tileentity.DiskDrive |
| import li.cil.oc.common.tileentity.Raid |
| import li.cil.oc.server.component.Server |
| object FileSystemAccessHandler { |
| def onFileSystemAccess(e: FileSystemAccessEvent.Server) { |
| for (slot <- 0 until t.getSizeInventory) { |
| t.getMountable(slot) match { |
| val containsNode = server.componentSlot(e.getNode.address) >= 0 |
| server.lastAccess = System.currentTimeMillis() |
| def onFileSystemAccess(e: FileSystemAccessEvent.Client) { |
| val volume = Settings.get.soundVolume |
| e.getWorld.playSound(e.getX, e.getY, e.getZ, e.getSound, volume, 1, false) |
| case t: DiskDrive => t.lastAccess = System.currentTimeMillis() |
| case t: Case => t.lastAccess = System.currentTimeMillis() |
| case t: Raid => t.lastAccess = System.currentTimeMillis() |