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

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

    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
    void
     
     
    com.simibubi.create.foundation.blockEntity.behaviour.BehaviourType<?>
     
    void
    read(net.minecraft.nbt.CompoundTag nbt, boolean clientPacket)
     
    void
    setFromItem(net.minecraft.world.item.ItemStack stack)
     
    void
    write(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      protected final GenericContamination contamination
  • Constructor Details

    • ContaminationBehaviour

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

    • contaminationUpdated

      public void contaminationUpdated()
    • getContamination

      public GenericContamination getContamination()
    • setFromItem

      public void setFromItem(net.minecraft.world.item.ItemStack stack)
    • read

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

      public void write(net.minecraft.nbt.CompoundTag nbt, 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