public abstract class HeatBehaviour
extends java.lang.Object
implements net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>
IHeatRegistry.registerHeatBehaviour(ResourceLocation, Supplier)
This can be used to add heat dependent logic to non-TE's or blocks you don't have access to. For example, PneumaticCraft uses this to power Furnaces with heat, and to turn Lava into Obsidian when heat is drained. Of course, this requires a ticking heat exchanger block (e.g. a compressed iron block or any heatable machine) to perform the ticking behaviour; simply adding a heat behaviour to lava won't make lava spontaneously turn into obsidian. A ticking heat exchanger is needed to actually drain the heat.
For general blockstate transitions, datapack recipes are the preferred way to add custom heat behaviours. See
data/pneumaticcraft/recipes/block_heat_properties/*.json
| Constructor and Description |
|---|
HeatBehaviour() |
| Modifier and Type | Method and Description |
|---|---|
void |
deserializeNBT(net.minecraft.nbt.CompoundNBT nbt) |
boolean |
equals(java.lang.Object o) |
net.minecraft.block.BlockState |
getBlockState() |
net.minecraft.tileentity.TileEntity |
getCachedTileEntity() |
net.minecraft.util.Direction |
getDirection() |
IHeatExchangerLogic |
getHeatExchanger() |
abstract net.minecraft.util.ResourceLocation |
getId()
Unique id for this behaviour, also used in NBT saving.
|
net.minecraft.util.math.BlockPos |
getPos() |
net.minecraft.world.World |
getWorld() |
int |
hashCode() |
HeatBehaviour |
initialize(IHeatExchangerLogic connectedHeatLogic,
net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
net.minecraft.util.Direction direction)
This method is called by the connected
IHeatExchangerLogic when it initialises itself as a hull
heat exchanger; this happens when the owning tile entity gets a neighbor block update. |
abstract boolean |
isApplicable()
Return true when this heat behaviour is applicable for this coordinate.
|
net.minecraft.nbt.CompoundNBT |
serializeNBT() |
abstract void |
tick()
Called every tick to update this behaviour.
|
public HeatBehaviour initialize(IHeatExchangerLogic connectedHeatLogic, net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos, net.minecraft.util.Direction direction)
IHeatExchangerLogic when it initialises itself as a hull
heat exchanger; this happens when the owning tile entity gets a neighbor block update. You can override
and extend this method, but be sure to call the super method!connectedHeatLogic - the connected heat exchanger logicworld - the worldpos - block pos of the owning tile entitydirection - direction of this behaviour (from the tile entity's point of view)public IHeatExchangerLogic getHeatExchanger()
public net.minecraft.world.World getWorld()
public net.minecraft.util.math.BlockPos getPos()
public net.minecraft.util.Direction getDirection()
public net.minecraft.tileentity.TileEntity getCachedTileEntity()
public net.minecraft.block.BlockState getBlockState()
public abstract net.minecraft.util.ResourceLocation getId()
public abstract boolean isApplicable()
public abstract void tick()
public net.minecraft.nbt.CompoundNBT serializeNBT()
serializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>public void deserializeNBT(net.minecraft.nbt.CompoundNBT nbt)
deserializeNBT in interface net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundNBT>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object