mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-15 20:12:09 +01:00
Fixed PlayerTeleportEvent so getType() returns Type.PLAYER_TELEPORT
By: Byron Shelden <byron.shelden@gmail.com>
This commit is contained in:
parent
9418264170
commit
7237d8aa07
@ -4,9 +4,10 @@ package org.bukkit.event.player;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds information for player movement and teleportation events
|
* Holds information for player movement events
|
||||||
*/
|
*/
|
||||||
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
||||||
private boolean cancel = false;
|
private boolean cancel = false;
|
||||||
@ -19,6 +20,12 @@ public class PlayerMoveEvent extends PlayerEvent implements Cancellable {
|
|||||||
this.to = to;
|
this.to = to;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PlayerMoveEvent(final Event.Type type, final Player player, final Location from, final Location to) {
|
||||||
|
super(type, player);
|
||||||
|
this.from = from;
|
||||||
|
this.to = to;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the cancellation state of this event. A cancelled event will not
|
* Gets the cancellation state of this event. A cancelled event will not
|
||||||
* be executed in the server, but will still pass to other plugins
|
* be executed in the server, but will still pass to other plugins
|
||||||
|
@ -3,8 +3,11 @@ package org.bukkit.event.player;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Holds information for player teleport events
|
||||||
|
*/
|
||||||
public class PlayerTeleportEvent extends PlayerMoveEvent {
|
public class PlayerTeleportEvent extends PlayerMoveEvent {
|
||||||
public PlayerTeleportEvent(Player player, Location from, Location to) {
|
public PlayerTeleportEvent(Player player, Location from, Location to) {
|
||||||
super(player, from, to);
|
super(Type.PLAYER_TELEPORT, player, from, to);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user