Skip to content

Commit

Permalink
Fix nether vanilla border (#80)
Browse files Browse the repository at this point in the history
Vanilla World Border automatically converts coordinates by dimension multiplayer.
So in the nether it is required to counter it with extra processing.

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
  • Loading branch information
emmanuelvlad and BuildTools committed May 6, 2022
1 parent 5215e03 commit 9a402e7
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.WorldBorder;
import org.bukkit.World.Environment;
import org.bukkit.entity.Player;

import world.bentobox.bentobox.api.metadata.MetaDataValue;
Expand Down Expand Up @@ -32,6 +33,9 @@ public void showBorder(Player player, Island island) {
return;
}
Location l = island.getProtectionCenter();
if (player.getWorld().getEnvironment() == Environment.NETHER) {
l.multiply(8);
}
WorldBorder wb = Bukkit.createWorldBorder();
wb.setCenter(l);
wb.setSize(island.getProtectionRange() * 2D);
Expand Down

0 comments on commit 9a402e7

Please sign in to comment.