v5.5.4 Beta #11
*Added TileEntity parameter to canTransferGas(). *Added TileEntity parameter to canTransferEnergy(). Closes #70.
This commit is contained in:
parent
13f62827f3
commit
2a54ef6765
|
@ -25,7 +25,7 @@ public class GasTransmission
|
|||
{
|
||||
TileEntity tube = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation);
|
||||
|
||||
if(tube instanceof IPressurizedTube && ((IPressurizedTube)tube).canTransferGas())
|
||||
if(tube instanceof IPressurizedTube && ((IPressurizedTube)tube).canTransferGas(tileEntity))
|
||||
{
|
||||
tubes[orientation.ordinal()] = tube;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package mekanism.api;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface IPressurizedTube
|
||||
{
|
||||
/**
|
||||
* Whether or not this tube can transfer gas.
|
||||
* @return if the tube can transfer gas
|
||||
*/
|
||||
public boolean canTransferGas();
|
||||
public boolean canTransferGas(TileEntity fromTile);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package mekanism.api;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
/**
|
||||
* Implement this in your TileEntity class if the block can transfer energy as a Universal Cable.
|
||||
* @author AidanBrady
|
||||
|
@ -11,5 +13,5 @@ public interface IUniversalCable
|
|||
* Whether or not this cable can transfer energy.
|
||||
* @return if the cable can transfer energy
|
||||
*/
|
||||
public boolean canTransferEnergy();
|
||||
public boolean canTransferEnergy(TileEntity fromTile);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public final class CableUtils
|
|||
{
|
||||
TileEntity cable = VectorHelper.getTileEntityFromSide(tileEntity.worldObj, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord), orientation);
|
||||
|
||||
if(cable instanceof IUniversalCable && ((IUniversalCable)cable).canTransferEnergy())
|
||||
if(cable instanceof IUniversalCable && ((IUniversalCable)cable).canTransferEnergy(tileEntity))
|
||||
{
|
||||
cables[orientation.ordinal()] = cable;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
public class TileEntityPressurizedTube extends TileEntity implements IPressurizedTube, ITubeConnection
|
||||
{
|
||||
@Override
|
||||
public boolean canTransferGas()
|
||||
public boolean canTransferGas(TileEntity fromTile)
|
||||
{
|
||||
return worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) == 0;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canTransferEnergy()
|
||||
public boolean canTransferEnergy(TileEntity fromTile)
|
||||
{
|
||||
return worldObj.getBlockPowerInput(xCoord, yCoord, zCoord) == 0;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public class TileEntityUniversalCable extends TileEntity implements IUniversalCa
|
|||
{
|
||||
ArrayList<TileEntity> ignored = new ArrayList<TileEntity>();
|
||||
ignored.add(VectorHelper.getTileEntityFromSide(worldObj, new Vector3(xCoord, yCoord, zCoord), from));
|
||||
return canTransferEnergy() ? (int)Math.min(100, new EnergyTransferProtocol(this, this, ignored).neededEnergy()) : 0;
|
||||
return canTransferEnergy(VectorHelper.getTileEntityFromSide(worldObj, new Vector3(xCoord, yCoord, zCoord), from)) ? (int)Math.min(100, new EnergyTransferProtocol(this, this, ignored).neededEnergy()) : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue