Class ResultExtension
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.bukkit.Materialprotected org.bukkit.util.Vectorprotected org.bukkit.util.Vectorprotected String -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResultExtension(ResultExtension extension)protectedResultExtension(me.wolfyscript.utilities.util.NamespacedKey namespacedKey)protectedResultExtension(me.wolfyscript.utilities.util.NamespacedKey namespacedKey, org.bukkit.Material icon, String title, List<String> description) -
Method Summary
Modifier and TypeMethodDescriptionabstract ResultExtensionclone()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.Vectorme.wolfyscript.utilities.util.NamespacedKeyorg.bukkit.util.VectorvoidonCraft(@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 voidonLocation(org.bukkit.Location location, @Nullable org.bukkit.entity.Player player)Called each time when the result was crafted on any location.abstract voidonPlayer(@NotNull org.bukkit.entity.Player player, org.bukkit.Location location)Called only if a player is involved in the crafting of the result.abstract voidonWorkstation(org.bukkit.block.Block block, @Nullable org.bukkit.entity.Player player)Called only when crafted in a workstation.voidsetInnerRadius(org.bukkit.util.Vector innerRadius)voidsetOuterRadius(org.bukkit.util.Vector outerRadius)
-
Field Details
-
icon
protected org.bukkit.Material icon -
title
-
description
-
outerRadius
protected org.bukkit.util.Vector outerRadius -
innerRadius
protected org.bukkit.util.Vector innerRadius
-
-
Constructor Details
-
ResultExtension
-
ResultExtension
protected ResultExtension(me.wolfyscript.utilities.util.NamespacedKey namespacedKey) -
ResultExtension
-
-
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
-
getNamespacedKey
public me.wolfyscript.utilities.util.NamespacedKey getNamespacedKey()- Specified by:
getNamespacedKeyin interfaceme.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
-