java.lang.Object
com.simibubi.create.foundation.blockEntity.behaviour.BlockEntityBehaviour
com.simibubi.create.foundation.blockEntity.behaviour.filtering.FilteringBehaviour
All Implemented Interfaces:
ClipboardCloneable, ValueSettingsBehaviour
Direct Known Subclasses:
FactoryPanelBehaviour, SidedFilteringBehaviour, TableClothFilteringBehaviour

public class FilteringBehaviour extends BlockEntityBehaviour implements ValueSettingsBehaviour
  • Field Details

    • TYPE

      public static final BehaviourType<FilteringBehaviour> TYPE
    • customLabel

      public net.minecraft.network.chat.MutableComponent customLabel
    • filter

      protected FilterItemStack filter
    • count

      public int count
    • upTo

      public boolean upTo
  • Constructor Details

  • Method Details

    • isSafeNBT

      public boolean isSafeNBT()
      Overrides:
      isSafeNBT in class BlockEntityBehaviour
    • write

      public void write(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Overrides:
      write in class BlockEntityBehaviour
    • read

      public void read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
      Overrides:
      read in class BlockEntityBehaviour
    • withCallback

      public FilteringBehaviour withCallback(Consumer<net.minecraft.world.item.ItemStack> filterCallback)
    • withPredicate

      public FilteringBehaviour withPredicate(Predicate<net.minecraft.world.item.ItemStack> filterPredicate)
    • forRecipes

      public FilteringBehaviour forRecipes()
    • forFluids

      public FilteringBehaviour forFluids()
    • onlyActiveWhen

      public FilteringBehaviour onlyActiveWhen(Supplier<Boolean> condition)
    • showCountWhen

      public FilteringBehaviour showCountWhen(Supplier<Boolean> condition)
    • showCount

      public FilteringBehaviour showCount()
    • setFilter

      public boolean setFilter(net.minecraft.core.Direction face, net.minecraft.world.item.ItemStack stack)
    • setLabel

      public void setLabel(net.minecraft.network.chat.MutableComponent label)
    • setFilter

      public boolean setFilter(net.minecraft.world.item.ItemStack stack)
    • setValueSettings

      public void setValueSettings(net.minecraft.world.entity.player.Player player, ValueSettingsBehaviour.ValueSettings settings, boolean ctrlDown)
      Specified by:
      setValueSettings in interface ValueSettingsBehaviour
    • getValueSettings

      public ValueSettingsBehaviour.ValueSettings getValueSettings()
      Specified by:
      getValueSettings in interface ValueSettingsBehaviour
    • destroy

      public void destroy()
      Description copied from class: BlockEntityBehaviour
      Block destroyed or removed. Requires block to call ITE::onRemove
      Overrides:
      destroy in class BlockEntityBehaviour
    • getRequiredItems

      public ItemRequirement getRequiredItems()
      Overrides:
      getRequiredItems in class BlockEntityBehaviour
    • getMaxStackSize

      public int getMaxStackSize()
    • getMaxStackSize

      public int getMaxStackSize(net.minecraft.core.Direction face)
    • getMaxStackSize

      public int getMaxStackSize(net.minecraft.world.item.ItemStack filter)
    • getFilter

      public net.minecraft.world.item.ItemStack getFilter(net.minecraft.core.Direction side)
    • getFilter

      public net.minecraft.world.item.ItemStack getFilter()
    • isCountVisible

      public boolean isCountVisible()
    • test

      public boolean test(net.minecraft.world.item.ItemStack stack)
    • test

      public boolean test(net.neoforged.neoforge.fluids.FluidStack stack)
    • getType

      public BehaviourType<?> getType()
      Specified by:
      getType in class BlockEntityBehaviour
    • testHit

      public boolean testHit(net.minecraft.world.phys.Vec3 hit)
      Specified by:
      testHit in interface ValueSettingsBehaviour
    • getAmount

      public int getAmount()
    • anyAmount

      public boolean anyAmount()
    • acceptsValueSettings

      public boolean acceptsValueSettings()
      Specified by:
      acceptsValueSettings in interface ValueSettingsBehaviour
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface ValueSettingsBehaviour
    • getSlotPositioning

      public ValueBoxTransform getSlotPositioning()
      Specified by:
      getSlotPositioning in interface ValueSettingsBehaviour
    • createBoard

      public ValueSettingsBoard createBoard(net.minecraft.world.entity.player.Player player, net.minecraft.world.phys.BlockHitResult hitResult)
      Specified by:
      createBoard in interface ValueSettingsBehaviour
    • formatValue

      public net.minecraft.network.chat.MutableComponent formatValue(ValueSettingsBehaviour.ValueSettings value)
    • onShortInteract

      public void onShortInteract(net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.core.Direction side, net.minecraft.world.phys.BlockHitResult hitResult)
      Specified by:
      onShortInteract in interface ValueSettingsBehaviour
    • canShortInteract

      public boolean canShortInteract(net.minecraft.world.item.ItemStack toApply)
    • getLabel

      public net.minecraft.network.chat.MutableComponent getLabel()
    • getTip

      public net.minecraft.network.chat.MutableComponent getTip()
    • getAmountTip

      public net.minecraft.network.chat.MutableComponent getAmountTip()
    • getCountLabelForValueBox

      public net.minecraft.network.chat.MutableComponent getCountLabelForValueBox()
    • getClipboardKey

      public String getClipboardKey()
      Specified by:
      getClipboardKey in interface ClipboardCloneable
      Specified by:
      getClipboardKey in interface ValueSettingsBehaviour
    • writeToClipboard

      public boolean writeToClipboard(@NotNull net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag tag, net.minecraft.core.Direction side)
      Specified by:
      writeToClipboard in interface ClipboardCloneable
      Specified by:
      writeToClipboard in interface ValueSettingsBehaviour
    • readFromClipboard

      public boolean readFromClipboard(@NotNull net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag tag, net.minecraft.world.entity.player.Player player, net.minecraft.core.Direction side, boolean simulate)
      Specified by:
      readFromClipboard in interface ClipboardCloneable
      Specified by:
      readFromClipboard in interface ValueSettingsBehaviour
    • isRecipeFilter

      public boolean isRecipeFilter()
    • netId

      public int netId()
      Specified by:
      netId in interface ValueSettingsBehaviour
    • getRenderDistance

      public float getRenderDistance()