Merge pull request #3836 from JurgenKuyper/templateNotification

added notification on probable misconfiguration of deftemplatesuffix
This commit is contained in:
mikeprimm 2022-08-29 08:28:53 -05:00 committed by GitHub
commit 5aaff7cea9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -177,6 +177,8 @@ public class DynmapCore implements DynmapCommonAPI {
private Boolean webserverCompConfigWarn = false;
private final String CompConfigWiki = "https://github.com/webbukkit/dynmap/wiki/Component-Configuration";
private final String[] defaultTemplates = {"vlowres", "lowres", "medres", "hires", "low_boost_hi",
"hi_boost_vhi", "hi_boost_xhi"};
/* Constructor for core */
public DynmapCore() {
}
@ -2167,6 +2169,9 @@ public class DynmapCore implements DynmapCommonAPI {
ConfigurationNode getDefaultTemplateConfigurationNode(DynmapWorld world) {
String environmentName = world.getEnvironment();
if(deftemplatesuffix.length() > 0) {
if(!Arrays.asList(defaultTemplates).contains(deftemplatesuffix)) {
Log.warning("Not using a default defined template, worlds might not be accessible.");
}
environmentName += "-" + deftemplatesuffix;
}
Log.verboseinfo("Using environment as template: " + environmentName);