Skip to content

Commit

Permalink
Teleport players to the top block of post
Browse files Browse the repository at this point in the history
I'm guessing he stopped calculating y value after making his fancy
shmancy launch-and-drop feature
  • Loading branch information
RoboMWM committed Dec 24, 2016
1 parent 76808ec commit a87ec25
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/me/ryanhamshire/PopulationDensity/PopulationDensity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1214,13 +1214,15 @@ private boolean nearCityPost(Player player)
public void TeleportPlayer(Player player, RegionCoordinates region, int delaySeconds)
{
//where specifically to send the player?
Location teleportDestination = getRegionCenter(region, false);
Double x = teleportDestination.getBlockX() + 0.5D;
Double z = teleportDestination.getBlockZ() + 0.5D;
Location teleportDestination = getRegionCenter(region, true);
teleportDestination.setX(teleportDestination.getBlockX() + 0.5D);
teleportDestination.setY(teleportDestination.getBlockY() + 1D);
teleportDestination.setZ(teleportDestination.getBlockZ() + 0.5D);


//drop the player from the sky //RoboMWM - only if LaunchAndDropPlayers is enabled
if (config_launchAndDropPlayers)
teleportDestination = new Location(ManagedWorld, x, ManagedWorld.getMaxHeight() + 10, z, player.getLocation().getYaw(), 90);
teleportDestination = new Location(ManagedWorld, teleportDestination.getX(), ManagedWorld.getMaxHeight() + 10, teleportDestination.getZ(), player.getLocation().getYaw(), 90);
new TeleportPlayerTask(player, teleportDestination, config_launchAndDropPlayers, instance, dropShipTeleporterInstance).runTaskLater(this, delaySeconds * 20L);

//kill bad guys in the area
Expand Down

0 comments on commit a87ec25

Please sign in to comment.