Skip to content

Commit

Permalink
Shuffle team members on game join
Browse files Browse the repository at this point in the history
Should fix e.g. suspicious spleef where the party player order is directly put into the new game and thus the same player gets the pickaxe every time.
 
See here: https://github.com/NucleoidMC/spleef/blob/1.19.4/src/main/java/xyz/nucleoid/spleef/game/ToolConfig.java#L35
  • Loading branch information
UltraBlackLinux authored and Patbox committed Dec 8, 2024
1 parent db2112f commit d36bfcf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/xyz/nucleoid/parties/PartyManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.UUID;
import java.util.List;

public final class PartyManager {
private static PartyManager instance;
Expand All @@ -34,6 +35,8 @@ public static void register() {
var partyManager = PartyManager.get(player.server);

var members = partyManager.getPartyMembers(player);
Collections.shuffle((List<ServerPlayerEntity>) members);

additional.addAll(members);
});
}
Expand Down

0 comments on commit d36bfcf

Please sign in to comment.