mirror of
https://github.com/BentoBoxWorld/Limits.git
synced 2024-09-27 14:12:57 +02:00
Add getIsland method
This commit is contained in:
parent
78e02b6196
commit
d038269f8c
@ -38,12 +38,14 @@ import org.bukkit.event.block.LeavesDecayEvent;
|
|||||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
import org.eclipse.jdt.annotation.NonNull;
|
||||||
import org.eclipse.jdt.annotation.Nullable;
|
import org.eclipse.jdt.annotation.Nullable;
|
||||||
|
|
||||||
import world.bentobox.bentobox.api.events.island.IslandDeleteEvent;
|
import world.bentobox.bentobox.api.events.island.IslandDeleteEvent;
|
||||||
import world.bentobox.bentobox.api.localization.TextVariables;
|
import world.bentobox.bentobox.api.localization.TextVariables;
|
||||||
import world.bentobox.bentobox.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import world.bentobox.bentobox.database.Database;
|
import world.bentobox.bentobox.database.Database;
|
||||||
|
import world.bentobox.bentobox.database.objects.Island;
|
||||||
import world.bentobox.bentobox.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
import world.bentobox.limits.Limits;
|
import world.bentobox.limits.Limits;
|
||||||
import world.bentobox.limits.objects.IslandBlockCount;
|
import world.bentobox.limits.objects.IslandBlockCount;
|
||||||
@ -463,4 +465,14 @@ public class BlockLimitsListener implements Listener {
|
|||||||
return islandCountMap.get(islandId);
|
return islandCountMap.get(islandId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the island block count for island and make one if it does not exist
|
||||||
|
* @param island island
|
||||||
|
* @return island block count
|
||||||
|
*/
|
||||||
|
@NonNull
|
||||||
|
public IslandBlockCount getIsland(Island island) {
|
||||||
|
return islandCountMap.computeIfAbsent(island.getUniqueId(), k -> new IslandBlockCount(k, island.getGameMode()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user