Class ThermostatModule
java.lang.Object
me.desht.pneumaticcraft.common.tubemodules.AbstractTubeModule
me.desht.pneumaticcraft.common.tubemodules.AbstractNetworkedRedstoneModule
me.desht.pneumaticcraft.common.tubemodules.ThermostatModule
- All Implemented Interfaces:
TemperatureListener,INetworkedModule
public class ThermostatModule
extends AbstractNetworkedRedstoneModule
implements INetworkedModule, TemperatureListener
-
Field Summary
FieldsFields inherited from class me.desht.pneumaticcraft.common.tubemodules.AbstractTubeModule
advancedConfig, dir, higherBound, lowerBound, pressureTube, upgraded -
Constructor Summary
ConstructorsConstructorDescriptionThermostatModule(net.minecraft.core.Direction dir, PressureTubeBlockEntity pressureTube) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected intintprotected doubleGet the module's height (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)protected intnet.minecraft.world.item.ItemgetItem()intintgetTemperatureForLevel(int level) intdoublegetWidth()Get the module's width (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)booleanhasGui()Does this module have a gui? Server also needs to know about this, since module GUI's are opened in response to a packet from the server.booleanonActivated(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) protected voidonInputLevelChange(int level) Called when this module's input level is changed.voidvoidvoidonPlaced()voidCalled just before a module is removed from a pressure tube, either by a player wrenching it, or when data that is read from NBT causes the module to be removed.voidonTemperatureChanged(double prevTemperature, double newTemperature) Called when the monitored heat exchanger's temperature changes.voidreadFromNBT(net.minecraft.nbt.CompoundTag tag) voidsetColorChannel(int channel) voidsetTemperature(int temperature) voidsetThreshold(int threshold) voidsetUpdate(boolean update) voidnet.minecraft.nbt.CompoundTagwriteToNBT(net.minecraft.nbt.CompoundTag tag) Methods inherited from class me.desht.pneumaticcraft.common.tubemodules.AbstractNetworkedRedstoneModule
canConnectTo, fetchNetworkInputLevels, getInputLevel, isWatchingChannel, notifyInputLevelsChanged, onNetworkReform, setInputLevel, updateInputLevel, updateOutputMethods inherited from class me.desht.pneumaticcraft.common.tubemodules.AbstractTubeModule
canUpgrade, equals, getDirection, getDrops, getRedstoneLevel, getRenderBoundingBox, getShape, getThreshold, getTube, getType, hashCode, isFake, isInline, isInlineAndFocused, isUpgraded, isValid, markFake, sendDescriptionPacket, setChanged, tickClient, tickCommon, updateNeighbors, upgrade
-
Field Details
-
MIN_VALUE
public static final int MIN_VALUE- See Also:
-
MAX_VALUE
public static final int MAX_VALUE- See Also:
-
-
Constructor Details
-
ThermostatModule
-
-
Method Details
-
getTemperature
public int getTemperature() -
getTemperatureForLevel
public int getTemperatureForLevel(int level) -
setTemperature
public void setTemperature(int temperature) -
getThreshold
public int getThreshold() -
setThreshold
public void setThreshold(int threshold) -
setUpdate
public void setUpdate(boolean update) -
hasGui
public boolean hasGui()Description copied from class:AbstractTubeModuleDoes this module have a gui? Server also needs to know about this, since module GUI's are opened in response to a packet from the server.- Overrides:
hasGuiin classAbstractTubeModule- Returns:
- true if the module has a gui
-
getItem
public net.minecraft.world.item.Item getItem()- Specified by:
getItemin classAbstractTubeModule
-
getColorChannel
public int getColorChannel()- Specified by:
getColorChannelin interfaceINetworkedModule
-
getInputChannel
protected int getInputChannel()- Overrides:
getInputChannelin classAbstractNetworkedRedstoneModule- Returns:
- the input channel of this module, or -1 if not inputting
-
setColorChannel
public void setColorChannel(int channel) - Specified by:
setColorChannelin interfaceINetworkedModule
-
getWidth
public double getWidth()Description copied from class:AbstractTubeModuleGet the module's width (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)- Overrides:
getWidthin classAbstractTubeModule- Returns:
- the width
-
getHeight
protected double getHeight()Description copied from class:AbstractTubeModuleGet the module's height (in range 0..16 as passed toBlock.box(double, double, double, double, double, double)- Overrides:
getHeightin classAbstractTubeModule- Returns:
- the height
-
addInfo
- Overrides:
addInfoin classAbstractTubeModule
-
onActivated
public boolean onActivated(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand) - Overrides:
onActivatedin classAbstractTubeModule
-
onPlaced
public void onPlaced()- Overrides:
onPlacedin classAbstractNetworkedRedstoneModule
-
onRemoved
public void onRemoved()Description copied from class:AbstractTubeModuleCalled just before a module is removed from a pressure tube, either by a player wrenching it, or when data that is read from NBT causes the module to be removed.- Overrides:
onRemovedin classAbstractTubeModule
-
onNeighborBlockUpdate
public void onNeighborBlockUpdate()- Overrides:
onNeighborBlockUpdatein classAbstractTubeModule
-
onNeighborTileUpdate
public void onNeighborTileUpdate()- Overrides:
onNeighborTileUpdatein classAbstractTubeModule
-
tickServer
public void tickServer()- Overrides:
tickServerin classAbstractNetworkedRedstoneModule
-
calculateInputLevel
protected int calculateInputLevel()- Overrides:
calculateInputLevelin classAbstractNetworkedRedstoneModule- Returns:
- the current input signal level
-
onInputLevelChange
protected void onInputLevelChange(int level) Description copied from class:AbstractNetworkedRedstoneModuleCalled when this module's input level is changed.- Overrides:
onInputLevelChangein classAbstractNetworkedRedstoneModule- Parameters:
level- the new input level
-
writeToNBT
public net.minecraft.nbt.CompoundTag writeToNBT(net.minecraft.nbt.CompoundTag tag) - Overrides:
writeToNBTin classAbstractTubeModule
-
readFromNBT
public void readFromNBT(net.minecraft.nbt.CompoundTag tag) - Overrides:
readFromNBTin classAbstractTubeModule
-
onTemperatureChanged
public void onTemperatureChanged(double prevTemperature, double newTemperature) Description copied from interface:TemperatureListenerCalled when the monitored heat exchanger's temperature changes.- Specified by:
onTemperatureChangedin interfaceTemperatureListener- Parameters:
prevTemperature- the previous temperaturenewTemperature- the new temperature
-