mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-27 06:53:08 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers into MC1.7
This commit is contained in:
commit
a2f1e1d3eb
@ -86,8 +86,8 @@ class Charger extends traits.Environment with traits.RedstoneAware with traits.R
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
override protected def onRedstoneInputChanged(side: ForgeDirection) {
|
||||
super.onRedstoneInputChanged(side)
|
||||
override protected def updateRedstoneInput(side: ForgeDirection) {
|
||||
super.updateRedstoneInput(side)
|
||||
val signal = math.max(0, math.min(15, ForgeDirection.VALID_DIRECTIONS.map(input).max))
|
||||
|
||||
if (invertSignal) chargeSpeed = (15 - signal) / 15.0
|
||||
|
@ -1,5 +1,6 @@
|
||||
package li.cil.oc.server.driver.item
|
||||
|
||||
import cpw.mods.fml.common.Loader
|
||||
import dan200.computercraft.api.media.IMedia
|
||||
import li.cil.oc
|
||||
import li.cil.oc.api.driver.Slot
|
||||
@ -12,10 +13,12 @@ import net.minecraft.nbt.NBTTagCompound
|
||||
import net.minecraft.tileentity.TileEntity
|
||||
|
||||
object FileSystem extends Item {
|
||||
override def worksWith(stack: ItemStack) = isOneOf(stack, Items.hdd1, Items.hdd2, Items.hdd3, Items.floppyDisk) || ComputerCraft.isDisk(stack)
|
||||
override def worksWith(stack: ItemStack) =
|
||||
isOneOf(stack, Items.hdd1, Items.hdd2, Items.hdd3, Items.floppyDisk) ||
|
||||
(Loader.isModLoaded("ComputerCraft") && ComputerCraft.isDisk(stack))
|
||||
|
||||
override def createEnvironment(stack: ItemStack, container: TileEntity) =
|
||||
if (ComputerCraft.isDisk(stack) && container != null) {
|
||||
if (Loader.isModLoaded("ComputerCraft") && ComputerCraft.isDisk(stack) && container != null) {
|
||||
val address = addressFromTag(dataTag(stack))
|
||||
val mount = ComputerCraft.createDiskMount(stack, container.getWorldObj)
|
||||
Option(oc.api.FileSystem.asManagedEnvironment(mount, new ComputerCraftLabel(stack), container)) match {
|
||||
@ -24,14 +27,15 @@ object FileSystem extends Item {
|
||||
environment
|
||||
case _ => null
|
||||
}
|
||||
} else Items.multi.subItem(stack) match {
|
||||
}
|
||||
else Items.multi.subItem(stack) match {
|
||||
case Some(hdd: HardDiskDrive) => createEnvironment(stack, hdd.kiloBytes * 1024, container)
|
||||
case Some(disk: FloppyDisk) => createEnvironment(stack, Settings.get.floppySize * 1024, container)
|
||||
case _ => null
|
||||
}
|
||||
|
||||
override def slot(stack: ItemStack) =
|
||||
if (ComputerCraft.isDisk(stack)) Slot.Disk
|
||||
if (Loader.isModLoaded("ComputerCraft") && ComputerCraft.isDisk(stack)) Slot.Disk
|
||||
else Items.multi.subItem(stack) match {
|
||||
case Some(hdd: HardDiskDrive) => Slot.HardDiskDrive
|
||||
case Some(disk: FloppyDisk) => Slot.Disk
|
||||
|
Loading…
x
Reference in New Issue
Block a user