Skip to content

Commit

Permalink
Teleport player home if they breach the barrier.
Browse files Browse the repository at this point in the history
  • Loading branch information
tastybento committed Jan 10, 2021
1 parent f01d60c commit adb21fc
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ public void showBarrier(Player player, Island island) {
}

private void showPlayer(Player player, int i, int j, int k) {
// Get if on or in border
if (player.getLocation().getBlockX() == i && player.getLocation().getBlockZ() == k) {
addon.getIslands().homeTeleportAsync(player.getWorld(), player);
return;
}
Location l = new Location(player.getWorld(), i, j, k);
Util.getChunkAtAsync(l).thenAccept(c -> {
User.getInstance(player).spawnParticle(PARTICLE, PARTICLE_DUST_OPTIONS, i + 0.5D, j + 0.0D, k + 0.5D);
Expand Down

0 comments on commit adb21fc

Please sign in to comment.