Search in sources :

Example 1 with Database

use of world.bentobox.bentobox.database.Database in project Level by BentoBoxWorld.

the class LevelsManager method migrate.

public void migrate() {
    Database<LevelsData> oldDb = new Database<>(addon, LevelsData.class);
    oldDb.loadObjects().forEach(ld -> {
        try {
            UUID owner = UUID.fromString(ld.getUniqueId());
            // Step through each world
            ld.getLevels().keySet().stream().map(Bukkit::getWorld).filter(Objects::nonNull).map(w -> addon.getIslands().getIsland(w, owner)).filter(Objects::nonNull).forEach(i -> {
                // Make new database entry
                World w = i.getWorld();
                IslandLevels il = new IslandLevels(i.getUniqueId());
                il.setInitialLevel(ld.getInitialLevel(w));
                il.setLevel(ld.getLevel(w));
                il.setMdCount(ld.getMdCount(w));
                il.setPointsToNextLevel(ld.getPointsToNextLevel(w));
                il.setUwCount(ld.getUwCount(w));
                // Save it
                handler.saveObjectAsync(il);
            });
            // Now delete the old database entry
            oldDb.deleteID(ld.getUniqueId());
        } catch (Exception e) {
            addon.logError("Could not migrate level data database! " + e.getMessage());
            e.printStackTrace();
            return;
        }
    });
}
Also used : IslandLevels(world.bentobox.level.objects.IslandLevels) LevelsData(world.bentobox.level.objects.LevelsData) Database(world.bentobox.bentobox.database.Database) UUID(java.util.UUID) Bukkit(org.bukkit.Bukkit) World(org.bukkit.World)

Example 2 with Database

use of world.bentobox.bentobox.database.Database in project BentoBox by BentoBoxWorld.

the class IslandsManagerTest method setUp.

/**
 * @throws java.lang.Exception
 */
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
    // Clear any lingering database
    tearDown();
    // Set up plugin
    plugin = mock(BentoBox.class);
    Whitebox.setInternalState(BentoBox.class, "instance", plugin);
    // island world mgr
    when(world.getName()).thenReturn("world");
    when(world.getEnvironment()).thenReturn(World.Environment.NORMAL);
    when(iwm.inWorld(any(World.class))).thenReturn(true);
    when(iwm.inWorld(any(Location.class))).thenReturn(true);
    when(plugin.getIWM()).thenReturn(iwm);
    // Chunk deletion manager
    when(plugin.getIslandChunkDeletionManager()).thenReturn(chunkDeletionManager);
    // Settings
    Settings s = mock(Settings.class);
    when(plugin.getSettings()).thenReturn(s);
    when(s.getDatabaseType()).thenReturn(DatabaseType.JSON);
    // World
    when(world.getEnvironment()).thenReturn(World.Environment.NORMAL);
    // Command manager
    CommandsManager cm = mock(CommandsManager.class);
    when(plugin.getCommandsManager()).thenReturn(cm);
    // Player
    when(user.isOp()).thenReturn(false);
    uuid = UUID.randomUUID();
    when(user.getUniqueId()).thenReturn(uuid);
    when(user.getPlayer()).thenReturn(player);
    User.setPlugin(plugin);
    // Set up user already
    when(player.getUniqueId()).thenReturn(uuid);
    User.getInstance(player);
    // Locales
    LocalesManager lm = mock(LocalesManager.class);
    when(plugin.getLocalesManager()).thenReturn(lm);
    when(lm.get(any(), any())).thenReturn("mock translation");
    // Placeholders
    PlaceholdersManager placeholdersManager = mock(PlaceholdersManager.class);
    when(plugin.getPlaceholdersManager()).thenReturn(placeholdersManager);
    when(placeholdersManager.replacePlaceholders(any(), any())).thenReturn("mock translation");
    // Player's manager
    when(plugin.getPlayers()).thenReturn(pm);
    // Scheduler
    BukkitScheduler sch = mock(BukkitScheduler.class);
    PowerMockito.mockStatic(Bukkit.class);
    when(Bukkit.getScheduler()).thenReturn(sch);
    // version
    when(Bukkit.getVersion()).thenReturn("Paper version git-Paper-225 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)");
    // Standard location
    when(location.getWorld()).thenReturn(world);
    when(location.getBlock()).thenReturn(space1);
    when(location.getWorld()).thenReturn(world);
    when(location.clone()).thenReturn(location);
    Chunk chunk = mock(Chunk.class);
    when(location.getChunk()).thenReturn(chunk);
    when(space1.getRelative(BlockFace.DOWN)).thenReturn(ground);
    when(space1.getRelative(BlockFace.UP)).thenReturn(space2);
    // A safe spot
    when(ground.getType()).thenReturn(Material.STONE);
    when(space1.getType()).thenReturn(Material.AIR);
    when(space2.getType()).thenReturn(Material.AIR);
    // Neutral BlockState
    BlockState blockState = mock(BlockState.class);
    when(ground.getState()).thenReturn(blockState);
    BlockData bd = mock(BlockData.class);
    when(blockState.getBlockData()).thenReturn(bd);
    // Online players
    // Return a set of online players
    when(Bukkit.getOnlinePlayers()).then((Answer<Set<Player>>) invocation -> new HashSet<>());
    // Worlds
    when(plugin.getIWM()).thenReturn(iwm);
    // Default is player is in the world
    when(iwm.inWorld(any(World.class))).thenReturn(true);
    when(iwm.inWorld(any(Location.class))).thenReturn(true);
    // Worlds translate to world
    PowerMockito.mockStatic(Util.class);
    when(Util.getWorld(any())).thenReturn(world);
    // Island
    when(island.getOwner()).thenReturn(uuid);
    when(island.getWorld()).thenReturn(world);
    // default
    when(island.getMaxMembers()).thenReturn(null);
    // default
    when(island.getMaxMembers(Mockito.anyInt())).thenReturn(null);
    when(island.getCenter()).thenReturn(location);
    when(island.getProtectionCenter()).thenReturn(location);
    // Mock island cache
    when(islandCache.getIslandAt(any(Location.class))).thenReturn(island);
    when(islandCache.get(any(), any())).thenReturn(island);
    optionalIsland = Optional.ofNullable(island);
    // User location
    when(user.getLocation()).thenReturn(location);
    // Plugin Manager for events
    when(Bukkit.getPluginManager()).thenReturn(pim);
    // Addon
    when(iwm.getAddon(any())).thenReturn(Optional.empty());
    // Cover hostile entities
    when(Util.isHostileEntity(any())).thenCallRealMethod();
    // Set up island entities
    WorldSettings ws = mock(WorldSettings.class);
    when(iwm.getWorldSettings(eq(world))).thenReturn(ws);
    Map<String, Boolean> worldFlags = new HashMap<>();
    when(ws.getWorldFlags()).thenReturn(worldFlags);
    Flags.REMOVE_MOBS.setSetting(world, true);
    // Default whitelist
    Set<EntityType> whitelist = new HashSet<>();
    whitelist.add(EntityType.ENDERMAN);
    whitelist.add(EntityType.WITHER);
    whitelist.add(EntityType.ZOMBIE_VILLAGER);
    when(iwm.getRemoveMobsWhitelist(any())).thenReturn(whitelist);
    // Monsters and animals
    when(zombie.getLocation()).thenReturn(location);
    when(zombie.getType()).thenReturn(EntityType.ZOMBIE);
    when(zombie.getRemoveWhenFarAway()).thenReturn(true);
    when(slime.getLocation()).thenReturn(location);
    when(slime.getType()).thenReturn(EntityType.SLIME);
    when(slime.getRemoveWhenFarAway()).thenReturn(true);
    when(cow.getLocation()).thenReturn(location);
    when(cow.getType()).thenReturn(EntityType.COW);
    when(wither.getType()).thenReturn(EntityType.WITHER);
    when(wither.getRemoveWhenFarAway()).thenReturn(true);
    when(creeper.getType()).thenReturn(EntityType.CREEPER);
    when(creeper.getRemoveWhenFarAway()).thenReturn(true);
    when(pufferfish.getType()).thenReturn(EntityType.PUFFERFISH);
    // Named monster
    when(skelly.getType()).thenReturn(EntityType.SKELETON);
    when(skelly.getCustomName()).thenReturn("Skelly");
    when(skelly.getRemoveWhenFarAway()).thenReturn(true);
    Collection<Entity> collection = new ArrayList<>();
    collection.add(player);
    collection.add(zombie);
    collection.add(cow);
    collection.add(slime);
    collection.add(wither);
    collection.add(creeper);
    collection.add(pufferfish);
    collection.add(skelly);
    when(world.getNearbyEntities(any(Location.class), Mockito.anyDouble(), Mockito.anyDouble(), Mockito.anyDouble())).thenReturn(collection);
    // database must be mocked here
    db = mock(Database.class);
    // Signs
    sign = Material.getMaterial("SIGN");
    if (sign == null) {
        sign = Material.getMaterial("OAK_SIGN");
    }
    wallSign = Material.getMaterial("WALL_SIGN");
    if (wallSign == null) {
        wallSign = Material.getMaterial("OAK_WALL_SIGN");
    }
    // PaperLib
    env = new CraftBukkitEnvironment();
    PaperLib.setCustomEnvironment(env);
    // Util strip spaces
    when(Util.stripSpaceAfterColorCodes(anyString())).thenCallRealMethod();
    // Class under test
    im = new IslandsManager(plugin);
// Set cache
// im.setIslandCache(islandCache);
}
Also used : Arrays(java.util.Arrays) User(world.bentobox.bentobox.api.user.User) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Slime(org.bukkit.entity.Slime) Zombie(org.bukkit.entity.Zombie) BlockFace(org.bukkit.block.BlockFace) Player(org.bukkit.entity.Player) PaperLib(io.papermc.lib.PaperLib) Block(org.bukkit.block.Block) Location(org.bukkit.Location) World(org.bukkit.World) Map(java.util.Map) After(org.junit.After) Chunk(org.bukkit.Chunk) Path(java.nio.file.Path) Database(world.bentobox.bentobox.database.Database) Material(org.bukkit.Material) IslandCache(world.bentobox.bentobox.managers.island.IslandCache) Bukkit(org.bukkit.Bukkit) PufferFish(org.bukkit.entity.PufferFish) ImmutableSet(com.google.common.collect.ImmutableSet) BlockData(org.bukkit.block.data.BlockData) Entity(org.bukkit.entity.Entity) Collection(java.util.Collection) Set(java.util.Set) UUID(java.util.UUID) EntityType(org.bukkit.entity.EntityType) Assert.assertFalse(org.junit.Assert.assertFalse) Util(world.bentobox.bentobox.util.Util) Optional(java.util.Optional) Flags(world.bentobox.bentobox.lists.Flags) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) IslandDeleteEvent(world.bentobox.bentobox.api.events.island.IslandDeleteEvent) Whitebox(org.powermock.reflect.Whitebox) Island(world.bentobox.bentobox.database.objects.Island) CraftBukkitEnvironment(io.papermc.lib.environments.CraftBukkitEnvironment) Wither(org.bukkit.entity.Wither) Mock(org.mockito.Mock) RunWith(org.junit.runner.RunWith) HashMap(java.util.HashMap) DatabaseType(world.bentobox.bentobox.database.DatabaseSetup.DatabaseType) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Answer(org.mockito.stubbing.Answer) Builder(com.google.common.collect.ImmutableSet.Builder) ArgumentCaptor(org.mockito.ArgumentCaptor) WorldSettings(world.bentobox.bentobox.api.configuration.WorldSettings) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) BentoBox(world.bentobox.bentobox.BentoBox) PowerMockRunner(org.powermock.modules.junit4.PowerMockRunner) PowerMockito(org.powermock.api.mockito.PowerMockito) Before(org.junit.Before) BukkitScheduler(org.bukkit.scheduler.BukkitScheduler) Files(java.nio.file.Files) Assert.assertNotNull(org.junit.Assert.assertNotNull) Skeleton(org.bukkit.entity.Skeleton) Assert.assertTrue(org.junit.Assert.assertTrue) BlockState(org.bukkit.block.BlockState) IOException(java.io.IOException) Test(org.junit.Test) Mockito.when(org.mockito.Mockito.when) PermissionAttachmentInfo(org.bukkit.permissions.PermissionAttachmentInfo) File(java.io.File) Mockito.verify(org.mockito.Mockito.verify) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) Assert.assertNull(org.junit.Assert.assertNull) Creeper(org.bukkit.entity.Creeper) Settings(world.bentobox.bentobox.Settings) Cow(org.bukkit.entity.Cow) Comparator(java.util.Comparator) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) PluginManager(org.bukkit.plugin.PluginManager) Environment(io.papermc.lib.environments.Environment) Entity(org.bukkit.entity.Entity) ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) World(org.bukkit.World) WorldSettings(world.bentobox.bentobox.api.configuration.WorldSettings) Database(world.bentobox.bentobox.database.Database) BlockData(org.bukkit.block.data.BlockData) WorldSettings(world.bentobox.bentobox.api.configuration.WorldSettings) Settings(world.bentobox.bentobox.Settings) HashSet(java.util.HashSet) CraftBukkitEnvironment(io.papermc.lib.environments.CraftBukkitEnvironment) BentoBox(world.bentobox.bentobox.BentoBox) Chunk(org.bukkit.Chunk) EntityType(org.bukkit.entity.EntityType) BlockState(org.bukkit.block.BlockState) BukkitScheduler(org.bukkit.scheduler.BukkitScheduler) Location(org.bukkit.Location) Before(org.junit.Before)

Example 3 with Database

use of world.bentobox.bentobox.database.Database in project BentoBox by BentoBoxWorld.

the class PlayersManagerTest method setUp.

/**
 * @throws java.lang.Exception
 */
@SuppressWarnings("unchecked")
@Before
public void setUp() throws Exception {
    // Clear any lingering database
    tearDown();
    // Set up plugin
    Whitebox.setInternalState(BentoBox.class, "instance", plugin);
    when(plugin.getVault()).thenReturn(Optional.of(vault));
    // Settings
    Settings s = mock(Settings.class);
    // The database type has to be created one line before the thenReturn() to work!
    DatabaseType value = DatabaseType.JSON;
    when(plugin.getSettings()).thenReturn(s);
    when(s.getDatabaseType()).thenReturn(value);
    when(s.isUseEconomy()).thenReturn(true);
    // island world mgr
    when(world.getName()).thenReturn("world");
    when(world.getEnvironment()).thenReturn(World.Environment.NORMAL);
    when(nether.getName()).thenReturn("world_nether");
    when(nether.getEnvironment()).thenReturn(World.Environment.NETHER);
    when(end.getName()).thenReturn("world_the_end");
    when(end.getEnvironment()).thenReturn(World.Environment.THE_END);
    when(iwm.inWorld(any(World.class))).thenReturn(true);
    when(iwm.inWorld(any(Location.class))).thenReturn(true);
    when(plugin.getIWM()).thenReturn(iwm);
    // Set up spawn
    Location netherSpawn = mock(Location.class);
    when(netherSpawn.toVector()).thenReturn(new Vector(0, 0, 0));
    when(nether.getSpawnLocation()).thenReturn(netherSpawn);
    when(iwm.getNetherSpawnRadius(Mockito.any())).thenReturn(100);
    // UUID
    uuid = UUID.randomUUID();
    notUUID = UUID.randomUUID();
    while (notUUID.equals(uuid)) {
        notUUID = UUID.randomUUID();
    }
    // Player
    when(p.getEnderChest()).thenReturn(inv);
    when(p.getInventory()).thenReturn(playerInv);
    when(p.getUniqueId()).thenReturn(uuid);
    AttributeInstance at = mock(AttributeInstance.class);
    when(at.getValue()).thenReturn(20D);
    when(p.getAttribute(Attribute.GENERIC_MAX_HEALTH)).thenReturn(at);
    // Sometimes use Mockito.withSettings().verboseLogging()
    user = mock(User.class);
    when(user.isOp()).thenReturn(false);
    when(user.getUniqueId()).thenReturn(uuid);
    when(user.getPlayer()).thenReturn(p);
    when(user.getName()).thenReturn("tastybento");
    when(user.isOnline()).thenReturn(true);
    User.setPlugin(plugin);
    OfflinePlayer olp = mock(OfflinePlayer.class);
    when(olp.getUniqueId()).thenReturn(uuid);
    when(olp.getName()).thenReturn("tastybento");
    PowerMockito.mockStatic(Bukkit.class);
    when(Bukkit.getOfflinePlayer(Mockito.any(UUID.class))).thenReturn(olp);
    // Player has island to begin with
    IslandsManager im = mock(IslandsManager.class);
    when(im.hasIsland(Mockito.any(), Mockito.any(UUID.class))).thenReturn(true);
    when(im.isOwner(Mockito.any(), Mockito.any())).thenReturn(true);
    when(im.getOwner(Mockito.any(), Mockito.any())).thenReturn(uuid);
    when(plugin.getIslands()).thenReturn(im);
    // Server & Scheduler
    BukkitScheduler sch = mock(BukkitScheduler.class);
    when(Bukkit.getScheduler()).thenReturn(sch);
    // Locales
    LocalesManager lm = mock(LocalesManager.class);
    when(lm.get(Mockito.any(), Mockito.any())).thenReturn("mock translation");
    when(plugin.getLocalesManager()).thenReturn(lm);
    // Util
    PowerMockito.mockStatic(Util.class, Mockito.RETURNS_MOCKS);
    when(Util.sameWorld(any(), any())).thenCallRealMethod();
    // Database
    db = mock(Database.class);
    // Leave commands
    when(iwm.getOnLeaveCommands(any())).thenReturn(Collections.emptyList());
    // Leave settings
    when(iwm.isOnLeaveResetEnderChest(any())).thenReturn(true);
    when(iwm.isOnLeaveResetInventory(any())).thenReturn(true);
    when(iwm.isKickedKeepInventory(any())).thenReturn(true);
    when(iwm.isOnLeaveResetMoney(any())).thenReturn(true);
    when(iwm.isOnLeaveResetHealth(any())).thenReturn(true);
    when(iwm.isOnLeaveResetHunger(any())).thenReturn(true);
    when(iwm.isOnLeaveResetXP(any())).thenReturn(true);
    // Tamed animals
    List<Tameable> list = new ArrayList<>();
    list.add(tamed);
    when(tamed.isTamed()).thenReturn(true);
    when(tamed.getOwner()).thenReturn(p);
    when(world.getEntitiesByClass(Tameable.class)).thenReturn(list);
    // Class under test
    pm = new PlayersManager(plugin);
}
Also used : User(world.bentobox.bentobox.api.user.User) Tameable(org.bukkit.entity.Tameable) DatabaseType(world.bentobox.bentobox.database.DatabaseSetup.DatabaseType) ArrayList(java.util.ArrayList) World(org.bukkit.World) AttributeInstance(org.bukkit.attribute.AttributeInstance) Database(world.bentobox.bentobox.database.Database) OfflinePlayer(org.bukkit.OfflinePlayer) BukkitScheduler(org.bukkit.scheduler.BukkitScheduler) UUID(java.util.UUID) Vector(org.bukkit.util.Vector) Settings(world.bentobox.bentobox.Settings) Location(org.bukkit.Location) Before(org.junit.Before)

Example 4 with Database

use of world.bentobox.bentobox.database.Database in project MagicCobblestoneGenerator by BentoBoxWorld.

the class StoneGeneratorManager method getGeneratorTier.

/**
 * This method returns active generator tier object for island at given location.
 *
 * @param island Island on which generation is happening.
 * @param location Location of the block.
 * @param generatorType Generator type.
 * @return GeneratorTierObject that operates in given island or null.
 */
@Nullable
public GeneratorTierObject getGeneratorTier(@Nullable Island island, Location location, GeneratorTierObject.GeneratorType generatorType) {
    // Gets biome from location.
    final Biome biome = location.getWorld().getBiome(location.getBlockX(), location.getBlockY(), location.getBlockZ());
    if (island == null) {
        // No islands at given location, find and use default generator tier.
        return this.findDefaultGeneratorTier(location.getWorld(), generatorType, biome);
    }
    this.addIslandData(island);
    GeneratorDataObject data = this.generatorDataCache.get(island.getUniqueId());
    // TODO: It is necessary to reset user cache when import new generators are don.
    // I changed implementation for faster work, so it gets challenges on island data loading,
    // but it cache it inside island data. So when someone overwrites generators in database,
    // but player data are not resetted, then all their generators are locally different then
    // used in database.
    // Find generator from active generator list.
    Optional<GeneratorTierObject> optionalGenerator = data.getActiveGeneratorList().stream().map(this.addon.getAddonManager()::getGeneratorByID).filter(Objects::nonNull).filter(GeneratorTierObject::isDeployed).filter(generator -> generator.getGeneratorType().includes(generatorType)).filter(generator -> generator.getRequiredBiomes().isEmpty() || generator.getRequiredBiomes().contains(biome)).max((o1, o2) -> {
        // If required biomes is empty, the it works in all biomes.
        boolean o1HasBiome = o1.getRequiredBiomes().isEmpty() || o1.getRequiredBiomes().contains(biome);
        boolean o2HasBiome = o2.getRequiredBiomes().isEmpty() || o2.getRequiredBiomes().contains(biome);
        if (o1HasBiome != o2HasBiome) {
            return Boolean.compare(o1HasBiome, o2HasBiome);
        } else if (o1.getPriority() != o2.getPriority()) {
            // Larger priority must be in the end.
            return Integer.compare(o1.getPriority(), o2.getPriority());
        } else if (o1.isDefaultGenerator() || o2.isDefaultGenerator()) {
            // Default should be placed last one.
            return Boolean.compare(o2.isDefaultGenerator(), o1.isDefaultGenerator());
        } else if (o1.getGeneratorType() != o2.getGeneratorType()) {
            // Compare by type. Generators which are more specified should be first.
            return o1.getGeneratorType().compareTo(o2.getGeneratorType());
        } else {
            // Compare by unique id.
            return o1.getUniqueId().compareTo(o2.getUniqueId());
        }
    });
    return optionalGenerator.orElse(this.findDefaultGeneratorTier(location.getWorld(), generatorType, biome));
}
Also used : Island(world.bentobox.bentobox.database.objects.Island) User(world.bentobox.bentobox.api.user.User) Utils(world.bentobox.magiccobblestonegenerator.utils.Utils) TextVariables(world.bentobox.bentobox.api.localization.TextVariables) GeneratorActivationEvent(world.bentobox.magiccobblestonegenerator.events.GeneratorActivationEvent) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) GeneratorUnlockEvent(world.bentobox.magiccobblestonegenerator.events.GeneratorUnlockEvent) BankManager(world.bentobox.bank.BankManager) Biome(org.bukkit.block.Biome) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) GeneratorTierObject(world.bentobox.magiccobblestonegenerator.database.objects.GeneratorTierObject) Location(org.bukkit.Location) World(org.bukkit.World) GameModeAddon(world.bentobox.bentobox.api.addons.GameModeAddon) Map(java.util.Map) EconomyResponse(net.milkbowl.vault.economy.EconomyResponse) AddonEvent(world.bentobox.bentobox.api.events.addon.AddonEvent) Database(world.bentobox.bentobox.database.Database) Bukkit(org.bukkit.Bukkit) Iterator(java.util.Iterator) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) ItemStack(org.bukkit.inventory.ItemStack) Money(world.bentobox.bank.data.Money) Objects(java.util.Objects) Nullable(org.jetbrains.annotations.Nullable) TxType(world.bentobox.bank.data.TxType) List(java.util.List) Stream(java.util.stream.Stream) GeneratorBundleObject(world.bentobox.magiccobblestonegenerator.database.objects.GeneratorBundleObject) TreeMap(java.util.TreeMap) GeneratorDataObject(world.bentobox.magiccobblestonegenerator.database.objects.GeneratorDataObject) Optional(java.util.Optional) StoneGeneratorAddon(world.bentobox.magiccobblestonegenerator.StoneGeneratorAddon) GeneratorBuyEvent(world.bentobox.magiccobblestonegenerator.events.GeneratorBuyEvent) Constants(world.bentobox.magiccobblestonegenerator.utils.Constants) Comparator(java.util.Comparator) NotNull(org.jetbrains.annotations.NotNull) Collections(java.util.Collections) BankResponse(world.bentobox.bank.BankResponse) Biome(org.bukkit.block.Biome) GeneratorDataObject(world.bentobox.magiccobblestonegenerator.database.objects.GeneratorDataObject) GeneratorTierObject(world.bentobox.magiccobblestonegenerator.database.objects.GeneratorTierObject) Objects(java.util.Objects) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

UUID (java.util.UUID)4 World (org.bukkit.World)4 Database (world.bentobox.bentobox.database.Database)4 ArrayList (java.util.ArrayList)3 Bukkit (org.bukkit.Bukkit)3 Location (org.bukkit.Location)3 User (world.bentobox.bentobox.api.user.User)3 Collections (java.util.Collections)2 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 Optional (java.util.Optional)2 Set (java.util.Set)2 BukkitScheduler (org.bukkit.scheduler.BukkitScheduler)2 Before (org.junit.Before)2 Settings (world.bentobox.bentobox.Settings)2 DatabaseType (world.bentobox.bentobox.database.DatabaseSetup.DatabaseType)2 Island (world.bentobox.bentobox.database.objects.Island)2 ImmutableSet (com.google.common.collect.ImmutableSet)1