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

    Fields
    Modifier and Type
    Field
    Description
    protected final GenericContamination
     
    static final com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<ContaminationBehaviour>
     

    Fields inherited from class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour

    blockEntity
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContaminationBehaviour(com.simibubi.create.foundation.blockEntity.SmartBlockEntity be)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?>
     
    void
    read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
     
    void
    setFromItem(net.minecraft.world.item.ItemStack stack)
     
    void
    write(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ContaminationBehaviour

      public ContaminationBehaviour(com.simibubi.create.foundation.blockEntity.SmartBlockEntity be)
  • Method Details

    • getContamination

      public GenericContamination 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:
      read in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • write

      public void write(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Overrides:
      write in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
    • getType

      public com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?> getType()
      Specified by:
      getType in class com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour