Class ContaminationBehaviour
java.lang.Object
com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
com.petrolpark.compat.create.block.entity.behaviour.ContaminationBehaviour
public class ContaminationBehaviour
extends com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
Behaviour for Create Block Entities which can hold the Contaminants of the ItemStack used to place them.
Implementers must handle transferring those Contaminants themselves, probably here,
and the BlockItem must be tagged with petrolpark:contaminable_blocks. They must also handle transferring the Contaminants back to the Item when mined.
This is however all done automatically (in addition to this Behaviour being added) for any instances of a KineticBlock with a KineticBlockEntity whose BlockEntityType is in the tag petrolpark:contaminable_kinetic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GenericContaminationprotected net.minecraft.nbt.ListTagstatic final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<ContaminationBehaviour>protected booleanFields inherited from class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
blockEntity -
Constructor Summary
ConstructorsConstructorDescriptionContaminationBehaviour(com.simibubi.create.foundation.blockEntity.SmartBlockEntity be) -
Method Summary
Modifier and TypeMethodDescriptionvoidcom.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?>getType()voidread(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) voidsetFromItem(net.minecraft.world.item.ItemStack stack) voidwrite(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) Methods inherited from class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
destroy, get, get, getPos, getRequiredItems, getWorld, initialize, isSafeNBT, lazyTick, onBlockChanged, onNeighborChanged, setLazyTickRate, tick, unload, writeSafe
-
Field Details
-
TYPE
public static final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<ContaminationBehaviour> TYPE -
contaminationTag
protected net.minecraft.nbt.ListTag contaminationTag -
updateFromTag
protected boolean updateFromTag -
contamination
-
-
Constructor Details
-
ContaminationBehaviour
public ContaminationBehaviour(com.simibubi.create.foundation.blockEntity.SmartBlockEntity be)
-
-
Method Details
-
contaminationUpdated
public void contaminationUpdated() -
getContamination
-
setFromItem
public void setFromItem(net.minecraft.world.item.ItemStack stack) -
read
public void read(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) - Overrides:
readin classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
write
public void write(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket) - Overrides:
writein classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
getType
public com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?> getType()- Specified by:
getTypein classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-