diff --git a/src/main/java/us/camin/regions/Pl3xMapRelay.java b/src/main/java/us/camin/regions/Pl3xMapRelay.java index 83ce267..02b67e9 100644 --- a/src/main/java/us/camin/regions/Pl3xMapRelay.java +++ b/src/main/java/us/camin/regions/Pl3xMapRelay.java @@ -33,6 +33,10 @@ import net.pl3x.map.api.marker.Icon; import java.util.ArrayList; import java.util.Collection; import java.util.Optional; +import java.io.File; +import java.awt.image.BufferedImage; +import javax.imageio.ImageIO; +import java.io.IOException; import org.bukkit.World; import org.bukkit.Color; @@ -53,6 +57,20 @@ public class Pl3xMapRelay implements Listener { } if (isEnabled()) { + + File file = new File(m_plugin.getDataFolder(), "lantern.png"); + if (!file.exists()) { + m_plugin.saveResource("lantern.png", false); + } + + Key key = Key.of("lantern"); + try { + BufferedImage image = ImageIO.read(file); + Pl3xMapProvider.get().iconRegistry().register(key, image); + } catch (IOException e) { + //Logger.log().log(Level.WARNING, "Failed to register signs icon", e); + } + for(World world : m_plugin.getServer().getWorlds()) { Optional opt = m_map.getWorldIfEnabled(world); opt.ifPresent((MapWorld mapWorld) -> { @@ -95,28 +113,25 @@ public class Pl3xMapRelay implements Listener { int size = 32; String clickTooltip = "

" + region.name() + "

"; clickTooltip += ""; - marker = Marker.circle(point, size); + Key imageKey = Key.of("lantern"); + Marker marker = Marker.icon(point, imageKey, size); marker.markerOptions(MarkerOptions.builder() .hoverTooltip(region.name()) - .clickTooltip(clickTooltip) - .strokeColor(awtColor) - .strokeOpacity(0.8)); + .clickTooltip(clickTooltip)); markers.add(marker); } diff --git a/src/main/resources/lantern.png b/src/main/resources/lantern.png new file mode 100644 index 0000000..56c4a90 Binary files /dev/null and b/src/main/resources/lantern.png differ