Update to Version 0.4.4

Fixed new maps not working in 1.13, should break for anything older!
Removed Metrics
This commit is contained in:
SydMontague 2018-07-24 20:13:42 +02:00
parent c0feeb524c
commit d5b15b78bf
2 changed files with 16 additions and 42 deletions

37
pom.xml
View File

@ -3,49 +3,28 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.craftlancer.imagemaps</groupId>
<artifactId>ImageMaps</artifactId>
<version>0.4.3</version>
<version>0.4.4</version>
<name>ImageMaps</name>
<description>Draw Images on maps!</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<distributionManagement>
<repository>
<name>Craftlancer Releases</name>
<id>releases</id>
<url>http://repo.craftlancer.de/content/repositories/releases</url>
</repository>
<snapshotRepository>
<name>Craftlancer Snapshots</name>
<id>snapshots</id>
<url>http://repo.craftlancer.de/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>bukkit-repo</id>
<url>http://repo.bukkit.org/content/groups/public/</url>
</repository>
<repository>
<id>Plugin Metrics</id>
<url>http://repo.mcstats.org/content/repositories/public</url>
<id>spigot-repo</id>
<url>http://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.mcstats.bukkit</groupId>
<artifactId>metrics</artifactId>
<version>R8-SNAPSHOT</version>
<scope>compile</scope>
<version>1.13-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
@ -60,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>

View File

@ -25,10 +25,10 @@ import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.MapMeta;
import org.bukkit.map.MapRenderer;
import org.bukkit.map.MapView;
import org.bukkit.plugin.java.JavaPlugin;
import org.mcstats.Metrics;
public class ImageMaps extends JavaPlugin implements Listener {
public static final int MAP_WIDTH = 128;
@ -54,14 +54,6 @@ public class ImageMaps extends JavaPlugin implements Listener {
sendTask = new FastSendTask(this, mapsPerSend);
getServer().getPluginManager().registerEvents(sendTask, this);
sendTask.runTaskTimer(this, sendPerTicks, sendPerTicks);
try {
Metrics metrics = new Metrics(this);
metrics.start();
}
catch (IOException e) {
getLogger().severe("Failed to load Metrics!");
}
}
@Override
@ -180,19 +172,22 @@ public class ImageMaps extends JavaPlugin implements Listener {
private ItemStack getMapItem(String file, int x, int y, BufferedImage image) {
ItemStack item = new ItemStack(Material.MAP);
for (Entry<Short, ImageMap> entry : maps.entrySet())
for (Entry<Short, ImageMap> entry : maps.entrySet()) {
if (entry.getValue().isSimilar(file, x, y)) {
item.setDurability(entry.getKey());
MapMeta meta = (MapMeta) item.getItemMeta();
meta.setMapId(entry.getKey());
item.setItemMeta(meta);
return item;
}
}
MapView map = getServer().createMap(getServer().getWorlds().get(0));
for (MapRenderer r : map.getRenderers())
map.removeRenderer(r);
map.addRenderer(new ImageMapRenderer(image, x, y));
item.setDurability(map.getId());
((MapMeta) item.getItemMeta()).setMapId(map.getId());
return item;
}