Class ProgWidgetAreaItemBase

java.lang.Object
me.desht.pneumaticcraft.common.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetAreaItemBase
All Implemented Interfaces:
IProgWidgetBase, IAreaProvider, IEntityProvider, IItemFiltering, IProgWidget, IVariableWidget
Direct Known Subclasses:
ProgWidgetDigAndPlace, ProgWidgetEditSign, ProgWidgetEntityExport, ProgWidgetExternalProgram, ProgWidgetForEachCoordinate, ProgWidgetInventoryBase, ProgWidgetLogistics, ProgWidgetPickupItem

public abstract class ProgWidgetAreaItemBase extends ProgWidget implements IAreaProvider, IEntityProvider, IItemFiltering, IVariableWidget
Base class for widgets which use Area and Item Filter widgets
  • Field Details

  • Constructor Details

    • ProgWidgetAreaItemBase

      public ProgWidgetAreaItemBase(ProgWidgetType<?> type)
  • Method Details

    • hasStepInput

      public boolean hasStepInput()
      Description copied from interface: IProgWidget
      Can this widget connect to a widget above?
      Specified by:
      hasStepInput in interface IProgWidget
      Returns:
      true if it can, false otherwise
    • returnType

      public ProgWidgetType<?> returnType()
      Description copied from interface: IProgWidget
      For parameter widgets that are added onto the left or right of another widget, get the type of the widget being connected to.
      Specified by:
      returnType in interface IProgWidget
      Returns:
      the widget being connected to, or null if this widget isn't a parameter widget.
    • getParameters

      public List<ProgWidgetType<?>> getParameters()
      Description copied from interface: IProgWidget
      Get the types of the widgets which connect to this widget on the right, in order (top to bottom). Note that the length of the widget array returned by IProgWidget.getConnectedParameters() will be double the length of this list, since these widgets can be added on both the right (whitelist) and left (blacklist) sides.
      Specified by:
      getParameters in interface IProgWidget
      Returns:
      a list of widget types, or an empty list if no widgets can be added to the side of this widget
    • addErrors

      public void addErrors(List<net.minecraft.network.chat.Component> curInfo, List<IProgWidget> widgets)
      Specified by:
      addErrors in interface IProgWidget
      Overrides:
      addErrors in class ProgWidget
    • getChunkCache

      public net.minecraft.world.level.CollisionGetter getChunkCache(net.minecraft.world.level.Level world)
    • getAreaExtents

      public net.minecraft.world.phys.AABB getAreaExtents()
    • getCachedAreaList

      public List<net.minecraft.core.BlockPos> getCachedAreaList()
    • getCachedAreaSet

      public Set<net.minecraft.core.BlockPos> getCachedAreaSet()
    • invalidateAreaCache

      protected void invalidateAreaCache()
    • getArea

      public void getArea(Set<net.minecraft.core.BlockPos> area)
      Specified by:
      getArea in interface IAreaProvider
    • getArea

      public static void getArea(Set<net.minecraft.core.BlockPos> area, ProgWidgetArea whitelistWidget, ProgWidgetArea blacklistWidget)
    • isItemValidForFilters

      public boolean isItemValidForFilters(net.minecraft.world.item.ItemStack item)
      Specified by:
      isItemValidForFilters in interface IItemFiltering
    • isItemValidForFilters

      public boolean isItemValidForFilters(net.minecraft.world.item.ItemStack item, net.minecraft.world.level.block.state.BlockState blockState)
    • isItemFilterEmpty

      public boolean isItemFilterEmpty()
    • getEntitiesInArea

      public List<net.minecraft.world.entity.Entity> getEntitiesInArea(net.minecraft.world.level.Level world, Predicate<? super net.minecraft.world.entity.Entity> filter)
    • getValidEntities

      public List<net.minecraft.world.entity.Entity> getValidEntities(net.minecraft.world.level.Level world)
      Specified by:
      getValidEntities in interface IEntityProvider
    • isEntityValid

      public boolean isEntityValid(net.minecraft.world.entity.Entity entity)
      Specified by:
      isEntityValid in interface IEntityProvider
    • getEntitiesInArea

      public static List<net.minecraft.world.entity.Entity> getEntitiesInArea(ProgWidgetArea whitelistWidget, ProgWidgetArea blacklistWidget, net.minecraft.world.level.Level world, Predicate<? super net.minecraft.world.entity.Entity> whitelistPredicate, Predicate<? super net.minecraft.world.entity.Entity> blacklistPredicate)
    • getDifficulty

      public IProgWidget.WidgetDifficulty getDifficulty()
      Specified by:
      getDifficulty in interface IProgWidget
    • setAIManager

      public void setAIManager(DroneAIManager aiManager)
      Specified by:
      setAIManager in interface IVariableWidget
    • addVariables

      public void addVariables(Set<String> variables)
      Specified by:
      addVariables in interface IVariableWidget