Class CrafterSmartPortParser

java.lang.Object
com.xzavier0722.mc.plugin.slimefun4.autocrafter.CrafterSmartPortParser
All Implemented Interfaces:
CrafterInteractable

public class CrafterSmartPortParser extends Object implements CrafterInteractable
  • Constructor Details

    • CrafterSmartPortParser

      public CrafterSmartPortParser(BlockMenu inv)
  • Method Details

    • canOutput

      public boolean canOutput(org.bukkit.inventory.ItemStack item)
      Description copied from interface: CrafterInteractable
      Check if the item can be output to inventory.
      Specified by:
      canOutput in interface CrafterInteractable
      Parameters:
      item - : the item will check.
      Returns:
      true if there are enough space, else false.
    • matchRecipe

      public boolean matchRecipe(AbstractAutoCrafter crafter, Collection<Predicate<org.bukkit.inventory.ItemStack>> recipe, Map<Integer,Integer> itemQuantities)
      Description copied from interface: CrafterInteractable
      Check if the items in inventory match all recipe items. This usually use with #matchesAny() in AbstractAutoCrafter
      Specified by:
      matchRecipe in interface CrafterInteractable
      Parameters:
      crafter - : the crafter that invoked this method.
      recipe - : the collection of recipe ingredients' predicate to test the item.
      itemQuantities - : the item's slot and amount after consume.
      Returns:
      true if all matched, else false.
    • getItem

      public org.bukkit.inventory.ItemStack getItem(int slot)
      Specified by:
      getItem in interface CrafterInteractable
    • addItem

      public boolean addItem(org.bukkit.inventory.ItemStack item)
      Specified by:
      addItem in interface CrafterInteractable
    • setIngredientCount

      public void setIngredientCount(org.bukkit.block.Block b, int count)
      Description copied from interface: CrafterInteractable
      This is for updating the count of different ingredient in recipe. This will be invoked when the recipe is changed. Usually use for controlling the item insertion of cargo.
      Specified by:
      setIngredientCount in interface CrafterInteractable
      Parameters:
      b - : block to update.
      count - : amount of different item.