From e93264472dbcc29e740ec5c919e22750eab885b7 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 1 Dec 2024 11:02:51 +0100 Subject: [PATCH] Make world border more aligned --- .../tweaks/worldborder/WorldBorderExpanderListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/eu/m724/tweaks/worldborder/WorldBorderExpanderListener.java b/src/main/java/eu/m724/tweaks/worldborder/WorldBorderExpanderListener.java index 3c4bc45..e94051c 100644 --- a/src/main/java/eu/m724/tweaks/worldborder/WorldBorderExpanderListener.java +++ b/src/main/java/eu/m724/tweaks/worldborder/WorldBorderExpanderListener.java @@ -17,6 +17,13 @@ public class WorldBorderExpanderListener implements Listener { public void onWorldLoad(WorldLoadEvent event) { ServerLevel level = ((CraftWorld) event.getWorld()).getHandle(); + if (level.getWorldBorder().getSize() < 5.9999968E7D) { + // if the world border was modified we don't touch it + return; + } + level.getWorldBorder().setAbsoluteMaxSize(30000000); + // to align with player hitbox because player can't go beyond 30m - 1 and player's hitbox is 0.6 wide so we make it "hug" the border + level.getWorldBorder().setSize(59999998.6); } }