diff --git a/DynmapCore/build.gradle b/DynmapCore/build.gradle index c9876c62..d946d023 100644 --- a/DynmapCore/build.gradle +++ b/DynmapCore/build.gradle @@ -3,8 +3,8 @@ description = "DynmapCore" dependencies { compile project(path: ':DynmapCoreAPI', configuration: 'shadow') compile 'javax.servlet:javax.servlet-api:3.1' - compile 'org.eclipse.jetty:jetty-server:9.4.24.v20191120' - compile 'org.eclipse.jetty:jetty-servlet:9.4.24.v20191120' + compile 'org.eclipse.jetty:jetty-server:9.4.26.v20200117' + compile 'org.eclipse.jetty:jetty-servlet:9.4.26.v20200117' compile 'com.googlecode.json-simple:json-simple:1.1.1' compile 'org.yaml:snakeyaml:1.23' compile 'com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20180219.1' diff --git a/DynmapCore/src/main/java/org/dynmap/DynmapCore.java b/DynmapCore/src/main/java/org/dynmap/DynmapCore.java index c775f13e..1cd166a3 100644 --- a/DynmapCore/src/main/java/org/dynmap/DynmapCore.java +++ b/DynmapCore/src/main/java/org/dynmap/DynmapCore.java @@ -49,10 +49,7 @@ import org.dynmap.markers.MarkerAPI; import org.dynmap.markers.impl.MarkerAPIImpl; import org.dynmap.modsupport.ModSupportImpl; import org.dynmap.renderer.DynmapBlockState; -import org.dynmap.servlet.FileResourceHandler; -import org.dynmap.servlet.JettyNullLogger; -import org.dynmap.servlet.LoginServlet; -import org.dynmap.servlet.MapStorageResourceHandler; +import org.dynmap.servlet.*; import org.dynmap.storage.MapStorage; import org.dynmap.storage.filetree.FileTreeMapStorage; import org.dynmap.storage.mysql.MySQLMapStorage; @@ -843,12 +840,15 @@ public class DynmapCore implements DynmapCommonAPI { filters.add(new CustomHeaderFilter(configuration.getNode("http-response-headers"))); FilterHandler fh = new FilterHandler(router, filters); + ContextHandler contextHandler = new ContextHandler(); + contextHandler.setContextPath("/"); + contextHandler.setHandler(fh); HandlerList hlist = new HandlerList(); - hlist.setHandlers(new org.eclipse.jetty.server.Handler[] { new SessionHandler(), fh }); + hlist.setHandlers(new org.eclipse.jetty.server.Handler[] { new SessionHandler(), contextHandler }); webServer.setHandler(hlist); - addServlet("/up/configuration", new org.dynmap.servlet.ClientConfigurationServlet(this)); - addServlet("/standalone/config.js", new org.dynmap.servlet.ConfigJSServlet(this)); + addServlet("/up/configuration", new ClientConfigurationServlet(this)); + addServlet("/standalone/config.js", new ConfigJSServlet(this)); if(authmgr != null) { LoginServlet login = new LoginServlet(this); addServlet("/up/login", login); diff --git a/DynmapCore/src/main/java/org/dynmap/MarkersComponent.java b/DynmapCore/src/main/java/org/dynmap/MarkersComponent.java index c48772c7..8c88ce59 100644 --- a/DynmapCore/src/main/java/org/dynmap/MarkersComponent.java +++ b/DynmapCore/src/main/java/org/dynmap/MarkersComponent.java @@ -25,6 +25,7 @@ public class MarkersComponent extends ClientComponent { private MarkerSignManager signmgr; private MarkerIcon spawnicon; private String spawnlbl; + private String worldborderlbl; private MarkerSet offlineset; private MarkerIcon offlineicon; private MarkerSet spawnbedset; @@ -57,6 +58,9 @@ public class MarkersComponent extends ClientComponent { spawnicon = api.getMarkerIcon(MarkerIcon.WORLD); } } + if (showBorder) { + worldborderlbl = configuration.getString("worldborderlabel", "Border"); + } if (showSpawn || showBorder) { /* Add listener for world loads */ WorldEventListener wel = new WorldEventListener() { @@ -280,7 +284,7 @@ public class MarkersComponent extends ClientComponent { } } if (am == null) { - am = ms.createAreaMarker(borderid, "Border", false, w.getName(), x, z, false); + am = ms.createAreaMarker(borderid, worldborderlbl, false, w.getName(), x, z, false); } else { am.setCornerLocations(x, z); diff --git a/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css b/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css index 15846f46..3bdc79b3 100644 --- a/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css +++ b/DynmapCore/src/main/resources/extracted/web/css/dynmap_style.css @@ -887,22 +887,19 @@ } .dynmap .mapMarker .markerIcon16x16 { - margin-top: -8px; - margin-left: -8px; + transform: translate(-50%, -50%); width: 16px; height: 16px; } .dynmap .mapMarker .markerIcon8x8 { - margin-top: -4px; - margin-left: -4px; + transform: translate(-50%, -50%); width: 8px; height: 8px; } .dynmap .mapMarker .markerIcon32x32 { - margin-top: -16px; - margin-left: -16px; + transform: translate(-50%, -50%); width: 32px; height: 32px; } diff --git a/README.md b/README.md index 7762aa11..583f5ce8 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,6 @@ Dynmap supports the following storage backends: - SQLite - MySQL - PostgreSQL: EXPERIMENTAL + +# Where to go for questions and discussions +I've just created a Reddit for the Dynmap family of mods/plugins - please give it a try - https://www.reddit.com/r/Dynmap/ diff --git a/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperCB.java b/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperCB.java index 1bbce289..c2697cfe 100644 --- a/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperCB.java +++ b/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperCB.java @@ -60,9 +60,14 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric { Server srv = Bukkit.getServer(); /* Get getHandle() method */ try { - Method m = srv.getClass().getMethod("getHandle"); - Object scm = m.invoke(srv); /* And use it to get SCM (nms object) */ - return scm.getClass().getPackage().getName(); + try { + Class.forName("red.mohist.Mohist"); + return "net.minecraft.server.v1_12_R1"; + } catch (Exception x) { + Method m = srv.getClass().getMethod("getHandle"); + Object scm = m.invoke(srv); /* And use it to get SCM (nms object) */ + return scm.getClass().getPackage().getName(); + } } catch (Exception x) { Log.severe("Error finding net.minecraft.server packages"); return null; @@ -72,7 +77,11 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric { protected void loadNMS() { // Get block fields nmsblock = getNMSClass("net.minecraft.server.Block"); - nmsblockarray = getNMSClass("[Lnet.minecraft.server.Block;"); + try { + nmsblockarray = getNMSClass("[Lnet.minecraft.block.Block;"); + } catch (Exception x) { + nmsblockarray = getNMSClass("[Lnet.minecraft.server.Block;"); + } nmsmaterial = getNMSClass("net.minecraft.server.Material"); if (isBlockIdNeeded()) { // Not needed for 1.13+ blockbyid = getFieldNoFail(nmsblock, new String[] { "byId" }, nmsblockarray); @@ -88,7 +97,11 @@ public class BukkitVersionHelperCB extends BukkitVersionHelperGeneric { /* Set up biomebase fields */ biomebase = getNMSClass("net.minecraft.server.BiomeBase"); - biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;"); + try { + biomebasearray = getNMSClass("[Lnet.minecraft.world.biome.Biome;"); + } catch (Exception x) { + biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;"); + } biomebaselist = getPrivateFieldNoFail(biomebase, new String[] { "biomes" }, biomebasearray); if ((biomebaselist == null) && isBiomeBaseListNeeded()) { getbiomefunc = getMethodNoFail(biomebase, new String[] { "getBiome" }, new Class[] { int.class, biomebase }); diff --git a/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperGeneric.java b/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperGeneric.java index 6ab74dbe..2949dc73 100644 --- a/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperGeneric.java +++ b/bukkit-helper/src/main/java/org/dynmap/bukkit/helper/BukkitVersionHelperGeneric.java @@ -132,7 +132,11 @@ public abstract class BukkitVersionHelperGeneric extends BukkitVersionHelper { cw_gethandle = getMethod(craftworld, new String[] { "getHandle" }, new Class[0]); /* CraftChunkSnapshot */ craftchunksnapshot = getOBCClass("org.bukkit.craftbukkit.CraftChunkSnapshot"); - biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;"); + try { + biomebasearray = getNMSClass("[Lnet.minecraft.world.biome.Biome;"); + } catch (Exception x) { + biomebasearray = getNMSClass("[Lnet.minecraft.server.BiomeBase;"); + } ccss_biome = getPrivateFieldNoFail(craftchunksnapshot, new String[] { "biome" }, biomebasearray); if(ccss_biome == null) { biomestorage = getNMSClass("net.minecraft.server.BiomeStorage"); diff --git a/forge-1.10.2/src/main/resources/configuration.txt b/forge-1.10.2/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.10.2/src/main/resources/configuration.txt +++ b/forge-1.10.2/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.10.2/src/main/resources/mcmod.info b/forge-1.10.2/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.10.2/src/main/resources/mcmod.info +++ b/forge-1.10.2/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/forge-1.11.2/src/main/resources/configuration.txt b/forge-1.11.2/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.11.2/src/main/resources/configuration.txt +++ b/forge-1.11.2/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.11.2/src/main/resources/mcmod.info b/forge-1.11.2/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.11.2/src/main/resources/mcmod.info +++ b/forge-1.11.2/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/forge-1.12.2/src/main/resources/configuration.txt b/forge-1.12.2/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.12.2/src/main/resources/configuration.txt +++ b/forge-1.12.2/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.12.2/src/main/resources/mcmod.info b/forge-1.12.2/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.12.2/src/main/resources/mcmod.info +++ b/forge-1.12.2/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/forge-1.13.2/src/main/resources/configuration.txt b/forge-1.13.2/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.13.2/src/main/resources/configuration.txt +++ b/forge-1.13.2/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.13.2/src/main/resources/mcmod.info b/forge-1.13.2/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.13.2/src/main/resources/mcmod.info +++ b/forge-1.13.2/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/forge-1.8.9/src/main/resources/configuration.txt b/forge-1.8.9/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.8.9/src/main/resources/configuration.txt +++ b/forge-1.8.9/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.8.9/src/main/resources/mcmod.info b/forge-1.8.9/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.8.9/src/main/resources/mcmod.info +++ b/forge-1.8.9/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/forge-1.9.4/src/main/resources/configuration.txt b/forge-1.9.4/src/main/resources/configuration.txt index d67e9baa..2d33f6db 100644 --- a/forge-1.9.4/src/main/resources/configuration.txt +++ b/forge-1.9.4/src/main/resources/configuration.txt @@ -127,6 +127,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) Show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/forge-1.9.4/src/main/resources/mcmod.info b/forge-1.9.4/src/main/resources/mcmod.info index e188b9ab..e7ce7144 100644 --- a/forge-1.9.4/src/main/resources/mcmod.info +++ b/forge-1.9.4/src/main/resources/mcmod.info @@ -5,7 +5,7 @@ "description": "Dynamic, Google Maps style web maps for Minecraft Servers", "version": "${version}", "mcversion": "${mcversion}", - "url": "https://forums.dynmap.us", + "url": "https://www.reddit.com/r/Dynmap/", "updateUrl": "", "authors": [ "mikeprimm" diff --git a/spigot/src/main/resources/configuration.txt b/spigot/src/main/resources/configuration.txt index 10aee57e..9de84ea6 100644 --- a/spigot/src/main/resources/configuration.txt +++ b/spigot/src/main/resources/configuration.txt @@ -128,6 +128,7 @@ components: spawnbedformat: "%name%'s bed" # (optional) show world border (vanilla 1.8+) showworldborder: true + worldborderlabel: "Border" - class: org.dynmap.ClientComponent type: chat diff --git a/spigot/src/main/resources/plugin.yml b/spigot/src/main/resources/plugin.yml index a1ef6a25..794dbdb7 100644 --- a/spigot/src/main/resources/plugin.yml +++ b/spigot/src/main/resources/plugin.yml @@ -2,7 +2,7 @@ name: dynmap main: org.dynmap.bukkit.DynmapPlugin version: "${version}-${buildnumber}" authors: [mikeprimm] -website: "https://forums.dynmap.us" +website: "https://www.reddit.com/r/Dynmap/" softdepend: [ Permissions, PermissionEx, bPermissions, PermissionsBukkit, GroupManager, LuckPerms ] commands: dynmap: