From f697924d30295800572f8e46094befda5ecdd386 Mon Sep 17 00:00:00 2001 From: Ghoulboy Date: Tue, 11 Jan 2022 23:29:03 +0100 Subject: [PATCH] Used wrong method to query world border size (#1236) --- docs/scarpet/api/Auxiliary.md | 3 ++- src/main/java/carpet/script/utils/SystemInfo.java | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/scarpet/api/Auxiliary.md b/docs/scarpet/api/Auxiliary.md index 4270b2db..408d103e 100644 --- a/docs/scarpet/api/Auxiliary.md +++ b/docs/scarpet/api/Auxiliary.md @@ -702,7 +702,8 @@ system calls. In all circumstances, these are only provided as read-only. * `world_top` - Returns current dimensions' topmost Y value where one can place blocks. * `world_bottom` - Returns current dimensions' bottommost Y value where one can place blocks. * `world_center` - Returns coordinates of the center of the world with respect of the world border - * `world_size` - Returns size of the world where at this distance from `world_center` world border appears. + * `world_size` - Returns radius of world border for current dimension. + * `world_max_size` - Returns maximum possible radius of world border for current dimension. * ##### Relevant gameplay related properties * `game_difficulty` - current difficulty of the game: `'peaceful'`, `'easy'`, `'normal'`, or `'hard'` diff --git a/src/main/java/carpet/script/utils/SystemInfo.java b/src/main/java/carpet/script/utils/SystemInfo.java index 7d033cfb..73e4a125 100644 --- a/src/main/java/carpet/script/utils/SystemInfo.java +++ b/src/main/java/carpet/script/utils/SystemInfo.java @@ -73,7 +73,9 @@ public class SystemInfo { return ListValue.fromTriple(worldBorder.getCenterX(), 0, worldBorder.getCenterZ()); }); - put("world_size", c-> new NumericValue( c.s.getWorld().getWorldBorder().getMaxRadius())); + put("world_size", c -> new NumericValue(c.s.getWorld().getWorldBorder().getSize() / 2)); + + put("world_max_size", c-> new NumericValue( c.s.getWorld().getWorldBorder().getMaxRadius())); put("world_time", c -> new NumericValue(c.s.getWorld().getTime()));