Class BlockTicker
java.lang.Object
me.mrCookieSlime.Slimefun.Objects.handlers.BlockTicker
- All Implemented Interfaces:
ItemHandler
- Direct Known Subclasses:
RainbowTickHandler
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends ItemHandler>This method returns the identifier for thisItemHandler.abstract booleanThis method must be overridden to define whether a Block needs to be run on the main server thread (World Manipulation requires that)voidThis method resets the 'unique' flag foruniqueTick()abstract voidtick(Block b, SlimefunItem item, Config data) This method is called every tick for every blockvoidThis method is called every tick but not per-block and only once.voidupdate()validate(SlimefunItem item) This method is used to check whether a givenSlimefunItemis compatible with thisItemHandler, it will return anIncompatibleItemHandlerExceptionif 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:ItemHandlerThis method is used to check whether a givenSlimefunItemis compatible with thisItemHandler, it will return anIncompatibleItemHandlerExceptionif the items are not compatible.- Specified by:
validatein interfaceItemHandler- Parameters:
item- TheSlimefunItemto validate- Returns:
- An
Optionaldescribing the result, it will contain anIncompatibleItemHandlerExceptionshould 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- TheBlockthat was tickeditem- The correspondingSlimefunItemdata- 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:ItemHandlerThis method returns the identifier for thisItemHandler. We use aClassidentifier to group Item Handlers together.- Specified by:
getIdentifierin interfaceItemHandler- Returns:
- The
Classidentifier for thisItemHandler
-
startNewTick
public void startNewTick()This method resets the 'unique' flag foruniqueTick()
-