Add a new event for requesting/handling teleports
This commit is contained in:
parent
dc99713d30
commit
3c58a662ca
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
package dev.zontreck.libzontreck.events;
|
||||
|
||||
import dev.zontreck.libzontreck.vectors.WorldPosition;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
/**
|
||||
* This event should be cancelled if a Teleport Implementation is provided and handles the teleport
|
||||
* <br/>
|
||||
* The event not being cancelled should indicate that the sender should handle teleport themselves.
|
||||
*/
|
||||
@Cancelable
|
||||
public class TeleportEvent extends Event
|
||||
{
|
||||
WorldPosition position;
|
||||
ServerPlayer player;
|
||||
|
||||
public TeleportEvent(WorldPosition position, ServerPlayer player)
|
||||
{
|
||||
this.position=position;
|
||||
this.player=player;
|
||||
}
|
||||
}
|
Reference in a new issue