Make world border more aligned
Some checks failed
/ deploy (push) Has been cancelled

This commit is contained in:
Minecon724 2024-12-01 11:02:51 +01:00
parent 6f0dae932b
commit e93264472d
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -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);
}
}