Class BlockTicker
java.lang.Object
me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker
- All Implemented Interfaces:
ItemHandler
- Direct Known Subclasses:
RainbowTickHandler
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ItemHandler>
This method returns the identifier for thisItemHandler
.abstract boolean
This method must be overridden to define whether a Block needs to be run on the main server thread (World Manipulation requires that)void
This method resets the 'unique' flag foruniqueTick()
abstract void
tick
(Block b, SlimefunItem item, Config data) This method is called every tick for every blockvoid
This method is called every tick but not per-block and only once.void
update()
validate
(SlimefunItem item) This method is used to check whether a givenSlimefunItem
is compatible with thisItemHandler
, it will return anIncompatibleItemHandlerException
if the items are not compatible.
-
Field Details
-
unique
protected boolean unique
-
-
Constructor Details
-
BlockTicker
public BlockTicker()
-
-
Method Details
-
update
public void update() -
validate
Description copied from interface:ItemHandler
This method is used to check whether a givenSlimefunItem
is compatible with thisItemHandler
, it will return anIncompatibleItemHandlerException
if the items are not compatible.- Specified by:
validate
in interfaceItemHandler
- Parameters:
item
- TheSlimefunItem
to validate- Returns:
- An
Optional
describing the result, it will contain anIncompatibleItemHandlerException
should there be an issue
-
isSynchronized
public abstract boolean isSynchronized()This method must be overridden to define whether a Block needs to be run on the main server thread (World Manipulation requires that)- Returns:
- Whether this task should run on the main server thread
-
tick
This method is called every tick for every block- Parameters:
b
- TheBlock
that was tickeditem
- The correspondingSlimefunItem
data
- The data stored in thisBlock
-
uniqueTick
public void uniqueTick()This method is called every tick but not per-block and only once. -
getIdentifier
Description copied from interface:ItemHandler
This method returns the identifier for thisItemHandler
. We use aClass
identifier to group Item Handlers together.- Specified by:
getIdentifier
in interfaceItemHandler
- Returns:
- The
Class
identifier for thisItemHandler
-
startNewTick
public void startNewTick()This method resets the 'unique' flag foruniqueTick()
-