Insights  - Super configurable (region) Limits + Asynchronous Scans [1.19.2] icon

Insights - Super configurable (region) Limits + Asynchronous Scans [1.19.2] -----

Create group limits | Permission based | Extremely fast region scans | Many region addon support!



Added InsightsAPI
  • Added the ability to scan hundreds of chunks at the same time using the new API!
Example class:
Code (Java):
package net.frankheijden.insights ;

import net.frankheijden.insights.api.InsightsAPI ;
import net.frankheijden.insights.api.entities.ChunkLocation ;
import org.bukkit.Bukkit ;
import org.bukkit.Chunk ;
import org.bukkit.Material ;
import org.bukkit.World ;
import org.bukkit.entity.EntityType ;
import org.bukkit.plugin.java.JavaPlugin ;

import java.util.* ;
import java.util.concurrent.CompletableFuture ;

public class MyClass extends JavaPlugin {
    InsightsAPI insightsAPI ;

    @Override
    public void onEnable ( ) {
        super. onEnable ( ) ;

        // Create a new InsightsAPI instance
        insightsAPI = new InsightsAPI ( ) ;

        // Get a world to scan in
        World world = Bukkit. getWorld ( "world" ) ;

        // Get some chunklocations together
        List <ChunkLocation > chunkLocations = new ArrayList <> ( ) ;
        for (Chunk chunk : world. getLoadedChunks ( ) ) {
            ChunkLocation chunkLocation = new ChunkLocation (chunk. getX ( ), chunk. getZ ( ) ) ;
            chunkLocations. add (chunkLocation ) ;
        }

        // Lets scan for ores!
        List <Material > materials = Arrays. asList (
                Material. COAL_ORE,
                Material. IRON_ORE,
                Material. LAPIS_ORE,
                Material. REDSTONE_ORE,
                Material. EMERALD_ORE,
                Material. DIAMOND_ORE
        ) ;

        // Lets also scan for Creepers ;-)
        List <EntityType > entityTypes = Collections. singletonList (EntityType. CREEPER ) ;

        // Let the scan begin!
        CompletableFuture <TreeMap < String, Integer >> completableFuture = insightsAPI. scan (world, chunkLocations, materials, entityTypes ) ;

        // When the scan has been completed, execute:
        completableFuture. whenCompleteAsync ( (counts, error ) -> {
            // Print them in the console!
            System. out. println (counts. toString ( ) ) ;
        } ) ;
    }
}
----------, Jun 15, 2019
Resource Information
Author:
----------
Total Downloads: 39,795
First Release: May 6, 2018
Last Update: Oct 6, 2022
Category: ---------------
All-Time Rating:
53 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings