Class ContaminationBehaviour
java.lang.Object
com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
com.petrolpark.compat.create.core.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 GenericContaminationstatic final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<ContaminationBehaviour> Fields 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 TypeMethodDescriptioncom.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?> getType()voidread(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) voidsetFromItem(net.minecraft.world.item.ItemStack stack) voidwrite(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, 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 -
contamination
-
-
Constructor Details
-
ContaminationBehaviour
public ContaminationBehaviour(com.simibubi.create.foundation.blockEntity.SmartBlockEntity be)
-
-
Method Details
-
getContamination
-
setFromItem
public void setFromItem(net.minecraft.world.item.ItemStack stack) -
read
public void read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) - Overrides:
readin classcom.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
-
write
public void write(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, 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
-