mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-24 16:41:42 +01:00
Merge branch 'v3.0' into postgres
This commit is contained in:
commit
3b09dba95f
@ -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'
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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/
|
||||
|
@ -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 });
|
||||
|
@ -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");
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user