Start work on Pl3xMap v2 hook (incomplete for now)

This commit is contained in:
William committed 2022-08-26 18:17:32 +01:00
1 parent 2c7453d9a9
commit 87af525e0a
5 files changed
+62 -3

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ allprojects {
mavenLocal()
mavenCentral()
maven { url 'https://libraries.minecraft.net/' }
maven { url 'https://api.modrinth.com/maven' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://repo.papermc.io/repository/maven-public/' }
maven { url 'https://repo.minebench.de/' }
+1
View File
@@ -15,6 +15,7 @@ dependencies {
compileOnly 'net.william278:DesertWell:1.0'
compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
compileOnly 'us.dynmap:dynmap-api:3.1'
compileOnly 'maven.modrinth:pl3xmap:1.19.2-217'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.117.1'
testImplementation 'de.themoep:minedown:1.7.1-SNAPSHOT'
@@ -0,0 +1,60 @@
package net.william278.huskhomes.hook;
import net.pl3x.map.api.Key;
import net.pl3x.map.api.Pl3xMap;
import net.william278.huskhomes.HuskHomes;
import net.william278.huskhomes.position.Home;
import net.william278.huskhomes.position.Warp;
import org.jetbrains.annotations.NotNull;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
/**
* Hook to display warps and public homes on <a href="https://github.com/BillyGalbreath/Pl3xMap">Pl3xMap v2</a> maps
*/
//todo Still a WIP, awaiting Pl3xMap v2 API!
public class Pl3xMapHook extends MapHook {
protected Pl3xMapHook(@NotNull HuskHomes implementor) {
super(implementor, "Pl3xMap v2");
}
@Override
protected CompletableFuture<Void> initializeMap() {
return CompletableFuture.runAsync(() -> {
try {
Pl3xMap.api().getIconRegistry().register(new Key(PUBLIC_HOME_MARKER_IMAGE_NAME), ImageIO.read
(Objects.requireNonNull(plugin.getResource("markers/16x/" + PUBLIC_HOME_MARKER_IMAGE_NAME + ".png"))));
Pl3xMap.api().getIconRegistry().register(new Key(PUBLIC_HOME_MARKER_IMAGE_NAME), ImageIO.read
(Objects.requireNonNull(plugin.getResource("markers/16x/" + WARP_MARKER_IMAGE_NAME + ".png"))));
} catch (IOException e) {
plugin.getLoggingAdapter().log(Level.SEVERE, "Failed to load marker image resources", e);
}
});
}
@Override
public CompletableFuture<Void> updateHome(@NotNull Home home) {
return CompletableFuture.completedFuture(null);
}
@Override
public CompletableFuture<Void> removeHome(@NotNull Home home) {
return CompletableFuture.completedFuture(null);
}
@Override
public CompletableFuture<Void> updateWarp(@NotNull Warp warp) {
return CompletableFuture.completedFuture(null);
}
@Override
public CompletableFuture<Void> removeWarp(@NotNull Warp warp) {
return CompletableFuture.completedFuture(null);
}
}
-1
View File
@@ -15,7 +15,6 @@ dependencies {
compileOnly 'org.xerial:sqlite-jdbc:' + sqlite_driver_version
compileOnly 'mysql:mysql-connector-java:' + mysql_driver_version
compileOnly 'org.apache.commons:commons-text:' + commons_text_version
compileOnly 'com.github.BlueMap-Minecraft:BlueMapAPI:v2.1.0'
testImplementation 'com.github.yuriy-g:simple-java-plot:5c502c2e98'
@@ -338,8 +338,6 @@ public class Settings {
*/
public enum MappingPlugin {
DYNMAP,
SQUAREMAP,
PL3XMAP,
BLUEMAP
}