((GlowEntity) boostedEntity).setRawLocation(location, false); } else { boostedEntity.teleport(location);
@Override public void setLocation(Location location) { LivingEntity entity = getLivingEntity(); if (entity != null && location != null) { entity.teleport(location); return; } this.location = location; }
@Override public void execute(Arena arena, MABoss boss) { Player p = AbilityUtils.getRandomPlayer(arena); boss.getEntity().teleport(p); } }
@Override public void execute(Arena arena, MABoss boss) { // Grab the players and add the boss List<LivingEntity> entities = new ArrayList<LivingEntity>(arena.getPlayersInArena()); entities.add(boss.getEntity()); // Grab the locations List<Location> locations = new LinkedList<>(); for (LivingEntity e : entities) { locations.add(e.getLocation()); } // Shuffle the entities list. Collections.shuffle(entities); /* The entities are shuffled, but the locations are not, so if * we remove the first element of each list, chances are they * will not match, i.e. shuffle achieved! */ while (!entities.isEmpty() && !locations.isEmpty()) { entities.remove(0).teleport(locations.remove(0)); } } }
@Override public void execute(Arena arena, MABoss boss) { LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM); if (target == null) return; target.teleport(boss.getEntity()); } }
@Override public void execute(Arena arena, MABoss boss) { LivingEntity target = AbilityUtils.getTarget(arena, boss.getEntity(), RANDOM); if (target == null) return; Location loc = target.getLocation(); loc.setYaw(loc.getYaw() + 45 + AbilityUtils.random.nextInt(270)); target.teleport(loc); } }
protected boolean teleportTarget(Location location) { if (targetEntity == null || location == null) return false; registerMoved(targetEntity); location.setY(location.getY() + 1); targetEntity.teleport(location); this.getCurrentTarget().setEntity(targetEntity); registerForUndo(); return true; }
getLivingEntity().teleport(sentinel.getGuardZone()); return null;
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onDalekSpawn(CreatureSpawnEvent event) { if (!event.getSpawnReason().equals(SpawnReason.SPAWNER)) { return; } if (!event.getLocation().getWorld().getName().equals("Skaro")) { return; } if (!event.getEntity().getType().equals(EntityType.SKELETON)) { return; } LivingEntity le = event.getEntity(); // it's a Dalek - disguise it! twaAPI.setDalekEquipment(le); if (plugin.getPlanetsConfig().getBoolean("planets.Skaro.flying_daleks") && r.nextInt(100) < 10) { // make the Dalek fly EntityEquipment ee = le.getEquipment(); ee.setChestplate(new ItemStack(Material.ELYTRA, 1)); // teleport them straight up le.teleport(le.getLocation().add(0.0d, 20.0d, 0.0d)); plugin.getTardisHelper().setFallFlyingTag(le); } } }
getLivingEntity().teleport(sentinel.getGuardZone()); return null;
protected void tryPhase(final LivingEntity entity, final Location targetLocation) { Chunk chunk = targetLocation.getBlock().getChunk(); if (!chunk.isLoaded()) { chunk.load(true); if (retryCount < MAX_RETRY_COUNT) { Plugin plugin = controller.getPlugin(); final PhaseSpell me = this; Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { @Override public void run() { me.tryPhase(entity, targetLocation); } }, RETRY_INTERVAL); return; } } Location playerLocation = entity.getLocation(); targetLocation.setYaw(playerLocation.getYaw()); targetLocation.setPitch(playerLocation.getPitch()); Location destination = tryFindPlaceToStand(targetLocation); // TODO : Failure notification? Sounds at least? The async nature is difficult. if (destination != null) { targetWorldName = destination.getWorld().getName(); entity.teleport(destination); } }
ageable.setBaby(); entity.teleport(targetLoc); newFamiliars.add(entity); spawnCount++;