diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 439cc537..8021d1cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 - - uses: actions/cache@v2 + - uses: actions/cache@v3 with: path: | ~/.gradle/caches diff --git a/BlueMapAPI b/BlueMapAPI index 85e3763d..40140f87 160000 --- a/BlueMapAPI +++ b/BlueMapAPI @@ -1 +1 @@ -Subproject commit 85e3763d7aa69e0b1796a5dd8123f19cc6d25244 +Subproject commit 40140f87c672792f3b39076986c2643d83eda1ec diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java index 5c14882d..466fd177 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java @@ -143,7 +143,7 @@ public void updateFiles() throws IOException { } } - @SuppressWarnings("all") + @SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal", "unused", "MismatchedQueryAndUpdateOfCollection"}) private static class Settings { private String version = BlueMap.VERSION; @@ -151,6 +151,7 @@ private static class Settings { private boolean useCookies = true; private boolean enableFreeFlight = true; + private boolean defaultToFlatView = false; private String startLocation = null; @@ -174,6 +175,7 @@ private static class Settings { public void setFrom(WebappConfig config) { this.useCookies = config.isUseCookies(); this.enableFreeFlight = config.isEnableFreeFlight(); + this.defaultToFlatView = config.isDefaultToFlatView(); this.startLocation = config.getStartLocation().orElse(null); this.resolutionDefault = config.getResolutionDefault(); diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/PluginImpl.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/PluginImpl.java index f86c6356..0ba48784 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/PluginImpl.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/api/PluginImpl.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.api; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigs.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigs.java index ad3f640d..cb3db340 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigs.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/BlueMapConfigs.java @@ -65,7 +65,7 @@ public BlueMapConfigs(ServerInterface serverInterface, Path defaultDataFolder, P this.coreConfig = loadCoreConfig(defaultDataFolder); this.webappConfig = loadWebappConfig(defaultWebroot); - this.webserverConfig = loadWebserverConfig(webappConfig.getWebroot()); + this.webserverConfig = loadWebserverConfig(webappConfig.getWebroot(), coreConfig.getData()); this.pluginConfig = usePluginConf ? loadPluginConfig() : new PluginConfig(); this.storageConfigs = Collections.unmodifiableMap(loadStorageConfigs(webappConfig.getWebroot())); this.mapConfigs = Collections.unmodifiableMap(loadMapConfigs()); @@ -133,6 +133,8 @@ private synchronized CoreConfig loadCoreConfig(Path defaultDataFolder) throws Co .setVariable("data", formatPath(defaultDataFolder)) .setVariable("implementation", "bukkit") .setVariable("render-thread-count", Integer.toString(presetRenderThreadCount)) + .setVariable("logfile", formatPath(defaultDataFolder.resolve("logs").resolve("debug.log"))) + .setVariable("logfile-with-time", formatPath(defaultDataFolder.resolve("logs").resolve("debug_%1$tF_%1$tT.log"))) .build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); @@ -144,7 +146,7 @@ private synchronized CoreConfig loadCoreConfig(Path defaultDataFolder) throws Co return configManager.loadConfig(configFileRaw, CoreConfig.class); } - private synchronized WebserverConfig loadWebserverConfig(Path defaultWebroot) throws ConfigurationException { + private synchronized WebserverConfig loadWebserverConfig(Path defaultWebroot, Path dataRoot) throws ConfigurationException { Path configFileRaw = Path.of("webserver"); Path configFile = configManager.findConfigPath(configFileRaw); Path configFolder = configFile.getParent(); @@ -156,6 +158,8 @@ private synchronized WebserverConfig loadWebserverConfig(Path defaultWebroot) th configFolder.resolve("webserver.conf"), configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/webserver.conf") .setVariable("webroot", formatPath(defaultWebroot)) + .setVariable("logfile", formatPath(dataRoot.resolve("logs").resolve("webserver.log"))) + .setVariable("logfile-with-time", formatPath(dataRoot.resolve("logs").resolve("webserver_%1$tF_%1$tT.log"))) .build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/CoreConfig.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/CoreConfig.java index 6225b780..810e27e4 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/CoreConfig.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/CoreConfig.java @@ -44,6 +44,8 @@ public class CoreConfig { private boolean scanForModResources = true; + private LogConfig log = new LogConfig(); + public boolean isAcceptDownload() { return acceptDownload; } @@ -69,4 +71,25 @@ public boolean isScanForModResources() { return scanForModResources; } + public LogConfig getLog() { + return log; + } + + @DebugDump + @ConfigSerializable + public static class LogConfig { + + private String file = null; + private boolean append = false; + + public String getFile() { + return file; + } + + public boolean isAppend() { + return append; + } + + } + } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebappConfig.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebappConfig.java index a690e1b5..e366da11 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebappConfig.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebappConfig.java @@ -45,6 +45,7 @@ public class WebappConfig { private boolean useCookies = true; private boolean enableFreeFlight = true; + private boolean defaultToFlatView = false; private String startLocation = null; @@ -83,6 +84,10 @@ public boolean isEnableFreeFlight() { return enableFreeFlight; } + public boolean isDefaultToFlatView() { + return defaultToFlatView; + } + public Optional getStartLocation() { return Optional.ofNullable(startLocation); } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebserverConfig.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebserverConfig.java index 20631ca3..63a43d20 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebserverConfig.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/WebserverConfig.java @@ -38,13 +38,13 @@ public class WebserverConfig { private boolean enabled = true; - private Path webroot = Path.of("bluemap", "web"); private String ip = "0.0.0.0"; - private int port = 8100; + private LogConfig log = new LogConfig(); + public boolean isEnabled() { return enabled; } @@ -71,4 +71,30 @@ public int getPort() { return port; } + public LogConfig getLog() { + return log; + } + + @DebugDump + @ConfigSerializable + public static class LogConfig { + + private String file = null; + private boolean append = false; + private String format = "%1$s \"%3$s %4$s %5$s\" %6$s %7$s"; + + public String getFile() { + return file; + } + + public boolean isAppend() { + return append; + } + + public String getFormat() { + return format; + } + + } + } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java index 442f7bc6..411ad4c8 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/Plugin.java @@ -59,6 +59,9 @@ import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.file.Path; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.function.Predicate; @@ -70,6 +73,8 @@ public class Plugin implements ServerEventListener { public static final String PLUGIN_ID = "bluemap"; public static final String PLUGIN_NAME = "BlueMap"; + private static final String DEBUG_FILE_LOG_NAME = "file-debug-log"; + private final InterruptableReentrantLock loadingLock = new InterruptableReentrantLock(); private final String implementationType; @@ -84,6 +89,7 @@ public class Plugin implements ServerEventListener { private RenderManager renderManager; private HttpServer webServer; + private Logger webLogger; private BlueMapAPIImpl api; @@ -121,6 +127,17 @@ private void load(@Nullable ResourcePack preloadedResourcePack) throws IOExcepti WebappConfig webappConfig = getConfigs().getWebappConfig(); PluginConfig pluginConfig = getConfigs().getPluginConfig(); + //apply new file-logger config + if (coreConfig.getLog().getFile() != null) { + ZonedDateTime zdt = ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault()); + Logger.global.put(DEBUG_FILE_LOG_NAME, () -> Logger.file( + Path.of(String.format(coreConfig.getLog().getFile(), zdt)), + coreConfig.getLog().isAppend() + )); + } else { + Logger.global.remove(DEBUG_FILE_LOG_NAME); + } + //load plugin state try { GsonConfigurationLoader loader = GsonConfigurationLoader.builder() @@ -185,8 +202,23 @@ private void load(@Nullable ResourcePack preloadedResourcePack) throws IOExcepti ); } + // create web-logger + List webLoggerList = new ArrayList<>(); + if (webserverConfig.getLog().getFile() != null) { + ZonedDateTime zdt = ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault()); + webLoggerList.add(Logger.file( + Path.of(String.format(webserverConfig.getLog().getFile(), zdt)), + webserverConfig.getLog().isAppend() + )); + } + webLogger = Logger.combine(webLoggerList); + try { - webServer = new HttpServer(routingRequestHandler); + webServer = new HttpServer(new LoggingRequestHandler( + routingRequestHandler, + webserverConfig.getLog().getFormat(), + webLogger + )); webServer.bind(new InetSocketAddress( webserverConfig.resolveIp(), webserverConfig.getPort() @@ -229,8 +261,8 @@ private void load(@Nullable ResourcePack preloadedResourcePack) throws IOExcepti blueMap.createOrUpdateWebApp(false); //start skin updater + this.skinUpdater = new PlayerSkinUpdater(this); if (pluginConfig.isLivePlayerMarkers()) { - this.skinUpdater = new PlayerSkinUpdater(this); serverInterface.registerListener(skinUpdater); } @@ -392,6 +424,15 @@ public void unload(boolean keepWebserver) { webServer = null; } + if (webLogger != null) { + try { + webLogger.close(); + } catch (Exception ex) { + Logger.global.logError("Failed to close the webserver-logger!", ex); + } + webLogger = null; + } + //close bluemap if (blueMap != null) { try { @@ -402,6 +443,9 @@ public void unload(boolean keepWebserver) { } blueMap = null; + // remove file-logger + Logger.global.remove(DEBUG_FILE_LOG_NAME); + //clear resources worlds = null; maps = null; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java index fddba475..036fbacf 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/commands/Commands.java @@ -205,6 +205,7 @@ public void init() { .executes(this::storagesInfoCommand) .then(literal("delete") + .requires(requirements("bluemap.delete")) .then(argument("map", StringArgumentType.string()) .executes(this::storagesDeleteMapCommand)))) diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/DefaultPlayerIconFactory.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/DefaultPlayerIconFactory.java index 4839566f..1f49e6d2 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/DefaultPlayerIconFactory.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/DefaultPlayerIconFactory.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.plugin.skins; import de.bluecolored.bluemap.api.plugin.PlayerIconFactory; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/MojangSkinProvider.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/MojangSkinProvider.java index abf178dc..09e2c3b0 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/MojangSkinProvider.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/MojangSkinProvider.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.plugin.skins; import com.google.gson.JsonArray; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/CachedRateLimitDataSupplier.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/CachedRateLimitDataSupplier.java index 51ae8d63..d14e0798 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/CachedRateLimitDataSupplier.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/CachedRateLimitDataSupplier.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web; import java.util.concurrent.locks.ReentrantLock; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/LoggingRequestHandler.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/LoggingRequestHandler.java index aea4f645..06692347 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/LoggingRequestHandler.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/LoggingRequestHandler.java @@ -1,41 +1,98 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web; -import de.bluecolored.bluemap.common.web.http.HttpRequest; -import de.bluecolored.bluemap.common.web.http.HttpRequestHandler; -import de.bluecolored.bluemap.common.web.http.HttpResponse; +import de.bluecolored.bluemap.common.web.http.*; import de.bluecolored.bluemap.core.logger.Logger; public class LoggingRequestHandler implements HttpRequestHandler { private final HttpRequestHandler delegate; private final Logger logger; + private final String format; public LoggingRequestHandler(HttpRequestHandler delegate) { this(delegate, Logger.global); } public LoggingRequestHandler(HttpRequestHandler delegate, Logger logger) { + this(delegate, "", logger); + } + + public LoggingRequestHandler(HttpRequestHandler delegate, String format) { + this(delegate, format, Logger.global); + } + + public LoggingRequestHandler(HttpRequestHandler delegate, String format, Logger logger) { this.delegate = delegate; + this.format = format; this.logger = logger; } @Override public HttpResponse handle(HttpRequest request) { - String log = request.getSource() + " \"" - + request.getMethod() - + " " + request.getAddress() - + " " + request.getVersion() - + "\" "; + // gather format parameters from request + String source = request.getSource().toString(); + String xffSource = source; + HttpHeader xffHeader = request.getHeader("X-Forwarded-For"); + if (xffHeader != null && !xffHeader.getValues().isEmpty()) { + xffSource = xffHeader.getValues().get(0); + } + + String method = request.getMethod(); + String address = request.getAddress(); + String version = request.getVersion(); + + // run request HttpResponse response = delegate.handle(request); - log += response.getStatusCode().toString(); - if (response.getStatusCode().getCode() < 400) { + // gather format parameters from response + HttpStatusCode status = response.getStatusCode(); + int statusCode = status.getCode(); + String statusMessage = status.getMessage(); + + // format log message + String log = String.format(this.format, + source, + xffSource, + method, + address, + version, + statusCode, + statusMessage + ); + + // do the logging + if (statusCode < 500) { logger.logInfo(log); } else { logger.logWarning(log); } + // return the response return response; } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/MapRequestHandler.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/MapRequestHandler.java index e8af524d..bc9e5160 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/MapRequestHandler.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/MapRequestHandler.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web; import de.bluecolored.bluemap.common.config.PluginConfig; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpConnection.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpConnection.java index 3ad879b0..233cc7f6 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpConnection.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpConnection.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpHeader.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpHeader.java index b04c80c6..557bea7a 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpHeader.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpHeader.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import java.util.*; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpRequest.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpRequest.java index 32221c16..2584e649 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpRequest.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpRequest.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import java.io.ByteArrayInputStream; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpServer.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpServer.java index d6b1c115..ca93d31f 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpServer.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/HttpServer.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import java.io.IOException; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/SelectionConsumer.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/SelectionConsumer.java index af09c95e..e8da4981 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/SelectionConsumer.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/SelectionConsumer.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import java.nio.channels.SelectionKey; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/Server.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/Server.java index c7adfb13..27cbf1b2 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/Server.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/http/Server.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.common.web.http; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf index bc9e5f0c..b7605fa2 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf @@ -32,4 +32,17 @@ ${metrics<< # An example report looks like this: {"implementation":"${implementation}","version":"${version}"} # Default is true metrics: true ->>} \ No newline at end of file +>>} +# Config-section for debug-logging +log: { + # The file where the debug-log will be written to. + # Comment out to disable debug-logging completely. + # Java String formatting syntax can be used to add time, see: https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html + # Default is no logging + file: "${logfile}" + #file: "${logfile-with-time}" + + # Whether the logger should append to an existing file, or overwrite it + # Default is false + append: false +} diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf index b65e7c4c..39d0a820 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf @@ -65,8 +65,8 @@ skin-download: true # Default is -1 player-render-limit: -1 -# The interval in minutes in which a map-update will be triggered. -# This is additionally to the normal map-update process (in case that fails to detect any file-changes). +# The interval in minutes in which a full map-update will be triggered. +# This is ADDITIONALLY to the normal map-update process (in case that fails to detect any file-changes). # ! This DOESN'T re-render the entire map each time, it only checks if there are some changes that have not been rendered yet! # Default is 1440 (24 hours) -map-update-interval: 1440 +full-update-interval: 1440 diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf index 3a04bf09..b14763ff 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf @@ -26,6 +26,10 @@ use-cookies: true # Default is true enable-free-flight: true +# If the webapp will default to flat-view instead of perspective-view. +# Default is false +default-to-flat-view: false + # The default map and camera-location where a user will start after opening the webapp. # This is in form of the url-anchor: Open your map in a browser and look at the url, everything after the '#' is the value for this setting. # Default is "no anchor" -> The camera will start with the topmost map and at that map's starting point. diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf index 5332e952..0c580328 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf @@ -16,3 +16,30 @@ webroot: "${webroot}" # The port that the webserver listens to. # Default is 8100 port: 8100 + +# Config-section for webserver-activity logging +log: { + # The file where all the webserver-activity will be logged to. + # Comment out to disable the logging completely. + # Java String formatting syntax can be used to add time, see: https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html + # Default is no logging + file: "${logfile}" + #file: "${logfile-with-time}" + + # Whether the logger should append to an existing file, or overwrite it + # Default is false + append: false + + # The format of the webserver-acivity logs. + # The syntax is the java String formatting, see: https://docs.oracle.com/javase/8/docs/api/java/util/Formatter.html + # Possible Arguments: + # 1 - the source address (ignoring any xff headers) + # 2 - the source address (using the (leftmost) xff header if provided) + # 3 - the http-method of the request + # 4 - the full request-address + # 5 - the protocol version of the request + # 6 - the status-code of the response + # 7 - the status-message of the response + # Default is "%1$s \"%3$s %4$s %5$s\" %6$s %7$s" + format: "%1$s \"%3$s %4$s %5$s\" %6$s %7$s" +} diff --git a/BlueMapCommon/webapp/src/js/BlueMapApp.js b/BlueMapCommon/webapp/src/js/BlueMapApp.js index 75b233d9..dc836b63 100644 --- a/BlueMapCommon/webapp/src/js/BlueMapApp.js +++ b/BlueMapCommon/webapp/src/js/BlueMapApp.js @@ -60,6 +60,7 @@ export class BlueMapApp { * version: string, * useCookies: boolean, * enableFreeFlight: boolean, + * defaultToFlatView: boolean, * resolutionDefault: number, * minZoomDistance: number, * maxZoomDistance: number, @@ -280,6 +281,10 @@ export class BlueMapApp { controls.controls = this.mapControls; this.appState.controls.state = "perspective"; + if (this.settings.defaultToFlatView) { + this.setFlatView(); + } + this.updatePageAddress(); } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/JavaLogger.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/JavaLogger.java new file mode 100644 index 00000000..4671dce2 --- /dev/null +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/JavaLogger.java @@ -0,0 +1,75 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.core.logger; + +import java.util.logging.Handler; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class JavaLogger extends AbstractLogger { + + private final Logger out; + + public JavaLogger(Logger out) { + this.out = out; + } + + @Override + public void logError(String message, Throwable throwable) { + out.log(Level.SEVERE, message, throwable); + } + + @Override + public void logWarning(String message) { + out.log(Level.WARNING, message); + } + + @Override + public void logInfo(String message) { + out.log(Level.INFO, message); + } + + @Override + public void logDebug(String message) { + if (out.isLoggable(Level.FINE)) out.log(Level.FINE, message); + } + + @Override + public void noFloodDebug(String message) { + if (out.isLoggable(Level.FINE)) super.noFloodDebug(message); + } + + @Override + public void noFloodDebug(String key, String message) { + if (out.isLoggable(Level.FINE)) super.noFloodDebug(key, message); + } + + @Override + public void close() throws Exception { + for (Handler handler : out.getHandlers()) + handler.close(); + } + +} diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LogFormatter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LogFormatter.java new file mode 100644 index 00000000..f0e8f8a9 --- /dev/null +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LogFormatter.java @@ -0,0 +1,82 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.core.logger; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.logging.Formatter; +import java.util.logging.LogRecord; + +public class LogFormatter extends Formatter { + + private final String format; + + public LogFormatter() { + this("[%1$tF %1$tT][%4$s] %5$s%6$s%n"); + } + + public LogFormatter(String format) { + this.format = format; + } + + /** + * Taken from {@link java.util.logging.SimpleFormatter} to be able to overwrite the format string. + * @param record the log record to be formatted. + * @return the formatted log + */ + public String format(LogRecord record) { + ZonedDateTime zdt = ZonedDateTime.ofInstant( + record.getInstant(), ZoneId.systemDefault()); + String source; + if (record.getSourceClassName() != null) { + source = record.getSourceClassName(); + if (record.getSourceMethodName() != null) { + source += " " + record.getSourceMethodName(); + } + } else { + source = record.getLoggerName(); + } + String message = formatMessage(record); + String throwable = ""; + if (record.getThrown() != null) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + pw.println(); + record.getThrown().printStackTrace(pw); + pw.close(); + throwable = sw.toString(); + } + return String.format(format, + zdt, + source, + record.getLoggerName(), + record.getLevel().getLocalizedName(), + message, + throwable); + } + +} diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/Logger.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/Logger.java index 1bc457b0..cd165778 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/Logger.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/Logger.java @@ -24,9 +24,26 @@ */ package de.bluecolored.bluemap.core.logger; -public abstract class Logger { +import org.jetbrains.annotations.Nullable; - public static Logger global = stdOut(); +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.logging.FileHandler; +import java.util.logging.Level; +import java.util.stream.StreamSupport; + +public abstract class Logger implements AutoCloseable { + + @SuppressWarnings("StaticInitializerReferencesSubClass") + public static final MultiLogger global = new MultiLogger(stdOut()); + static { + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + try { + global.close(); + } catch (Exception ignore) {} + })); + } public void logError(Throwable throwable) { logError(throwable.getMessage(), throwable); @@ -95,6 +112,9 @@ public void noFloodDebug(String message){ noFloodDebug(message, message); } + @Override + public void close() throws Exception {} + public abstract void clearNoFloodLog(); public abstract void removeNoFloodKey(String key); @@ -103,8 +123,49 @@ public void removeNoFloodMessage(String message){ removeNoFloodKey(message); } - public static Logger stdOut(){ + public static Logger stdOut() { return new PrintStreamLogger(System.out, System.err); } + public static Logger stdOut(boolean debug){ + return new PrintStreamLogger(System.out, System.err, debug); + } + + public static Logger file(Path path) throws IOException { + return file(path, null); + } + + public static Logger file(Path path, boolean append) throws IOException { + return file(path, null, append); + } + + public static Logger file(Path path, String format) throws IOException { + return file(path, format, true); + } + + public static Logger file(Path path, @Nullable String format, boolean append) throws IOException { + Files.createDirectories(path.getParent()); + + FileHandler fileHandler = new FileHandler(path.toString(), append); + fileHandler.setFormatter(format == null ? new LogFormatter() : new LogFormatter(format)); + + java.util.logging.Logger javaLogger = java.util.logging.Logger.getAnonymousLogger(); + javaLogger.setLevel(Level.ALL); + javaLogger.setUseParentHandlers(false); + javaLogger.addHandler(fileHandler); + + return new JavaLogger(javaLogger); + } + + public static Logger combine(Iterable logger) { + return combine(StreamSupport.stream(logger.spliterator(), false) + .toArray(Logger[]::new)); + } + + public static Logger combine(Logger... logger) { + if (logger.length == 0) return new VoidLogger(); + if (logger.length == 1) return logger[0]; + return new MultiLogger(logger); + } + } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LoggerLogger.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LoggerLogger.java deleted file mode 100644 index 41744fc7..00000000 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/LoggerLogger.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of BlueMap, licensed under the MIT License (MIT). - * - * Copyright (c) Blue (Lukas Rieger) - * Copyright (c) contributors - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -package de.bluecolored.bluemap.core.logger; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; - -import java.io.File; -import java.io.IOException; -import java.util.logging.Logger; -import java.util.logging.*; - -public class LoggerLogger extends AbstractLogger { - private static LoggerLogger instance = null; - - private Logger logger; - private SimpleFormatter formatter; - - private LoggerLogger() { - this.logger = Logger.getLogger("bluemap"); - this.logger.setUseParentHandlers(false); - ConsoleHandler cHandler = new ConsoleHandler(); - formatter = new SimpleFormatter() { - @Override - public synchronized String format(LogRecord record) { - String stackTrace = record.getThrown() == null ? "" : ExceptionUtils.getStackTrace(record.getThrown()); - return String.format("[%1$s] %2$s%3$s%n", record.getLevel(), record.getMessage(), stackTrace); - } - }; - cHandler.setFormatter(formatter); - this.logger.addHandler(cHandler); - - } - - public static LoggerLogger getInstance() { - if (instance == null) { - instance = new LoggerLogger(); - } - return instance; - } - - public void addFileHandler(String filename, boolean append) { - try { - File file = new File(filename); - FileUtils.forceMkdirParent(file); - FileHandler fHandler = new FileHandler(filename, append); - fHandler.setFormatter(formatter); - this.logger.addHandler(fHandler); - } catch (IOException e) { - de.bluecolored.bluemap.core.logger.Logger.global.logError("Error while opening log file!", e); - } - } - - @Override - public void logError(String message, Throwable throwable) { - logger.log(Level.SEVERE, message, throwable); - } - - @Override - public void logWarning(String message) { - logger.log(Level.WARNING, message); - } - - @Override - public void logInfo(String message) { - logger.log(Level.INFO, message); - } - - @Override - public void logDebug(String message) { - logger.log(Level.FINE, message); - } - -} diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/MultiLogger.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/MultiLogger.java new file mode 100644 index 00000000..334f822a --- /dev/null +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/MultiLogger.java @@ -0,0 +1,147 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package de.bluecolored.bluemap.core.logger; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.ReentrantReadWriteLock; + +public class MultiLogger extends AbstractLogger { + + private static final AtomicInteger LOGGER_INDEX = new AtomicInteger(0); + + private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(); + private final Map logger; + + public MultiLogger(Logger... logger) { + this.logger = new HashMap<>(); + for (Logger l : logger) + put(l); + } + + public void put(Logger logger) { + put("anonymous-logger-" + LOGGER_INDEX.getAndIncrement(), () -> logger); + } + + public void put(String name, LoggerSupplier loggerSupplier) { + lock.writeLock().lock(); + try { + remove(name); //remove first so logger is closed + this.logger.put(name, loggerSupplier.get()); + } catch (Exception ex) { + logError("Failed to close Logger!", ex); + } finally { + lock.writeLock().unlock(); + } + } + + public void remove(String name) { + lock.writeLock().lock(); + try { + Logger removed = this.logger.remove(name); + if (removed != null) removed.close(); + } catch (Exception ex) { + logError("Failed to close Logger!", ex); + } finally { + lock.writeLock().unlock(); + } + } + + public void clear() { + lock.writeLock().lock(); + try { + String[] loggerNames = this.logger.keySet().toArray(String[]::new); + for (String name : loggerNames) + remove(name); + this.logger.clear(); + } finally { + lock.writeLock().unlock(); + } + } + + @Override + public void logError(String message, Throwable throwable) { + lock.readLock().lock(); + try { + for (Logger l : logger.values()) + l.logError(message, throwable); + } finally { + lock.readLock().unlock(); + } + } + + @Override + public void logWarning(String message) { + lock.readLock().lock(); + try { + for (Logger l : logger.values()) + l.logWarning(message); + } finally { + lock.readLock().unlock(); + } + } + + @Override + public void logInfo(String message) { + lock.readLock().lock(); + try { + for (Logger l : logger.values()) + l.logInfo(message); + } finally { + lock.readLock().unlock(); + } + } + + @Override + public void logDebug(String message) { + lock.readLock().lock(); + try { + for (Logger l : logger.values()) + l.logDebug(message); + } finally { + lock.readLock().unlock(); + } + } + + @Override + public void close() throws Exception { + lock.readLock().lock(); + try { + for (Logger l : logger.values()) + l.close(); + } finally { + lock.readLock().unlock(); + } + } + + @FunctionalInterface + public interface LoggerSupplier { + + Logger get() throws Exception; + + } + +} diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/PrintStreamLogger.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/PrintStreamLogger.java index 4151e9c6..06f29a25 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/PrintStreamLogger.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/logger/PrintStreamLogger.java @@ -25,17 +25,20 @@ package de.bluecolored.bluemap.core.logger; import java.io.PrintStream; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; public class PrintStreamLogger extends AbstractLogger { - private PrintStream out, err; + private final PrintStream out, err; boolean isDebug; public PrintStreamLogger(PrintStream out, PrintStream err) { this.out = out; this.err = err; - this.isDebug = true; + this.isDebug = false; } public PrintStreamLogger(PrintStream out, PrintStream err, boolean debug) { @@ -54,23 +57,23 @@ public void setDebug(boolean debug) { @Override public void logError(String message, Throwable throwable) { - err.println("[ERROR] " + message); + log(err, "ERROR", message); throwable.printStackTrace(err); } @Override public void logWarning(String message) { - out.println("[WARNING] " + message); + log(out, "WARNING", message); } @Override public void logInfo(String message) { - out.println("[INFO] " + message); + log(out, "INFO", message); } @Override public void logDebug(String message) { - if (isDebug) out.println("[DEBUG] " + message); + if (isDebug) log(out, "DEBUG", message); } @Override @@ -83,4 +86,9 @@ public void noFloodDebug(String message) { if (isDebug) super.noFloodDebug(message); } + private void log(PrintStream stream, String level, String message) { + ZonedDateTime zdt = ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault()); + stream.printf("[%1$tT %2$s] %3$s%n", zdt, level, message); + } + } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java index 57258e7c..2ef3a923 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/BmMap.java @@ -195,7 +195,7 @@ public synchronized void resetTextureGallery() { private void saveMapSettings() { try ( OutputStream out = storage.writeMeta(id, META_FILE_SETTINGS); - Writer writer = new OutputStreamWriter(out) + Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8) ) { ResourcesGson.addAdapter(new GsonBuilder()) .registerTypeAdapter(BmMap.class, new MapSettingsSerializer()) @@ -209,7 +209,7 @@ private void saveMapSettings() { public synchronized void saveMarkerState() { try ( OutputStream out = storage.writeMeta(id, META_FILE_MARKERS); - Writer writer = new OutputStreamWriter(out) + Writer writer = new OutputStreamWriter(out, StandardCharsets.UTF_8) ) { MarkerGson.INSTANCE.toJson(this.markerSets, writer); } catch (Exception ex) { diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/MapSettingsSerializer.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/MapSettingsSerializer.java index 7a551e2c..8e1780b1 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/MapSettingsSerializer.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/MapSettingsSerializer.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java index d487e2e2..f1e4426e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TextureGallery.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map; import com.google.gson.JsonIOException; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TileMetaConsumer.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TileMetaConsumer.java index 899ce191..0908a63f 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TileMetaConsumer.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/TileMetaConsumer.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map; import de.bluecolored.bluemap.core.util.math.Color; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresLayer.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresLayer.java index ce5ee995..f6296716 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresLayer.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresLayer.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map.lowres; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTile.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTile.java index 5315e5ee..6feea1bb 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTile.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTile.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map.lowres; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTileManager.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTileManager.java index 93944ceb..dbb01784 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTileManager.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/map/lowres/LowresTileManager.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.map.lowres; import de.bluecolored.bluemap.core.map.TileMetaConsumer; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/region/RegionType.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/region/RegionType.java index 29a409b8..63896faa 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/region/RegionType.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/mca/region/RegionType.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.mca.region; import de.bluecolored.bluemap.core.mca.MCAWorld; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/AbstractTypeAdapterFactory.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/AbstractTypeAdapterFactory.java index d9c5257b..e6203825 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/AbstractTypeAdapterFactory.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/AbstractTypeAdapterFactory.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/ResourcePath.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/ResourcePath.java index 08a5fdbe..a5db0970 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/ResourcePath.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/ResourcePath.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/AxisAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/AxisAdapter.java index abe6efdb..6bf5fe5b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/AxisAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/AxisAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.google.gson.TypeAdapter; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ColorAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ColorAdapter.java index 9f04740c..5676030d 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ColorAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ColorAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.google.gson.TypeAdapter; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/DirectionAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/DirectionAdapter.java index f96e47bb..b576da1d 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/DirectionAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/DirectionAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.google.gson.TypeAdapter; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/EnumMapInstanceCreator.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/EnumMapInstanceCreator.java index c5dce975..f8d7cd3c 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/EnumMapInstanceCreator.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/EnumMapInstanceCreator.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.google.gson.InstanceCreator; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ResourcesGson.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ResourcesGson.java index 9eb69293..36f2ee67 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ResourcesGson.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/ResourcesGson.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.*; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector2iAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector2iAdapter.java index e91242b6..e67325af 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector2iAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector2iAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3dAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3dAdapter.java index ba39ef61..6644198f 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3dAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3dAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.Vector3d; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3fAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3fAdapter.java index 24d2c7fe..3d445e44 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3fAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector3fAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.Vector3f; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4dAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4dAdapter.java index 81b7a992..71baba94 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4dAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4dAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.Vector4d; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4fAdapter.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4fAdapter.java index f1ffd9f2..e1c3b526 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4fAdapter.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/Vector4fAdapter.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.adapter; import com.flowpowered.math.vector.Vector4f; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/BiomeConfigEntry.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/BiomeConfigEntry.java index 81a1f72f..0b93d881 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/BiomeConfigEntry.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/BiomeConfigEntry.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.biome; import de.bluecolored.bluemap.core.util.math.Color; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiome.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiome.java index d9580e6b..2bfcdb0e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiome.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiome.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.biome.datapack; import de.bluecolored.bluemap.core.world.Biome; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiomeEffects.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiomeEffects.java index c4984a7b..9cf67379 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiomeEffects.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/biome/datapack/DpBiomeEffects.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.biome.datapack; import de.bluecolored.bluemap.core.util.math.Color; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/ResourcePack.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/ResourcePack.java index 220840a2..ab643059 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/ResourcePack.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/ResourcePack.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack; import com.github.benmanes.caffeine.cache.Caffeine; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/BlockModel.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/BlockModel.java index b3cf7dd3..23a3eba3 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/BlockModel.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/BlockModel.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockmodel; import de.bluecolored.bluemap.api.debug.DebugDump; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Element.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Element.java index 04e449d6..aa74e186 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Element.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Element.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockmodel; import com.flowpowered.math.vector.Vector3f; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Face.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Face.java index fe603527..b5956a8b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Face.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Face.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockmodel; import com.flowpowered.math.vector.Vector4f; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Rotation.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Rotation.java index ea956c55..fe3920d1 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Rotation.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/Rotation.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockmodel; import com.flowpowered.math.TrigMath; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/TextureVariable.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/TextureVariable.java index 2b6cf57f..914b59fd 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/TextureVariable.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockmodel/TextureVariable.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockmodel; import com.google.gson.TypeAdapter; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/BlockState.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/BlockState.java index 5b77c76e..2a83f470 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/BlockState.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/BlockState.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockstate; import de.bluecolored.bluemap.api.debug.DebugDump; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Multipart.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Multipart.java index b89ecbbc..bafa6829 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Multipart.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Multipart.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockstate; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variant.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variant.java index 8b8215c7..192cc914 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variant.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variant.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockstate; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/VariantSet.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/VariantSet.java index 51a2e37e..3275cbe5 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/VariantSet.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/VariantSet.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockstate; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variants.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variants.java index 8c449277..f301c48b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variants.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/blockstate/Variants.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.blockstate; import com.google.gson.Gson; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/Texture.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/Texture.java index ea495ad1..40b5f9f7 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/Texture.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/Texture.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.resources.resourcepack.texture; import de.bluecolored.bluemap.api.debug.DebugDump; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/MetaInfo.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/MetaInfo.java index 9481a73f..abc74b53 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/MetaInfo.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/MetaInfo.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage; import java.io.IOException; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/file/FileStorageSettings.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/file/FileStorageSettings.java index ac27313c..3a31c0c8 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/file/FileStorageSettings.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/file/FileStorageSettings.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.file; import de.bluecolored.bluemap.core.storage.Compression; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/MySQLStorage.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/MySQLStorage.java index 1f99693e..1afa3005 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/MySQLStorage.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/MySQLStorage.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql; import de.bluecolored.bluemap.core.storage.sql.dialect.MySQLDialect; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/PostgreSQLStorage.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/PostgreSQLStorage.java index 85825337..7ac45c94 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/PostgreSQLStorage.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/PostgreSQLStorage.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql; import com.flowpowered.math.vector.Vector2i; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLDriverException.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLDriverException.java index f642a03b..11e6bfa7 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLDriverException.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLDriverException.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql; public class SQLDriverException extends Exception { diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLStorageSettings.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLStorageSettings.java index 6a89f354..ac7bfc0c 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLStorageSettings.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLStorageSettings.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql; import de.bluecolored.bluemap.core.storage.Compression; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLiteStorage.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLiteStorage.java index 4c41217a..3bd9fe59 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLiteStorage.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/SQLiteStorage.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql; import de.bluecolored.bluemap.core.storage.sql.dialect.SqliteDialect; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/Dialect.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/Dialect.java index bf2b1c04..855b8fd4 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/Dialect.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/Dialect.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql.dialect; import org.intellij.lang.annotations.Language; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/DialectType.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/DialectType.java index d0394bdd..c2bed479 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/DialectType.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/DialectType.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql.dialect; import de.bluecolored.bluemap.core.storage.sql.*; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/MySQLDialect.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/MySQLDialect.java index bed99c34..7f5297a3 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/MySQLDialect.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/MySQLDialect.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql.dialect; import org.intellij.lang.annotations.Language; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/PostgresDialect.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/PostgresDialect.java index 0332ef8d..6b32380b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/PostgresDialect.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/PostgresDialect.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql.dialect; import org.intellij.lang.annotations.Language; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/SqliteDialect.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/SqliteDialect.java index 80157aa0..8d6199f1 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/SqliteDialect.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/storage/sql/dialect/SqliteDialect.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.storage.sql.dialect; import org.intellij.lang.annotations.Language; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/DeletingPathVisitor.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/DeletingPathVisitor.java index 555ae353..403f9b71 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/DeletingPathVisitor.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/DeletingPathVisitor.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import java.io.IOException; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/FileHelper.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/FileHelper.java index 56eab077..6217125a 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/FileHelper.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/FileHelper.java @@ -61,7 +61,11 @@ public static void move(Path from, Path to) throws IOException { } catch (IOException ex) { try { Files.move(from, to, StandardCopyOption.REPLACE_EXISTING); - } catch (FileNotFoundException | NoSuchFileException ignore) {} + } catch (FileNotFoundException | NoSuchFileException ignore) { + } catch (Throwable t) { + t.addSuppressed(ex); + throw t; + } } } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/InstancePool.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/InstancePool.java index e976ba15..b29b652b 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/InstancePool.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/InstancePool.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import java.util.concurrent.ConcurrentLinkedQueue; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/IntComparator.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/IntComparator.java index 17833117..771f38a7 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/IntComparator.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/IntComparator.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import java.util.Comparator; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java index 6704ebfc..9be2d1ec 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Key.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import de.bluecolored.bluemap.api.debug.DebugDump; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/MergeSort.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/MergeSort.java index cef063f4..6bec1539 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/MergeSort.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/MergeSort.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; public class MergeSort { diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/SizeCollectingPathVisitor.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/SizeCollectingPathVisitor.java index 3f470b5c..aa9a6bbe 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/SizeCollectingPathVisitor.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/SizeCollectingPathVisitor.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import java.io.IOException; diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Vector2iCache.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Vector2iCache.java index e53eb12f..ac172d81 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Vector2iCache.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/util/Vector2iCache.java @@ -1,3 +1,27 @@ +/* + * This file is part of BlueMap, licensed under the MIT License (MIT). + * + * Copyright (c) Blue (Lukas Rieger) + * Copyright (c) contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ package de.bluecolored.bluemap.core.util; import com.flowpowered.math.vector.Vector2i; diff --git a/implementations/cli/src/main/java/de/bluecolored/bluemap/cli/BlueMapCLI.java b/implementations/cli/src/main/java/de/bluecolored/bluemap/cli/BlueMapCLI.java index 55dc7909..512ddba2 100644 --- a/implementations/cli/src/main/java/de/bluecolored/bluemap/cli/BlueMapCLI.java +++ b/implementations/cli/src/main/java/de/bluecolored/bluemap/cli/BlueMapCLI.java @@ -29,6 +29,7 @@ import de.bluecolored.bluemap.common.MissingResourcesException; import de.bluecolored.bluemap.common.config.BlueMapConfigs; import de.bluecolored.bluemap.common.config.ConfigurationException; +import de.bluecolored.bluemap.common.config.CoreConfig; import de.bluecolored.bluemap.common.config.WebserverConfig; import de.bluecolored.bluemap.common.plugin.RegionFileWatchService; import de.bluecolored.bluemap.common.rendermanager.MapUpdateTask; @@ -44,7 +45,6 @@ import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; -import de.bluecolored.bluemap.core.logger.LoggerLogger; import de.bluecolored.bluemap.core.map.BmMap; import de.bluecolored.bluemap.core.metrics.Metrics; import de.bluecolored.bluemap.core.storage.Storage; @@ -58,6 +58,9 @@ import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.nio.file.Path; +import java.time.Instant; +import java.time.ZoneId; +import java.time.ZonedDateTime; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; @@ -203,10 +206,25 @@ public void startWebserver(BlueMapService blueMap, boolean verbose) throws IOExc ); } + List webLoggerList = new ArrayList<>(); + if (verbose) webLoggerList.add(Logger.stdOut(true)); + if (config.getLog().getFile() != null) { + ZonedDateTime zdt = ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault()); + webLoggerList.add(Logger.file( + Path.of(String.format(config.getLog().getFile(), zdt)), + config.getLog().isAppend() + )); + } + HttpRequestHandler handler = new BlueMapResponseModifier(routingRequestHandler); - if (verbose) handler = new LoggingRequestHandler(handler); + handler = new LoggingRequestHandler( + handler, + config.getLog().getFormat(), + Logger.combine(webLoggerList) + ); try { + //noinspection resource HttpServer webServer = new HttpServer(handler); webServer.bind(new InetSocketAddress( config.resolveIp(), @@ -276,9 +294,13 @@ public static void main(String[] args) { try { CommandLine cmd = parser.parse(BlueMapCLI.createOptions(), args, false); + if (cmd.hasOption("b")) { + Logger.global.clear(); + Logger.global.put(Logger.stdOut(true)); + } + if (cmd.hasOption("l")) { - Logger.global = LoggerLogger.getInstance(); - ((LoggerLogger) Logger.global).addFileHandler(cmd.getOptionValue("l"), cmd.hasOption("a")); + Logger.global.put(Logger.file(Path.of(cmd.getOptionValue("l")), cmd.hasOption("a"))); } //help @@ -313,6 +335,17 @@ public static void main(String[] args) { } BlueMapConfigs configs = new BlueMapConfigs(cli, Path.of("data"), Path.of("web"), false); + + //apply new file-logger config + CoreConfig coreConfig = configs.getCoreConfig(); + if (coreConfig.getLog().getFile() != null) { + ZonedDateTime zdt = ZonedDateTime.ofInstant(Instant.now(), ZoneId.systemDefault()); + Logger.global.put(Logger.file( + Path.of(String.format(coreConfig.getLog().getFile(), zdt)), + coreConfig.getLog().isAppend() + )); + } + blueMap = new BlueMapService(cli, configs); boolean noActions = true; diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index 7eb61706..0dae60cd 100644 --- a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -66,7 +66,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index 59dd4c65..6b8911bc 100644 --- a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -68,7 +68,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index 7ca3c57f..c1c2b17d 100644 --- a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -68,7 +68,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index 01164059..3ee871a7 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -68,7 +68,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/fabric-1.19.4/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.19.4/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index bec0a9fe..a5e9d09b 100644 --- a/implementations/fabric-1.19.4/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.19.4/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -69,7 +69,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/fabric-1.20/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.20/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index b9584447..eeec61db 100644 --- a/implementations/fabric-1.20/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.20/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -69,7 +69,8 @@ public class FabricMod implements ModInitializer, ServerInterface { private final List onlinePlayerList; public FabricMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/folia/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java b/implementations/folia/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java index b9ab375f..5c4f5a29 100644 --- a/implementations/folia/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java +++ b/implementations/folia/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java @@ -73,7 +73,8 @@ public class BukkitPlugin extends JavaPlugin implements ServerInterface, Listene private final LoadingCache worlds; public BukkitPlugin() { - Logger.global = new JavaLogger(getLogger()); + Logger.global.clear(); + Logger.global.put(new JavaLogger(getLogger())); //try to get best matching minecraft-version MinecraftVersion version = MinecraftVersion.LATEST_SUPPORTED; diff --git a/implementations/forge-1.16.5/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.16.5/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index ceab5ee2..859b70a1 100644 --- a/implementations/forge-1.16.5/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.16.5/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -77,7 +77,8 @@ public class ForgeMod implements ServerInterface { private final List onlinePlayerList; public ForgeMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index 2d225c52..f50a19e9 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -76,7 +76,8 @@ public class ForgeMod implements ServerInterface { private final List onlinePlayerList; public ForgeMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index 8cb2ed34..112f6610 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -76,7 +76,8 @@ public class ForgeMod implements ServerInterface { private final List onlinePlayerList; public ForgeMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/forge-1.19.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.19.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index 4f54cb51..03e315f7 100644 --- a/implementations/forge-1.19.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.19.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -77,7 +77,8 @@ public class ForgeMod implements ServerInterface { private final List onlinePlayerList; public ForgeMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/forge-1.20/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.20/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index c3f93e10..d9386d3e 100644 --- a/implementations/forge-1.20/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.20/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -77,7 +77,8 @@ public class ForgeMod implements ServerInterface { private final List onlinePlayerList; public ForgeMod() { - Logger.global = new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME)); + Logger.global.clear(); + Logger.global.put(new Log4jLogger(LogManager.getLogger(Plugin.PLUGIN_NAME))); this.onlinePlayerMap = new ConcurrentHashMap<>(); this.onlinePlayerList = Collections.synchronizedList(new ArrayList<>()); diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java index 756e1aae..ef2cd30b 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlugin.java @@ -71,7 +71,8 @@ public class BukkitPlugin extends JavaPlugin implements ServerInterface, Listene private final LoadingCache worlds; public BukkitPlugin() { - Logger.global = new JavaLogger(getLogger()); + Logger.global.clear(); + Logger.global.put(new JavaLogger(getLogger())); //try to get best matching minecraft-version MinecraftVersion version = MinecraftVersion.LATEST_SUPPORTED; diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java index 077adfb6..fff14541 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java @@ -91,7 +91,9 @@ public class SpongePlugin implements ServerInterface { @Inject public SpongePlugin(org.apache.logging.log4j.Logger logger, PluginContainer pluginContainer/*, Metrics.Factory metricsFactory*/) { - Logger.global = new Log4J2Logger(logger); + Logger.global.clear(); + Logger.global.put(new Log4J2Logger(logger)); + this.pluginContainer = pluginContainer; this.onlinePlayerMap = new ConcurrentHashMap<>(); diff --git a/implementations/sponge-9.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java b/implementations/sponge-9.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java index 077adfb6..fff14541 100644 --- a/implementations/sponge-9.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java +++ b/implementations/sponge-9.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlugin.java @@ -91,7 +91,9 @@ public class SpongePlugin implements ServerInterface { @Inject public SpongePlugin(org.apache.logging.log4j.Logger logger, PluginContainer pluginContainer/*, Metrics.Factory metricsFactory*/) { - Logger.global = new Log4J2Logger(logger); + Logger.global.clear(); + Logger.global.put(new Log4J2Logger(logger)); + this.pluginContainer = pluginContainer; this.onlinePlayerMap = new ConcurrentHashMap<>();