Remove usages of Entity#teleport

This commit is contained in:
fullwall 2013-08-03 11:01:09 +08:00
parent 93495a9ab9
commit 5ed44829a8
2 changed files with 6 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);
}
}
}