Class PlayerTeleportHubEvent
- All Implemented Interfaces:
Cancellable
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.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 org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.event.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 an other 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
This method is used to get the custom implementation callback.- Returns:
- The callback to be executed when the movement is done
- See Also:
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-