mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
Remove usages of Entity#teleport
This commit is contained in:
parent
93495a9ab9
commit
5ed44829a8
@ -9,6 +9,7 @@ import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
public class CopierEditor extends Editor {
|
||||
private final String name;
|
||||
@ -44,7 +45,7 @@ public class CopierEditor extends Editor {
|
||||
if (copy.isSpawned() && player.isOnline()) {
|
||||
Location location = player.getLocation();
|
||||
location.getChunk().load();
|
||||
copy.getBukkitEntity().teleport(location);
|
||||
copy.teleport(location, TeleportCause.PLUGIN);
|
||||
copy.getTrait(CurrentLocation.class).setLocation(location);
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.persistence.Persist;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
|
||||
public class TeleportTrigger implements WaypointTrigger {
|
||||
@Persist(required = true)
|
||||
@ -24,7 +25,8 @@ public class TeleportTrigger implements WaypointTrigger {
|
||||
|
||||
@Override
|
||||
public void onWaypointReached(NPC npc, Location waypoint) {
|
||||
if (location != null)
|
||||
npc.getBukkitEntity().teleport(waypoint);
|
||||
if (location != null) {
|
||||
npc.teleport(waypoint, TeleportCause.PLUGIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user