From a9fc57d981d948fcdb5be2fc8669f5559e8c1a0a Mon Sep 17 00:00:00 2001 From: autocommit Date: Mon, 18 May 2026 01:23:25 -0700 Subject: [PATCH] =?UTF-8?q?infra(api-gdext):=20=F0=9F=A7=B1=20Update=20Rus?= =?UTF-8?q?t=20GDExtension=20API=20functions=20and=20bindings=20for=20Godo?= =?UTF-8?q?t=20Engine=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- src/simulator/api-gdext/src/lib.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/simulator/api-gdext/src/lib.rs b/src/simulator/api-gdext/src/lib.rs index a1134f7c..60e351a5 100644 --- a/src/simulator/api-gdext/src/lib.rs +++ b/src/simulator/api-gdext/src/lib.rs @@ -3776,6 +3776,23 @@ impl GdGameState { true } + /// List every registered AI controller id (sorted, ascending). + /// Bridges `mc_player_api::registered_ids` to GDScript so the + /// game-setup screen (Stage 8) can populate its per-slot + /// "AI Controller" dropdowns without hardcoding the id list. + /// + /// At engine boot the registry contains `"scripted:default"`; + /// `ModLoader` (Stage 5) registers additional ids before this + /// is read. + #[func] + fn registered_controller_ids() -> PackedStringArray { + let mut out = PackedStringArray::new(); + for id in mc_player_api::registered_ids() { + out.push(&GString::from(id)); + } + out + } + /// Current turn number. #[func] fn turn(&self) -> i64 {