mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 10:51:55 -04:00
Should fix #322.
This commit is contained in:
parent
87eb274576
commit
ab355a283d
@ -45,7 +45,7 @@ trait BuildCraft extends Common with IPowerReceptor {
|
||||
|
||||
@Optional.Method(modid = "BuildCraftAPI|power")
|
||||
def getPowerReceiver(side: ForgeDirection) =
|
||||
if (canConnect(side))
|
||||
if (canConnectPower(side))
|
||||
getPowerProvider.getPowerReceiver
|
||||
else null
|
||||
|
||||
|
@ -14,7 +14,7 @@ trait Common extends TileEntity {
|
||||
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
def canConnect(side: ForgeDirection) =
|
||||
def canConnectPower(side: ForgeDirection) =
|
||||
!Settings.get.ignorePower && side != null && side != ForgeDirection.UNKNOWN &&
|
||||
(if (isClient) hasConnector(side) else connector(side).isDefined)
|
||||
|
||||
|
@ -33,7 +33,7 @@ trait IndustrialCraft2 extends Common with IEnergySink {
|
||||
// ----------------------------------------------------------------------- //
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
def acceptsEnergyFrom(emitter: net.minecraft.tileentity.TileEntity, direction: ForgeDirection) = canConnect(direction)
|
||||
def acceptsEnergyFrom(emitter: net.minecraft.tileentity.TileEntity, direction: ForgeDirection) = canConnectPower(direction)
|
||||
|
||||
@Optional.Method(modid = "IC2")
|
||||
def injectEnergyUnits(directionFrom: ForgeDirection, amount: Double) =
|
||||
|
@ -8,7 +8,7 @@ import net.minecraftforge.common.ForgeDirection
|
||||
@Optional.Interface(iface = "cofh.api.energy.IEnergyHandler", modid = "ThermalExpansion")
|
||||
trait ThermalExpansion extends Common with IEnergyHandler {
|
||||
@Optional.Method(modid = "ThermalExpansion")
|
||||
def canInterface(from: ForgeDirection) = canConnect(from)
|
||||
def canInterface(from: ForgeDirection) = canConnectPower(from)
|
||||
|
||||
@Optional.Method(modid = "ThermalExpansion")
|
||||
def receiveEnergy(from: ForgeDirection, maxReceive: Int, simulate: Boolean) =
|
||||
|
@ -11,7 +11,7 @@ import universalelectricity.api.energy.{IEnergyInterface, IEnergyContainer}
|
||||
))
|
||||
trait UniversalElectricity extends Common with IEnergyInterface with IEnergyContainer {
|
||||
@Optional.Method(modid = "UniversalElectricity")
|
||||
override def canConnect(direction: ForgeDirection, source: AnyRef) = canConnect(direction)
|
||||
override def canConnect(direction: ForgeDirection, source: AnyRef) = canConnectPower(direction)
|
||||
|
||||
@Optional.Method(modid = "UniversalElectricity")
|
||||
override def onReceiveEnergy(from: ForgeDirection, receive: Long, doReceive: Boolean) =
|
||||
|
Loading…
x
Reference in New Issue
Block a user