Java Code Examples for org.bukkit.Location#setWorld()
The following examples show how to use
org.bukkit.Location#setWorld() .
These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: UhcCore File: VersionUtils_1_14.java License: GNU General Public License v3.0 | 6 votes |
@Override public void handleNetherPortalEvent(PlayerPortalEvent event){ Location loc = event.getFrom(); MainConfiguration cfg = GameManager.getGameManager().getConfiguration(); if (event.getFrom().getWorld().getEnvironment() == World.Environment.NETHER){ loc.setWorld(Bukkit.getWorld(cfg.getOverworldUuid())); loc.setX(loc.getX() * 2d); loc.setZ(loc.getZ() * 2d); event.setTo(loc); }else{ loc.setWorld(Bukkit.getWorld(cfg.getNetherUuid())); loc.setX(loc.getX() / 2d); loc.setZ(loc.getZ() / 2d); event.setTo(loc); } }
Example 2
Source Project: FastAsyncWorldedit File: WarpBrush.java License: GNU General Public License v3.0 | 6 votes |
@Override protected final void arrow(final SnipeData v) { Player player = v.owner().getPlayer(); Location location = this.getLastBlock().getLocation(); Location playerLocation = player.getLocation(); location.setPitch(playerLocation.getPitch()); location.setYaw(playerLocation.getYaw()); location.setWorld(Bukkit.getWorld(location.getWorld().getName())); TaskManager.IMP.sync(new RunnableVal<Object>() { @Override public void run(Object value) { player.teleport(location); } }); }
Example 3
Source Project: FastAsyncWorldedit File: WarpBrush.java License: GNU General Public License v3.0 | 6 votes |
@Override protected final void powder(final SnipeData v) { Player player = v.owner().getPlayer(); Location location = this.getLastBlock().getLocation(); Location playerLocation = player.getLocation(); location.setPitch(playerLocation.getPitch()); location.setYaw(playerLocation.getYaw()); location.setWorld(Bukkit.getWorld(location.getWorld().getName())); TaskManager.IMP.sync(new RunnableVal<Object>() { @Override public void run(Object value) { player.teleport(location); } }); }
Example 4
Source Project: civcraft File: ArenaListener.java License: GNU General Public License v2.0 | 6 votes |
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerRespawn(PlayerRespawnEvent event) { Resident resident = CivGlobal.getResident(event.getPlayer()); if (!resident.isInsideArena()) { return; } Arena arena = resident.getCurrentArena(); if (arena == null) { return; } Location loc = arena.getRespawnLocation(resident); if (loc != null) { CivMessage.send(resident, CivColor.LightGray+"Respawned in arena."); World world = Bukkit.getWorld(arena.getInstanceName()); loc.setWorld(world); resident.setLastKilledTime(new Date()); event.setRespawnLocation(loc); } }
Example 5
Source Project: Kettle File: CraftEntity.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(entity.posX); loc.setY(entity.posY); loc.setZ(entity.posZ); loc.setYaw(entity.getBukkitYaw()); loc.setPitch(entity.rotationPitch); } return loc; }
Example 6
Source Project: Kettle File: CraftBlock.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(x); loc.setY(y); loc.setZ(z); loc.setYaw(0); loc.setPitch(0); } return loc; }
Example 7
Source Project: Kettle File: CraftBlockState.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(world); loc.setX(x); loc.setY(y); loc.setZ(z); loc.setYaw(0); loc.setPitch(0); } return loc; }
Example 8
Source Project: Skript File: ExprWorld.java License: GNU General Public License v3.0 | 5 votes |
@Override public void change(Event e, @Nullable Object[] delta, Changer.ChangeMode mode) { if (!(getExpr().getAll(e) instanceof Location[] && delta != null)) return; for (final Location loc : (Location[]) getExpr().getAll(e)) { loc.setWorld((World) delta[0]); } }
Example 9
Source Project: Skript File: DelayedChangeBlock.java License: GNU General Public License v3.0 | 5 votes |
@Nullable @Override public Location getLocation(final @Nullable Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(getX()); loc.setY(getY()); loc.setZ(getZ()); loc.setPitch(0); loc.setYaw(0); } return loc; }
Example 10
Source Project: Skript File: BlockStateBlock.java License: GNU General Public License v3.0 | 5 votes |
@Nullable @Override public Location getLocation(final @Nullable Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(getX()); loc.setY(getY()); loc.setZ(getZ()); loc.setPitch(0); loc.setYaw(0); } return loc; }
Example 11
Source Project: NyaaUtils File: MailboxLocations.java License: MIT License | 5 votes |
public Location getMailboxLocation(UUID uuid) { if (uuid == null) return null; Location loc = locationMap.get(uuid); if (loc == null || loc.getWorld() == null || !getLoadedWorldsName().contains(loc.getWorld().getName().toLowerCase())) { return null; } loc.setWorld(Bukkit.getWorld(loc.getWorld().getName())); return loc; }
Example 12
Source Project: Thermos File: CraftEntity.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(entity.posX); loc.setY(entity.posY); loc.setZ(entity.posZ); loc.setYaw(entity.rotationYaw); loc.setPitch(entity.rotationPitch); } return loc; }
Example 13
Source Project: Thermos File: CraftBlock.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(getWorld()); loc.setX(x); loc.setY(y); loc.setZ(z); loc.setYaw(0); loc.setPitch(0); } return loc; }
Example 14
Source Project: Thermos File: CraftBlockState.java License: GNU General Public License v3.0 | 5 votes |
public Location getLocation(Location loc) { if (loc != null) { loc.setWorld(world); loc.setX(x); loc.setY(y); loc.setZ(z); loc.setYaw(0); loc.setPitch(0); } return loc; }
Example 15
Source Project: FastAsyncWorldedit File: AsyncBlock.java License: GNU General Public License v3.0 | 5 votes |
@Override public Location getLocation(Location loc) { if(loc != null) { loc.setWorld(this.getWorld()); loc.setX((double)this.x); loc.setY((double)this.y); loc.setZ((double)this.z); } return loc; }
Example 16
Source Project: uSkyBlock File: PlayerInfo.java License: GNU General Public License v3.0 | 5 votes |
@Override public Location getIslandNetherLocation() { Location l = getIslandLocation(); World nether = uSkyBlock.getInstance().getWorldManager().getNetherWorld(); if (nether == null) { return null; } if (l != null) { l.setWorld(nether); l.setY(l.getY() / 2); } return l; }
Example 17
Source Project: uSkyBlock File: CommonLevelLogic.java License: GNU General Public License v3.0 | 4 votes |
Location getNetherLocation(Location l) { Location netherLoc = l.clone(); netherLoc.setWorld(plugin.getWorldManager().getNetherWorld()); netherLoc.setY(Settings.nether_height); return netherLoc; }
Example 18
Source Project: uSkyBlock File: IslandLogic.java License: GNU General Public License v3.0 | 4 votes |
private Location getNetherLocation(Location loc) { Location netherIsland = loc.clone(); netherIsland.setWorld(plugin.getWorldManager().getNetherWorld()); netherIsland.setY(loc.getY()/2); return netherIsland; }