File tree Expand file tree Collapse file tree
src/main/java/dev/zenith/ppapi/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import com .google .common .cache .Cache ;
55import com .google .common .cache .CacheBuilder ;
66import com .zenith .Globals ;
7+ import com .zenith .Proxy ;
78import com .zenith .command .api .CommandContext ;
89import com .zenith .command .api .CommandOutputHelper ;
910import dev .zenith .ppapi .api .model .ApiErrorResponse ;
@@ -125,7 +126,8 @@ private Javalin createServer() {
125126 result .pearls (),
126127 result .output (),
127128 botInfo .minecraftServer (),
128- botInfo .botUsername ()
129+ botInfo .botUsername (),
130+ botInfo .botConnected ()
129131 ));
130132 ctx .status (200 );
131133 })
@@ -235,6 +237,7 @@ private record ConfigPearlResult(
235237 private BotInfo readZenithBotInfo () {
236238 String server = null ;
237239 String username = null ;
240+ boolean connected = Proxy .getInstance ().isConnected ();
238241 var config = Globals .CONFIG ;
239242 if (config != null ) {
240243 if (config .authentication != null ) {
@@ -247,11 +250,12 @@ private BotInfo readZenithBotInfo() {
247250 }
248251 }
249252 }
250- return new BotInfo (server , username );
253+ return new BotInfo (server , username , connected );
251254 }
252255
253256 private record BotInfo (
254257 String minecraftServer ,
255- String botUsername
258+ String botUsername ,
259+ boolean botConnected
256260 ) { }
257261}
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ public record PearlStatusResponse(
66 List <String > pearls ,
77 List <String > output ,
88 String minecraftServer ,
9- String botUsername
9+ String botUsername ,
10+ boolean botConnected
1011) { }
You can’t perform that action at this time.
0 commit comments