Class InfusedMagnetTask
java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.tasks.player.InfusedMagnetTask
- All Implemented Interfaces:
Runnable
This
AbstractPlayerTask is run when a Player carries an InfusedMagnet.
It manages the automatic pickup of nearby items.- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInfusedMagnetTask(Player p, double radius) This creates a newInfusedMagnetTaskfor the givenPlayerwith the given pickup radius. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcancel()This method cancels thisAbstractPlayerTask.protected voidprotected booleanisValid()This method checks if thisAbstractPlayerTaskshould be continued or cancelled.final voidrun()voidschedule(long delay) voidscheduleRepeating(long delay, long interval)
-
Field Details
-
p
-
-
Constructor Details
-
InfusedMagnetTask
This creates a newInfusedMagnetTaskfor the givenPlayerwith the given pickup radius.- Parameters:
p- ThePlayerwho items should be teleported toradius- The radius in which items should be picked up
-
-
Method Details
-
executeTask
protected void executeTask() -
isValid
protected boolean isValid()This method checks if thisAbstractPlayerTaskshould be continued or cancelled. It will also cancel thisAbstractPlayerTaskif it became invalid.- Returns:
- Whether this
AbstractPlayerTaskis still valid
-
schedule
public void schedule(long delay) -
scheduleRepeating
public void scheduleRepeating(long delay, long interval) -
run
public final void run() -
cancel
public final void cancel()This method cancels thisAbstractPlayerTask.
-