This repository was archived by the owner on Jan 4, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/com/github/minemaniauk/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -72,7 +72,9 @@ public void activate() {
7272 final KerbClient client = MineManiaAPI .getInstance ().getKerbClient ();
7373
7474 // Check the client is valid.
75- if (!client .isConnected () || !client .isValid ()) return ;
75+ if (!client .isConnected () || !client .isValid ()) {
76+ throw new RuntimeException ("Kerb client was not connected when a game was activated!" );
77+ }
7678
7779 // Call the event.
7880 client .callEvent (new GameArenaActivate (this .getIdentifier (), this .getGameRoomIdentifier ().orElseThrow ()));
Original file line number Diff line number Diff line change @@ -210,13 +210,22 @@ public boolean sendMessage(@NotNull List<String> message) {
210210 public @ NotNull CompletableResultSet <Boolean > teleport (@ NotNull MineManiaLocation location ) {
211211 CompletableResultSet <Boolean > result = new CompletableResultSet <>(1 );
212212
213- // Check if the event contains a true value, they have the permission.
214- new Thread (() -> result .addResult (
215- MineManiaAPI .getInstance ()
216- .callEvent (new UserActionTeleportEvent (this .user , location ))
217- .waitForComplete ()
218- .containsSettable (true )
219- )).start ();
213+ new Thread (() -> {
214+
215+ // Check if it's been completed.
216+ boolean completed = MineManiaAPI .getInstance ()
217+ .callEvent (new UserActionTeleportEvent (this .user , location ))
218+ .waitForComplete ()
219+ .containsSettable (true );
220+
221+ if (completed ) {
222+ result .addResult (true );
223+ }
224+
225+ // Try again.
226+ this .teleport (location );
227+ });
228+
220229
221230 return result ;
222231 }
You can’t perform that action at this time.
0 commit comments