@Override public boolean setLocation(Location location) { return player.setLocation(SpongeAdapter.adapt(location)); }
private void sendUpdateSelf() { receiver.getTabList().removeEntry(receiver.getUniqueId()); receiver.getTabList().addEntry(TabListEntry.builder() .displayName(receiver.getDisplayNameData().displayName().get()) .latency(receiver.getConnection().getLatency()) .list(receiver.getTabList()) .gameMode(receiver.getGameModeData().type().get()) .profile(receiver.getProfile()) .build()); Location<World> oldLocation = receiver.getLocation(); Vector3d rotation = receiver.getRotation(); World receiverWorld = receiver.getWorld(); Sponge.getServer().getWorlds() .stream() .filter(world -> !world.equals(receiverWorld)) .findFirst() .ifPresent(world -> { receiver.setLocation(world.getSpawnLocation()); receiver.setLocationAndRotation(oldLocation, rotation); }); } }
@Override protected final void arrow(final SnipeData v) { Player player = v.owner().getPlayer(); player.setLocation(this.lastBlock); }
private void removeChair(Chair<?> chair, boolean clearPassengers) { Player passenger = chair.chairEntity.getPassengers().stream().filter((entity -> entity instanceof Player)).map(e -> (Player) e).findFirst().orElse(null); if (passenger != null && clearPassengers) { passenger.setVehicle(null); chair.chairEntity.clearPassengers(); passenger.sendMessage(Text.of(TextColors.YELLOW, "You stand up!")); if (exitAtEntry.getValue()) { Sponge.getScheduler().createTaskBuilder().delayTicks(5L).execute(() -> passenger.setLocation(chair.playerExitLocation)).submit(CraftBookPlugin.inst()); } } chair.chairEntity.remove(); chairs.values().remove(chair); }
@Override protected final void powder(final SnipeData v) { Player player = v.owner().getPlayer(); strikeLightning(player.getLocation(), player); player.setLocation(this.lastBlock); strikeLightning(this.lastBlock, player); }
@Override public void teleport(Location location) { if ((Math.abs(location.getX()) >= 30000000) || (Math.abs(location.getZ()) >= 30000000)) { return; } String world = this.player.getWorld().getName(); if (!world.equals(location.getWorld())) { this.player.transferToWorld(location.getWorld(), new Vector3d(location.getX(), location.getY(), location.getZ())); } else { org.spongepowered.api.world.Location<World> current = this.player.getLocation(); current = current.setPosition(new Vector3d(location.getX(), location.getY(), location.getZ())); this.player.setLocation(current); } }
MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); if (lastPlot.equals(SpongeUtil.getLocation(from).getPlot())) { player.setLocation(from); } else { player.setLocation(player.getWorld().getSpawnLocation()); } else if (!PlotListener.plotEntry(pp, now)) { MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_ENTRY_DENIED); player.setLocation(from); event.setCancelled(true); return; if (x2 > border) { to.sub(x2 - border + 4, 0, 0); player.setLocation(to); MainUtil.sendMessage(pp, C.BORDER); return; } else if (x2 < -border) { to.add(border - x2 + 4, 0, 0); player.setLocation(to); MainUtil.sendMessage(pp, C.BORDER); return; MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); if (lastPlot.equals(SpongeUtil.getLocation(from).getPlot())) { player.setLocation(from); } else { player.setLocation(player.getWorld().getSpawnLocation());
world = player.getWorld(); spawnCoordinates = player.getWorld().getProperties().getSpawnPosition(); player.setLocation(new Location<>(world, spawnCoordinates.toDouble())); } else { if ("-i".equals(args[0])) {
@Listener public void onGamePreInitialization(GamePreInitializationEvent event) { Sponge.getCommandManager().register(this, CommandSpec.builder() .description(Text.of("Teleports a player to another world")) .arguments(seq(playerOrSource(Text.of("target")), onlyOne(world(Text.of("world"))))) .permission(PLUGIN_ID + ".command.tpworld") .executor((src, args) -> { final Optional<WorldProperties> optWorldProperties = args.getOne("world"); final Optional<World> optWorld = Sponge.getServer().getWorld(optWorldProperties.get().getWorldName()); if (!optWorld.isPresent()) { throw new CommandException(Text.of("World [", Text.of(TextColors.AQUA, optWorldProperties.get().getWorldName()), "] " + "was not found.")); } for (Player target : args.<Player>getAll("target")) { target.setLocation(new Location<>(optWorld.get(), optWorld.get().getProperties() .getSpawnPosition())); } return CommandResult.success(); }) .build() , "tpworld"); Sponge.getCommandManager().register(this, new CommandSpawn(), "spawn"); }
player.setLocation(safeLocation); String destinationName = SignUtil.getTextRaw(sign, 0); if (destinationName.isEmpty()) {
((Player) commandSource).setLocation(world.getLocation(x, y, z)); }));
live.setLocation(new Location<>(live.getWorld(), req.getPosition()));