public class MachineAirHandler extends BasicAirHandler implements IAirHandlerMachine, IManoMeasurable
IAirHandlerMachine.Connection| Constructor and Description |
|---|
MachineAirHandler(float dangerPressure,
float criticalPressure,
int volume) |
| Modifier and Type | Method and Description |
|---|---|
void |
deserializeNBT(net.minecraft.nbt.CompoundNBT nbt) |
java.util.List<IAirHandlerMachine.Connection> |
getConnectedAirHandlers(net.minecraft.tileentity.TileEntity ownerTE)
Get a list of all air handlers connected to this one.
|
float |
getCriticalPressure()
Get the "critical" pressure level, which is the hard maximum pressure for this handler.
|
float |
getDangerPressure()
Get the "danger" pressure level.
|
net.minecraft.util.Direction |
getSideLeaking()
Get the side which is leaking air, if any.
|
int |
getVolume()
Get the effective volume of this air handler.
|
void |
printManometerMessage(net.minecraft.entity.player.PlayerEntity player,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo)
This method is invoked by the Manometer when a player right-clicks a TE or Entity with this interface implemented.
|
net.minecraft.nbt.CompoundNBT |
serializeNBT() |
void |
setConnectedFaces(java.util.List<net.minecraft.util.Direction> sides)
Set the connected faces of this air handler.
|
void |
setHasSecurityUpgrade(boolean hasSecurityUpgrade)
Should be called by the owning tile entity when its security upgrades change.
|
void |
setPressure(float pressure)
Set the pressure of this handler directly.
|
void |
setSideLeaking(net.minecraft.util.Direction dir)
Mark a face of the air handler as leaking or otherwise.
|
void |
setVolumeUpgrades(int newVolumeUpgrades)
Should be called by the owning tile entity when its volume upgrades change.
|
void |
tick(net.minecraft.tileentity.TileEntity ownerTE)
Must be called every tick by the owning tile entity.
|
addAir, getAir, getBaseVolume, getPressure, maxPressure, setBaseVolumeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddAir, getAir, getBaseVolume, getPressure, maxPressure, setBaseVolumepublic MachineAirHandler(float dangerPressure,
float criticalPressure,
int volume)
public int getVolume()
IAirHandlerIItemRegistry.registerPneumaticVolumeModifier(ItemVolumeModifier)).getVolume in interface IAirHandlergetVolume in class BasicAirHandlerpublic float getDangerPressure()
IAirHandlerMachinegetDangerPressure in interface IAirHandlerMachinepublic float getCriticalPressure()
IAirHandlerMachinegetCriticalPressure in interface IAirHandlerMachinepublic void setPressure(float pressure)
IAirHandlerMachineIAirHandler.addAir(int) method should be used.setPressure in interface IAirHandlerMachinepressure - the new pressure, in barpublic void setVolumeUpgrades(int newVolumeUpgrades)
IAirHandlerMachinesetVolumeUpgrades in interface IAirHandlerMachinenewVolumeUpgrades - new number of volume upgradespublic void setHasSecurityUpgrade(boolean hasSecurityUpgrade)
IAirHandlerMachinesetHasSecurityUpgrade in interface IAirHandlerMachinehasSecurityUpgrade - true if the holder has one or more security upgradespublic void setConnectedFaces(java.util.List<net.minecraft.util.Direction> sides)
IAirHandlerMachineAbstractBlock.neighborChanged(BlockState, World, BlockPos, Block, BlockPos, boolean).
This also invalidates any cached neighbour data.
setConnectedFaces in interface IAirHandlerMachinesides - a list of sides on which this air handler should be offered as a capabilitypublic void tick(net.minecraft.tileentity.TileEntity ownerTE)
IAirHandlerMachinetick in interface IAirHandlerMachineownerTE - the owning tile entitypublic void setSideLeaking(@Nullable
net.minecraft.util.Direction dir)
IAirHandlerMachinepressure * 40 + 20 mL.
(Note: in theory, an air handler could leak in multiple directions at once, but this is a simplified implementation to keep the code straightforward & efficient, while still being effective)
setSideLeaking in interface IAirHandlerMachinedir - the direction the leak is occurring (affects particle velocities), or null for no leak@Nullable public net.minecraft.util.Direction getSideLeaking()
IAirHandlerMachinegetSideLeaking in interface IAirHandlerMachinepublic net.minecraft.nbt.CompoundNBT serializeNBT()
serializeNBT in interface IAirHandlerMachineserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>serializeNBT in class BasicAirHandlerpublic void deserializeNBT(net.minecraft.nbt.CompoundNBT nbt)
deserializeNBT in interface IAirHandlerMachinedeserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>deserializeNBT in class BasicAirHandlerpublic java.util.List<IAirHandlerMachine.Connection> getConnectedAirHandlers(net.minecraft.tileentity.TileEntity ownerTE)
IAirHandlerMachinegetConnectedAirHandlers in interface IAirHandlerMachineownerTE - the owning tile entitypublic void printManometerMessage(net.minecraft.entity.player.PlayerEntity player,
java.util.List<net.minecraft.util.text.ITextComponent> curInfo)
IManoMeasurableprintManometerMessage in interface IManoMeasurableplayer - player who is right-clicking the measurable TE, and therefore needs to get the messagecurInfo - list you can append info to. If you don't append any info no air will be used.