v1.3: Implemented MultiMapWrapper and removed BKCommonLib dependency #7
3 changed files with 26 additions and 0 deletions
11
pom.xml
11
pom.xml
|
@ -82,6 +82,10 @@
|
|||
<pattern>com.bergerkiller.bukkit.common</pattern>
|
||||
<shadedPattern>tech.sbdevelopment.mapreflectionapi.libs.bkcommonlib</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>tech.sbdevelopment.mapreflectionapi.libs.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
@ -201,5 +205,12 @@
|
|||
<version>23.0.0</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -24,6 +24,8 @@
|
|||
package tech.sbdevelopment.mapreflectionapi;
|
||||
|
||||
import com.comphenix.protocol.ProtocolLibrary;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SingleLineChart;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
@ -119,6 +121,10 @@ public class MapReflectionAPI extends JavaPlugin {
|
|||
Bukkit.getPluginManager().registerEvents(new MapListener(), this);
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketListener(this));
|
||||
|
||||
getLogger().info("Loading metrics...");
|
||||
Metrics metrics = new Metrics(this, 16033);
|
||||
metrics.addCustomChart(new SingleLineChart("managed_maps", () -> mapManager.getManagedMapsCount()));
|
||||
|
||||
if (Configuration.getInstance().isUpdaterCheck()) {
|
||||
UpdateManager updateManager = new UpdateManager(this, UpdateManager.CheckType.SPIGOT);
|
||||
|
||||
|
|
|
@ -39,6 +39,15 @@ public class MapManager {
|
|||
protected final Set<Integer> occupiedIds = new HashSet<>();
|
||||
protected final List<MapWrapper> managedMaps = new CopyOnWriteArrayList<>();
|
||||
|
||||
/**
|
||||
* Get the amount of maps managed by the plugin
|
||||
*
|
||||
* @return The managed maps amount
|
||||
*/
|
||||
public int getManagedMapsCount() {
|
||||
return managedMaps.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap a {@link BufferedImage} in a {@link MapWrapper}
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue