Skip to content

Commit

Permalink
Fix teleportation past the border with bypass enabled (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
Warriorrrr authored Sep 16, 2023
1 parent 0695bba commit 5d9c015
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ private void subscribeEvents() {
e.redirect(borderData.map(BorderData::getBorder)
.filter(border -> !border.isBounding(e.getLocation().getX(), e.getLocation().getZ()))
.filter(border -> !e.getPlayer().hasPermission("chunkyborder.bypass.move"))
.filter(border -> !this.getPlayerData(e.getPlayer().getUUID()).isBypassing())
.map(border -> {
final Vector2 center = Vector2.of(borderData.get().getCenterX(), borderData.get().getCenterZ());
final World world = e.getLocation().getWorld();
Expand Down Expand Up @@ -213,8 +214,7 @@ public Map<UUID, PlayerData> getPlayers() {
}

public PlayerData getPlayerData(final UUID uuid) {
this.players.computeIfAbsent(uuid, x -> new PlayerData(uuid));
return players.get(uuid);
return this.players.computeIfAbsent(uuid, x -> new PlayerData(uuid));
}

public Version getVersion() {
Expand Down

0 comments on commit 5d9c015

Please sign in to comment.