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

public abstract class SimpleTickingBlock<T extends SefiBlock<T>> extends SefiBlock<T>
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

    Fields
    Modifier and Type
    Field
    Description
    protected final Map<Location,Boolean>
    A 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

    Constructors
    Modifier
    Constructor
    Description
    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 new 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, ItemStack recipeOutput)
    Creates a new SimpleTickingBlock.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    onAdditionalTick(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 void
    onBreak(BlockBreakEvent blockBreakEvent, ItemStack itemStack, List<ItemStack> list)
    This method will fire when the block is broken.
    protected abstract void
    onFirstTick(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 void
    This method fires when the block is first placed
    protected void
    onTick(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.items.SefiSlimefunItem

    registerItem

    Methods 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, warn

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.github.thebusybiscuit.slimefun4.core.attributes.Placeable

    useVanillaBlockBreaking
  • Field Details

    • firstTickMap

      protected final Map<Location,Boolean> 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 new SimpleTickingBlock.
      Parameters:
      itemGroup - The ItemGroup this block belongs to.
      item - The SlimefunItemStack that is used to create this block.
      recipeType - The RecipeType of 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 new SimpleTickingBlock.
      Parameters:
      itemGroup - The ItemGroup this block belongs to.
      item - The SlimefunItemStack that is used to create this block.
      recipeType - The RecipeType of 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 - The Block being ticked
      slimefunItem - The SlimefunItem that is stored in the block
      config - The Config from 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 - The Block being ticked
      slimefunItem - The SlimefunItem that is stored in the block
      config - The Config from 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.
      Overrides:
      onTick in class SefiBlock<T extends SefiBlock<T>>
      Parameters:
      block - The Block that was ticked.
      slimefunItem - The SlimefunItem that is stored in the block.
      config - The Config from BlockStorage at the time the block ticked.
    • onPlace

      protected abstract void onPlace(@Nonnull BlockPlaceEvent event)
      This method fires when the block is first placed
      Parameters:
      event - The BlockPlaceEvent passed 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 - The BlockBreakEvent passed from Bukkit via Slimefun
      itemStack - The ItemStack held by the player
      list - The List of items about to be dropped