Class PlayerTeleportHubEvent
- All Implemented Interfaces:
Cancellable
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method is used to get the custom implementation callback.static HandlerListbooleanIn somce cases the player is only getting teleported to the hub position on the local server.voidsetCustomImplementationCallback(@Nullable Consumer<Runnable> callback) This method is used to define a custom implementation for the movement.Methods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
getEventName, isAsynchronousMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerTeleportHubEvent
-
-
Method Details
-
isDecliningServerMovement
public boolean isDecliningServerMovement()In somce cases the player is only getting teleported to the hub position on the local server.This method defines whether the player should never be teleported to another server or get kicked. Reason being, that the player might get teleported when he e.g. joins the server.
- Returns:
truewhen the plugin forbids server movements
-
setCustomImplementationCallback
This method is used to define a custom implementation for the movement.Used e.g. by ProxySync. MBedwars internally puts the player into a state where he isn't able to i.a. receive damage or interact while he is being moved. Movement is delayed due to e.g. async teleportations or async bungee communication.
There is an internal timeout to avoid a bug in your implementation causing the callback to never be called, which would otherwise result in a memory leak.
MBedwars will pass you a runnable, in case it accepts your requests of a custom implementation (which it commonly does). Run the given runnable when the movement is done.
- Parameters:
callback- The callback to be executed when the movement is done
-
getCustomImplementationCallback
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-