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
-
Method Summary
Modifier and TypeMethodDescriptionThis method is used to get the custom implementation callback.static HandlerList
boolean
In somce cases the player is only getting teleported to the hub position on the local server.void
setCustomImplementationCallback
(@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
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
true
when 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:
getHandlers
in classEvent
-
getHandlerList
-