Class AbstractEnergyProvider
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
io.github.thebusybiscuit.slimefun4.implementation.items.electric.AbstractEnergyProvider
- All Implemented Interfaces:
EnergyNetComponent,EnergyNetProvider,ItemAttribute,Placeable,RecipeDisplayItem,InventoryBlock
- Direct Known Subclasses:
AGenerator,Reactor
public abstract class AbstractEnergyProvider
extends SlimefunItem
implements InventoryBlock, RecipeDisplayItem, EnergyNetProvider
This is an abstract super class for machines that produce energy.
- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Set<MachineFuel> The set of fuel types for this energy provider.Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractEnergyProvider(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe) Constructs a new AbstractEnergyProvider. -
Method Summary
Modifier and TypeMethodDescriptionList<org.bukkit.inventory.ItemStack> This is the list of items to display alongside thisSlimefunItem.final EnergyNetComponentTypeThis method returns the Type ofEnergyNetComponentTypethisSlimefunItemrepresents.abstract intThis method returns the amount of energy that is produced per tick.Gets the set of fuel types for this energy provider.This method returns the title that is used for theInventoryof anAbstractEnergyProviderthat has been opened by a Player.Gets the local path for the label in the guide.abstract org.bukkit.inventory.ItemStackThis method returns theItemStackthat thisAGeneratorwill use as a progress bar.protected abstract voidThis method is used to register the default fuel types.voidregisterFuel(MachineFuel fuel) Registers a fuel type for this energy provider.Methods 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, postRegister, preRegister, register, 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, getCapacity, getCapacityLong, getCharge, getCharge, getCharge, getCharge, getChargeLong, getChargeLong, getChargeLong, isChargeable, removeCharge, removeCharge, setCharge, setChargeMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.EnergyNetProvider
getGeneratedOutput, getGeneratedOutput, getGeneratedOutput, getGeneratedOutputLong, getGeneratedOutputLong, willExplode, willExplode, willExplodeMethods inherited from interface me.mrCookieSlime.Slimefun.Objects.SlimefunItem.interfaces.InventoryBlock
createPreset, createPreset, getInputSlots, getOutputSlotsMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.ItemAttribute
getIdMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
useVanillaBlockBreakingMethods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.RecipeDisplayItem
getRecipeSectionLabel
-
Field Details
-
fuelTypes
The set of fuel types for this energy provider.
-
-
Constructor Details
-
AbstractEnergyProvider
@ParametersAreNonnullByDefault protected AbstractEnergyProvider(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, org.bukkit.inventory.ItemStack[] recipe) Constructs a new AbstractEnergyProvider.- Parameters:
itemGroup- The item group this item belongs toitem- The item stack for this energy providerrecipeType- The recipe type used to craft this itemrecipe- The recipe to craft this item
-
-
Method Details
-
getInventoryTitle
This method returns the title that is used for theInventoryof anAbstractEnergyProviderthat has been opened by a Player. Override this method to set the title.- Returns:
- The title of the
Inventoryof thisAbstractEnergyProvider
-
getProgressBar
@Nonnull public abstract org.bukkit.inventory.ItemStack getProgressBar()This method returns theItemStackthat thisAGeneratorwill use as a progress bar. Override this method to set the progress bar.- Returns:
- The
ItemStackto use as the progress bar
-
getEnergyProduction
public abstract int getEnergyProduction()This method returns the amount of energy that is produced per tick.- Returns:
- The rate of energy generation
-
registerDefaultFuelTypes
protected abstract void registerDefaultFuelTypes()This method is used to register the default fuel types. -
getEnergyComponentType
Description copied from interface:EnergyNetComponentThis method returns the Type ofEnergyNetComponentTypethisSlimefunItemrepresents. It describes how this Block will interact with anEnergyNet.- Specified by:
getEnergyComponentTypein interfaceEnergyNetComponent- Specified by:
getEnergyComponentTypein interfaceEnergyNetProvider- Returns:
- The
EnergyNetComponentTypethisSlimefunItemrepresents.
-
registerFuel
Registers a fuel type for this energy provider.- Parameters:
fuel- TheMachineFuelto register
-
getFuelTypes
Gets the set of fuel types for this energy provider.- Returns:
- The set of
MachineFueltypes
-
getLabelLocalPath
Description copied from interface:RecipeDisplayItemGets the local path for the label in the guide.- Specified by:
getLabelLocalPathin interfaceRecipeDisplayItem- Returns:
- The local path for the label
-
getDisplayRecipes
Description copied from interface:RecipeDisplayItemThis is the list of items to display alongside thisSlimefunItem. Note that these items will be filled in from top to bottom first. So if you want it to express a recipe, add your inputItemStackand then your outputItemStack.- Specified by:
getDisplayRecipesin interfaceRecipeDisplayItem- Returns:
- The recipes to display in the
SlimefunGuide
-