Skip to content

Commit

Permalink
Fix a bug with inter server networks not working
Browse files Browse the repository at this point in the history
Is should not have inverted a boolean :(
  • Loading branch information
Thorinwasher committed Feb 18, 2024
1 parent c392d9f commit eb15df7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public StargateGlobalTask(Runnable runnable){

public void run(boolean bungee) {
// if no players are online, then no bungee messages can be sent (wait 10 second until a player joins)
if(bungee && !Bukkit.getServer().getOnlinePlayers().isEmpty()){
if(bungee && Bukkit.getServer().getOnlinePlayers().isEmpty()){
runDelayed(200, () -> run(true));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ void run_bungee_noDuplicates() {
StargateGlobalTask task = new StargateGlobalTask(runnable);
task.run(true);
serverMock.getScheduler().performTicks(1000);
Assertions.assertFalse(runnable.hasRunBefore);
// Necessary to add a player here to avoid recursion loop
serverMock.addPlayer();
serverMock.getScheduler().performTicks(201);
MockBukkit.unmock();
Assertions.assertTrue(runnable.hasRunBefore);
StargateTask.forceRunAllTasks();
}

@Test
Expand Down

0 comments on commit eb15df7

Please sign in to comment.