Fix admin register command to handle worlds correctly

The register command was failing if a player had more that one island,
even if the island was in a different game mode.
This commit is contained in:
tastybento 2023-12-19 04:51:10 -08:00
parent 1ef55a2b1e
commit f6e26aa5bd

View File

@ -313,7 +313,8 @@ public class IslandCache {
if (!islandsByUUID.containsKey(uuid)) {
return false;
}
return this.islandsByUUID.get(uuid).stream().anyMatch(i -> uuid.equals(i.getOwner()));
return this.islandsByUUID.get(uuid).stream().filter(i -> world.equals(i.getWorld()))
.anyMatch(i -> uuid.equals(i.getOwner()));
}
/**