java.lang.Object
me.wolfyscript.customcrafting.utils.recipe_item.extension.ResultExtension
All Implemented Interfaces:
me.wolfyscript.utilities.util.Keyed
Direct Known Subclasses:
CommandResultExtension, MythicMobResultExtension, SoundResultExtension

public abstract class ResultExtension extends Object implements me.wolfyscript.utilities.util.Keyed
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<String>
     
    protected org.bukkit.Material
     
    protected org.bukkit.util.Vector
     
    protected org.bukkit.util.Vector
     
    protected String
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    ResultExtension​(me.wolfyscript.utilities.util.NamespacedKey namespacedKey)
     
    protected
    ResultExtension​(me.wolfyscript.utilities.util.NamespacedKey namespacedKey, org.bukkit.Material icon, String title, List<String> description)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    protected <E extends org.bukkit.entity.Entity>
    List<E>
    getEntitiesInRange​(Class<E> entityType, org.bukkit.Location location, org.bukkit.util.Vector outerRadius, org.bukkit.util.Vector innerRadius)
     
    org.bukkit.util.Vector
     
    me.wolfyscript.utilities.util.NamespacedKey
     
    org.bukkit.util.Vector
     
    void
    onCraft​(@NotNull org.bukkit.Location location, boolean isWorkstation, @Nullable org.bukkit.entity.Player player)
    Called whenever the result is crafted in workstations or inventories without block.
    abstract void
    onLocation​(org.bukkit.Location location, @Nullable org.bukkit.entity.Player player)
    Called each time when the result was crafted on any location.
    abstract void
    onPlayer​(@NotNull org.bukkit.entity.Player player, org.bukkit.Location location)
    Called only if a player is involved in the crafting of the result.
    abstract void
    onWorkstation​(org.bukkit.block.Block block, @Nullable org.bukkit.entity.Player player)
    Called only when crafted in a workstation.
    void
    setInnerRadius​(org.bukkit.util.Vector innerRadius)
     
    void
    setOuterRadius​(org.bukkit.util.Vector outerRadius)
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • icon

      protected org.bukkit.Material icon
    • title

      protected String title
    • description

      protected List<String> description
    • outerRadius

      protected org.bukkit.util.Vector outerRadius
    • innerRadius

      protected org.bukkit.util.Vector innerRadius
  • Constructor Details

    • ResultExtension

      protected ResultExtension(ResultExtension extension)
    • ResultExtension

      protected ResultExtension(me.wolfyscript.utilities.util.NamespacedKey namespacedKey)
    • ResultExtension

      protected ResultExtension(me.wolfyscript.utilities.util.NamespacedKey namespacedKey, org.bukkit.Material icon, String title, List<String> description)
  • Method Details

    • onWorkstation

      public abstract void onWorkstation(org.bukkit.block.Block block, @Nullable @Nullable org.bukkit.entity.Player player)
      Called only when crafted in a workstation. Not called if no block is involved!
      Parameters:
      block - The block of the workstation.
      player - The player that might be involved in the crafting. Might be Null if the action didn't involve a player.
    • onLocation

      public abstract void onLocation(org.bukkit.Location location, @Nullable @Nullable org.bukkit.entity.Player player)
      Called each time when the result was crafted on any location. The player might be null.
      Parameters:
      location - The location of the inventory, the result was crafted in.
      player - The player that crafted the item or null if it was crafted by a block.
    • onPlayer

      public abstract void onPlayer(@NotNull @NotNull org.bukkit.entity.Player player, org.bukkit.Location location)
      Called only if a player is involved in the crafting of the result.
      Parameters:
      player - The player that crafted the result.
      location - The location of the inventory, the result was crafted in.
    • onCraft

      public void onCraft(@NotNull @NotNull org.bukkit.Location location, boolean isWorkstation, @Nullable @Nullable org.bukkit.entity.Player player)
      Called whenever the result is crafted in workstations or inventories without block.

      Crafted for different workstations means: - Furnaces: the ingredient is smelted and the result is put into the result slot. - Other Recipes: the result is taken out of the inventory and the ingredients are consumed.

      Parameters:
      location - The location of the inventory, the result was crafted in. (might be the location of the workstation block)
      isWorkstation - If it was crafted in a workstation.
      player - The player that crafted the result.
    • clone

      public abstract ResultExtension clone()
      Overrides:
      clone in class Object
    • getNamespacedKey

      public me.wolfyscript.utilities.util.NamespacedKey getNamespacedKey()
      Specified by:
      getNamespacedKey in interface me.wolfyscript.utilities.util.Keyed
    • getInnerRadius

      public org.bukkit.util.Vector getInnerRadius()
    • setInnerRadius

      public void setInnerRadius(org.bukkit.util.Vector innerRadius)
    • getOuterRadius

      public org.bukkit.util.Vector getOuterRadius()
    • setOuterRadius

      public void setOuterRadius(org.bukkit.util.Vector outerRadius)
    • getEntitiesInRange

      protected <E extends org.bukkit.entity.Entity> List<E> getEntitiesInRange(Class<E> entityType, org.bukkit.Location location, org.bukkit.util.Vector outerRadius, org.bukkit.util.Vector innerRadius)