mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-23 16:41:42 +01:00
Filter out null islands in worlds where players have none in world.
This commit is contained in:
parent
9bb45ae426
commit
f4ff1bb412
@ -3,6 +3,7 @@ package world.bentobox.bentobox.listeners;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
@ -90,9 +91,10 @@ public class JoinLeaveListener implements Listener {
|
||||
// Clear inventory if required
|
||||
clearPlayersInventory(Util.getWorld(event.getPlayer().getWorld()), user);
|
||||
|
||||
// Set island max members based on permissions if this player is the owner of an island
|
||||
// Set island max members and homes based on permissions if this player is the owner of an island
|
||||
plugin.getIWM().getOverWorlds().stream()
|
||||
.map(w -> plugin.getIslands().getIsland(w, playerUUID))
|
||||
.filter(Objects::nonNull)
|
||||
.filter(i -> playerUUID.equals(i.getOwner()))
|
||||
.forEach(i -> {
|
||||
plugin.getIslands().getMaxMembers(i, RanksManager.MEMBER_RANK);
|
||||
|
Loading…
Reference in New Issue
Block a user