Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Commit

Permalink
Load the destination chunk just before teleporting the player
Browse files Browse the repository at this point in the history
  • Loading branch information
vxnick committed Jan 14, 2014
1 parent 64b31bc commit 9584258
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/com/vxnick/areatp/AreaTP.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ private void teleportPlayer(String playerName, String areaName) {
Float areaYaw = (float) getConfig().getDouble(String.format("areas.%s.yaw", areaName));

Location newLocation = new Location(getServer().getWorld(areaWorld), areaX, areaY, areaZ, areaYaw, areaPitch);


// Load the chunk
getServer().getWorld(areaWorld).loadChunk(newLocation.getChunk());

player.sendMessage(String.format(ChatColor.GOLD + "Teleporting you to %s (owner: %s)", areaName, areaOwner));
player.teleport(newLocation);
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AreaTP
main: com.vxnick.areatp.AreaTP
version: 0.4.0
version: 0.5.0
description: Create area teleports.
author: vxnick
website: http://github.com/vxnick/areatp
Expand Down

0 comments on commit 9584258

Please sign in to comment.