Class ProgWidgetCrafting

java.lang.Object
me.desht.pneumaticcraft.common.progwidgets.ProgWidget
me.desht.pneumaticcraft.common.progwidgets.ProgWidgetCrafting
All Implemented Interfaces:
IProgWidgetBase, ICountWidget, ICraftingWidget, IProgWidget, ISidedWidget

public class ProgWidgetCrafting extends ProgWidget implements ICraftingWidget, ICountWidget, ISidedWidget
  • Constructor Details

    • ProgWidgetCrafting

      public ProgWidgetCrafting()
  • Method Details

    • 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
    • getTooltip

      public void getTooltip(List<net.minecraft.network.chat.Component> curTooltip)
      Specified by:
      getTooltip in interface IProgWidget
      Overrides:
      getTooltip in class ProgWidget
    • 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
    • getColor

      public net.minecraft.world.item.DyeColor getColor()
      Specified by:
      getColor in interface IProgWidget
    • getDifficulty

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

      public net.minecraft.resources.ResourceLocation getTexture()
      Specified by:
      getTexture in interface IProgWidget
    • hasBlacklist

      protected boolean hasBlacklist()
      Overrides:
      hasBlacklist in class ProgWidget
    • getCraftingGrid

      public net.minecraft.world.inventory.CraftingContainer getCraftingGrid()
      Specified by:
      getCraftingGrid in interface ICraftingWidget
    • getRecipeResult

      public net.minecraft.world.item.ItemStack getRecipeResult(net.minecraft.world.level.Level world)
    • getRecipe

      public Optional<net.minecraft.world.item.crafting.CraftingRecipe> getRecipe(net.minecraft.world.level.Level world, net.minecraft.world.inventory.CraftingContainer grid)
      Specified by:
      getRecipe in interface ICraftingWidget
    • getRecipe

      public static net.minecraft.world.item.crafting.Recipe<net.minecraft.world.inventory.CraftingContainer> getRecipe(net.minecraft.world.level.Level world, ICraftingWidget widget)
    • getWidgetAI

      public net.minecraft.world.entity.ai.goal.Goal getWidgetAI(IDroneBase drone, IProgWidget widget)
      Description copied from interface: IProgWidget
      Get the AI for this progwidget
      Specified by:
      getWidgetAI in interface IProgWidget
      Overrides:
      getWidgetAI in class ProgWidget
      Parameters:
      drone - the drone
      widget - will be 'this' most of the time, but not when controlled externally (e.g. ComputerCraft)
      Returns:
      widget AI
    • setSides

      public void setSides(boolean[] sides)
      Specified by:
      setSides in interface ISidedWidget
    • getSides

      public boolean[] getSides()
      Specified by:
      getSides in interface ISidedWidget
    • useCount

      public boolean useCount()
      Specified by:
      useCount in interface ICountWidget
    • setUseCount

      public void setUseCount(boolean useCount)
      Specified by:
      setUseCount in interface ICountWidget
    • getCount

      public int getCount()
      Specified by:
      getCount in interface ICountWidget
    • setCount

      public void setCount(int count)
      Specified by:
      setCount in interface ICountWidget
    • writeToNBT

      public void writeToNBT(net.minecraft.nbt.CompoundTag tag)
      Description copied from interface: IProgWidget
      At least do tag.putString("name", getTypeID().toString());

      Note that the base implementation ProgWidget does this.

      Specified by:
      writeToNBT in interface IProgWidget
      Overrides:
      writeToNBT in class ProgWidget
      Parameters:
      tag - NBT tag to write to
    • readFromNBT

      public void readFromNBT(net.minecraft.nbt.CompoundTag tag)
      Specified by:
      readFromNBT in interface IProgWidget
      Overrides:
      readFromNBT in class ProgWidget
    • writeToPacket

      public void writeToPacket(net.minecraft.network.FriendlyByteBuf buf)
      Specified by:
      writeToPacket in interface IProgWidget
      Overrides:
      writeToPacket in class ProgWidget
    • readFromPacket

      public void readFromPacket(net.minecraft.network.FriendlyByteBuf buf)
      Specified by:
      readFromPacket in interface IProgWidget
      Overrides:
      readFromPacket in class ProgWidget