Class SimpleTickingBlock<T extends SefiBlock<T>>
java.lang.Object
io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
dev.sefiraat.sefilib.slimefun.items.SefiSlimefunItem<T>
dev.sefiraat.sefilib.slimefun.blocks.SefiBlock<T>
dev.sefiraat.sefilib.slimefun.blocks.SimpleTickingBlock<T>
- All Implemented Interfaces:
io.github.thebusybiscuit.slimefun4.core.attributes.Placeable
A simple ticking block that does not have a GUI.
Override onFirstTick for Caching or other actions normally
undertaken in
BlockMenuPreset's onNewInstance-
Field Summary
FieldsModifier and TypeFieldDescriptionA map of all the locations of all the blocks that have had their first tick performed.Fields inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addon, disenchantable, enchantable, hidden, recipeOutput, useableInWorkbench -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleTickingBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newSimpleTickingBlock.protectedSimpleTickingBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe, ItemStack recipeOutput) Creates a newSimpleTickingBlock. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidonAdditionalTick(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method will fire everytime the block ticks (including the first tick, just after onFirstTick()).protected abstract voidonBreak(BlockBreakEvent blockBreakEvent, ItemStack itemStack, List<ItemStack> list) This method will fire when the block is broken.protected abstract voidonFirstTick(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method will fire the first time this block ticks, either when placed or after a server restart.protected abstract voidonPlace(BlockPlaceEvent event) This method fires when the block is first placedprotected voidonTick(Block block, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method sets up the first tick for this block.Methods inherited from class dev.sefiraat.sefilib.slimefun.blocks.SefiBlock
getThis, isAllowAndroids, isAllowBlockPlacers, isAllowExplosions, isSync, onBlockPlaced, onPlayerBreaksBlock, onPlayerRightClickBlock, onUniqueTick, preRegister, setAllowAndroids, setAllowBlockPlacers, setAllowExplosions, setSyncMethods inherited from class dev.sefiraat.sefilib.slimefun.items.SefiSlimefunItem
registerItemMethods inherited from class io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem
addItemHandler, addItemSetting, addOfficialWikipage, callItemHandler, canUse, equals, error, getAddon, getBlockTicker, getById, getByItem, getDrops, getDrops, getHandlers, getId, getItem, getItemGroup, getItemName, getItemSetting, getItemSettings, getRecipe, getRecipeOutput, getRecipeType, getResearch, getState, getWikipage, hashCode, hasResearch, info, isDisabled, isDisabledIn, isDisenchantable, isEnchantable, isHidden, isItem, isItemStackImmutable, isTicking, isUseableInWorkbench, load, postRegister, 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.Placeable
useVanillaBlockBreaking
-
Field Details
-
firstTickMap
A map of all the locations of all the blocks that have had their first tick performed.
-
-
Constructor Details
-
SimpleTickingBlock
protected SimpleTickingBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe) Creates a newSimpleTickingBlock.- Parameters:
itemGroup- TheItemGroupthis block belongs to.item- TheSlimefunItemStackthat is used to create this block.recipeType- TheRecipeTypeof this block.recipe- The recipe of this block.
-
SimpleTickingBlock
protected SimpleTickingBlock(io.github.thebusybiscuit.slimefun4.api.items.ItemGroup itemGroup, io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack item, io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType recipeType, ItemStack[] recipe, @Nullable ItemStack recipeOutput) Creates a newSimpleTickingBlock.- Parameters:
itemGroup- TheItemGroupthis block belongs to.item- TheSlimefunItemStackthat is used to create this block.recipeType- TheRecipeTypeof this block.recipe- The recipe of this block.recipeOutput- The recipe output of this block.
-
-
Method Details
-
onFirstTick
protected abstract void onFirstTick(@Nonnull Block block, @Nonnull io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, @Nonnull me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method will fire the first time this block ticks, either when placed or after a server restart. Override this method if you need to grab from BlockStorage and cache the information like you normally would in newInstance if using a BlockMenuPreset- Parameters:
block- TheBlockbeing tickedslimefunItem- TheSlimefunItemthat is stored in the blockconfig- TheConfigfrom BlockStorage at the time the block ticked
-
onAdditionalTick
protected abstract void onAdditionalTick(@Nonnull Block block, @Nonnull io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, @Nonnull me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method will fire everytime the block ticks (including the first tick, just after onFirstTick()).- Parameters:
block- TheBlockbeing tickedslimefunItem- TheSlimefunItemthat is stored in the blockconfig- TheConfigfrom BlockStorage at the time the block ticked
-
onTick
protected void onTick(@Nonnull Block block, @Nonnull io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem slimefunItem, @Nonnull me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config config) This method sets up the first tick for this block. Should not be overridden. -
onPlace
This method fires when the block is first placed- Parameters:
event- TheBlockPlaceEventpassed from Bukkit via Slimefun
-
onBreak
protected abstract void onBreak(@Nonnull BlockBreakEvent blockBreakEvent, @Nonnull ItemStack itemStack, @Nonnull List<ItemStack> list) This method will fire when the block is broken. Override this method if you need to wrap anything up or drop items etc.- Parameters:
blockBreakEvent- TheBlockBreakEventpassed from Bukkit via SlimefunitemStack- The ItemStack held by the playerlist- TheListof items about to be dropped
-