Class VanillaAutoCrafter
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractAutoCrafter
io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.VanillaAutoCrafter
- All Implemented Interfaces:
EnergyNetComponent,ItemAttribute,Placeable,NotDiagonallyRotatable
The
VanillaAutoCrafter is an implementation of the AbstractAutoCrafter.
It can craft items that are crafted using a normal crafting table.
Only ShapedRecipe and ShapelessRecipe are therefore supported.- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
Fields inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractAutoCrafter
background, recipeEnabledKey, recipeStorageKeyFields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsConstructorDescriptionVanillaAutoCrafter(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe) -
Method Summary
Modifier and TypeMethodDescriptiongetSelectedRecipe(org.bukkit.block.Block b) This method returns the currently selectedAbstractRecipefor the givenBlock.protected booleanThis method checks whether the givenPredicatematches the providedItemStack.protected voidupdateRecipe(org.bukkit.block.Block b, org.bukkit.entity.Player p) This method is called when aPlayerright clicks theAbstractAutoCrafterwhile holding the shift button.Methods inherited from class io.github.thebusybiscuit.slimefun4.implementation.items.autocrafters.AbstractAutoCrafter
craft, getCapacity, getEnergyComponentType, getEnergyConsumption, isValidInventory, matchesAny, onRightClick, postRegister, register, setCapacity, setEnergyConsumption, setSelectedRecipe, showRecipe, tickMethods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, addWikiPage, callItemHandler, canUse, disable, enable, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getOptionalById, getOptionalByItem, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, loadDataByDefault, preRegister, sendDeprecationWarning, setHidden, setItemGroup, setRecipe, setRecipeOutput, setRecipeType, setResearch, setUseableInWorkbench, toString, warnMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetComponent
addCharge, addCharge, getCapacityLong, getCharge, getCharge, getCharge, getCharge, getChargeLong, getChargeLong, getChargeLong, isChargeable, removeCharge, removeCharge, setCharge, setChargeMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getIdMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.rotations.NotDiagonallyRotatable
getRotationMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreaking
-
Constructor Details
-
VanillaAutoCrafter
@ParametersAreNonnullByDefault public VanillaAutoCrafter(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe)
-
-
Method Details
-
getSelectedRecipe
Description copied from class:AbstractAutoCrafterThis method returns the currently selectedAbstractRecipefor the givenBlock.- Specified by:
getSelectedRecipein classAbstractAutoCrafter- Parameters:
b- TheBlock- Returns:
- The currently selected
AbstractRecipeor null
-
matches
protected boolean matches(@Nonnull org.bukkit.inventory.ItemStack item, @Nonnull Predicate<org.bukkit.inventory.ItemStack> predicate) Description copied from class:AbstractAutoCrafterThis method checks whether the givenPredicatematches the providedItemStack.- Overrides:
matchesin classAbstractAutoCrafter- Parameters:
item- TheItemStackto checkpredicate- ThePredicate- Returns:
- Whether the
Predicatematches theItemStack
-
updateRecipe
protected void updateRecipe(@Nonnull org.bukkit.block.Block b, @Nonnull org.bukkit.entity.Player p) Description copied from class:AbstractAutoCrafterThis method is called when aPlayerright clicks theAbstractAutoCrafterwhile holding the shift button. Use it to choose theAbstractRecipe.- Specified by:
updateRecipein classAbstractAutoCrafter- Parameters:
b- TheBlockwhich was clickedp- ThePlayerwho clicked
-