Backwards-compatibility for IGasHandler. #2267
This commit is contained in:
parent
050f3351e2
commit
0064f09d8c
20 changed files with 212 additions and 2 deletions
|
@ -16,6 +16,9 @@ public interface IGasHandler
|
|||
*/
|
||||
public int receiveGas(ForgeDirection side, GasStack stack, boolean doTransfer);
|
||||
|
||||
@Deprecated
|
||||
public int receiveGas(ForgeDirection side, GasStack stack);
|
||||
|
||||
/**
|
||||
* Draws a certain amount of gas from this block.
|
||||
* @param amount - amount to draw
|
||||
|
@ -23,6 +26,9 @@ public interface IGasHandler
|
|||
*/
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer);
|
||||
|
||||
@Deprecated
|
||||
public GasStack drawGas(ForgeDirection side, int amount);
|
||||
|
||||
/**
|
||||
* Whether or not this block can accept gas from a certain side.
|
||||
* @param side - side to check
|
||||
|
|
|
@ -81,12 +81,24 @@ public class SharedInventory implements IStrictEnergyStorage, IFluidHandler, IGa
|
|||
return storedGas.receive(stack, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return storedGas.draw(amount, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -296,12 +296,24 @@ public class PartPressurizedTube extends PartTransmitter<GasNetwork> implements
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -391,12 +391,24 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -57,12 +57,24 @@ public class TileEntityAmbientAccumulator extends TileEntityContainerBlock imple
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return collectedGas.draw(amount, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -376,12 +376,24 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -415,12 +415,24 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -429,6 +429,12 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -440,6 +446,12 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectricMachine<InjectionRecipe> implements IGasHandler, ITubeConnection
|
||||
public class TileEntityChemicalInjectionChamber extends TileEntityAdvancedElectricMachine<InjectionRecipe>
|
||||
{
|
||||
public TileEntityChemicalInjectionChamber()
|
||||
{
|
||||
|
|
|
@ -484,6 +484,12 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -495,6 +501,12 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -691,6 +691,12 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -706,6 +712,12 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -161,12 +161,24 @@ public class TileEntityEntangledBlock extends TileEntityElectricBlock implements
|
|||
return sharedInventory == null ? 0 : sharedInventory.receiveGas(side, stack, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return sharedInventory == null ? null : sharedInventory.drawGas(side, amount, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -993,6 +993,12 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
@ -1021,6 +1027,12 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -151,12 +151,24 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
|
|||
return gasTank.receive(stack, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -397,6 +397,12 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -408,6 +414,12 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine<PurificationRecipe> implements IGasHandler, ITubeConnection
|
||||
public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine<PurificationRecipe>
|
||||
{
|
||||
public TileEntityPurificationChamber()
|
||||
{
|
||||
|
|
|
@ -519,12 +519,24 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
|
|||
return gasTank.receive(stack, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
return gasTank.draw(amount, doTransfer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -282,6 +282,12 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -293,6 +299,12 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -260,6 +260,12 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
|
@ -296,6 +302,12 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
|
@ -128,6 +128,12 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||
{
|
||||
return receiveGas(side, stack, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount, boolean doTransfer)
|
||||
{
|
||||
|
@ -142,6 +148,12 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GasStack drawGas(ForgeDirection side, int amount)
|
||||
{
|
||||
return drawGas(side, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue