Skip to content

Commit b95e8fa

Browse files
committed
copy player list on sync (fixes #221)
1 parent e69be74 commit b95e8fa

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

cardinal-components-world/src/main/java/org/ladysnake/cca/mixin/world/common/MixinServerWorld.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ private void tick(BooleanSupplier shouldKeepTicking, CallbackInfo ci) {
7272

7373
@Override
7474
public Iterable<ServerPlayerEntity> getRecipientsForComponentSync() {
75-
return this.getPlayers();
75+
// Need to copy the player list because it might be modified off-thread
76+
// https://github.com/Ladysnake/Cardinal-Components-API/issues/221
77+
return List.copyOf(this.getPlayers());
7678
}
7779

7880
@Override

0 commit comments

Comments
 (0)