diff --git a/BlueMapCommon/BlueMapVue b/BlueMapCommon/BlueMapVue index be1c4b49..e2af667e 160000 --- a/BlueMapCommon/BlueMapVue +++ b/BlueMapCommon/BlueMapVue @@ -1 +1 @@ -Subproject commit be1c4b4939d88d8a8da166219c1968ec290e40ac +Subproject commit e2af667e5e81ffdb3fec4e7278a87a5d746926fc diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapConfigProvider.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapConfigProvider.java new file mode 100644 index 00000000..df430318 --- /dev/null +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapConfigProvider.java @@ -0,0 +1,21 @@ +package de.bluecolored.bluemap.common; + +import de.bluecolored.bluemap.common.config.*; +import de.bluecolored.bluemap.common.config.storage.StorageConfig; + +import java.util.Map; + +public interface BlueMapConfigProvider { + CoreConfig getCoreConfig(); + + WebappConfig getWebappConfig(); + + WebserverConfig getWebserverConfig(); + + PluginConfig getPluginConfig(); + + Map getMapConfigs(); + + Map getStorageConfigs(); + +} diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java index 3f945299..e8561b8a 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/BlueMapService.java @@ -24,13 +24,12 @@ */ package de.bluecolored.bluemap.common; -import de.bluecolored.bluemap.common.config.BlueMapConfigs; import de.bluecolored.bluemap.common.config.ConfigurationException; import de.bluecolored.bluemap.common.config.MapConfig; import de.bluecolored.bluemap.common.config.storage.StorageConfig; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.debug.DebugDump; import de.bluecolored.bluemap.core.debug.StateDumper; @@ -58,7 +57,7 @@ @DebugDump public class BlueMapService { private final ServerInterface serverInterface; - private final BlueMapConfigs configs; + private final BlueMapConfigProvider configs; private final Map worldIds; private final Map storages; @@ -68,9 +67,9 @@ public class BlueMapService { private ResourcePack resourcePack; - public BlueMapService(ServerInterface serverInterface) throws ConfigurationException { + public BlueMapService(ServerInterface serverInterface, BlueMapConfigProvider configProvider) { this.serverInterface = serverInterface; - this.configs = new BlueMapConfigs(serverInterface); + this.configs = configProvider; this.worldIds = new HashMap<>(); this.storages = new HashMap<>(); @@ -122,35 +121,27 @@ public synchronized String getWorldId(Path worldFolder) throws IOException { } public synchronized void createOrUpdateWebApp(boolean force) throws ConfigurationException { - WebFilesManager webFilesManager = new WebFilesManager(configs.getWebappConfig().getWebroot()); - if (force || webFilesManager.needsUpdate()) { - try { - webFilesManager.updateFiles(); - } catch (IOException ex) { - throw new ConfigurationException("Failed to update web-app files!", ex); - } - } - } - - public synchronized void updateWebAppSettings() throws ConfigurationException, InterruptedException { try { - WebSettings webSettings = new WebSettings(configs.getWebappConfig().getWebroot().resolve("data").resolve("settings.json")); + WebFilesManager webFilesManager = new WebFilesManager(configs.getWebappConfig().getWebroot()); - webSettings.set(configs.getWebappConfig().isUseCookies(), "useCookies"); - webSettings.set(configs.getWebappConfig().isEnableFreeFlight(), "freeFlightEnabled"); - webSettings.setAllMapsEnabled(false); - for (BmMap map : getMaps().values()) { - webSettings.setMapEnabled(true, map.getId()); - webSettings.setFrom(map); + // update web-app files + if (force || webFilesManager.filesNeedUpdate()) { + webFilesManager.updateFiles(); } - int ordinal = 0; - for (var entry : configs.getMapConfigs().entrySet()) { - webSettings.setOrdinal(ordinal++, entry.getKey()); - webSettings.setFrom(entry.getValue(), entry.getKey()); + + // update settings.json + if (!configs.getWebappConfig().isUpdateSettingsFile()) { + webFilesManager.loadSettings(); + } else { + webFilesManager.setFrom(configs.getWebappConfig()); } - webSettings.save(); + for (String mapId : configs.getMapConfigs().keySet()) { + webFilesManager.addMap(mapId); + } + webFilesManager.saveSettings(); + } catch (IOException ex) { - throw new ConfigurationException("Failed to update web-app settings!", ex); + throw new ConfigurationException("Failed to update web-app files!", ex); } } @@ -385,7 +376,7 @@ private Collection getWorldFolders() { return folders; } - public BlueMapConfigs getConfigs() { + public BlueMapConfigProvider getConfigs() { return configs; } 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 77c81d38..106ce6ea 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/WebFilesManager.java @@ -24,27 +24,68 @@ */ package de.bluecolored.bluemap.common; +import de.bluecolored.bluemap.common.config.WebappConfig; import de.bluecolored.bluemap.core.logger.Logger; +import de.bluecolored.bluemap.core.resources.adapter.ResourcesGson; import org.apache.commons.io.FileUtils; +import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Enumeration; +import java.nio.file.StandardOpenOption; +import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class WebFilesManager { private final Path webRoot; + private Settings settings; public WebFilesManager(Path webRoot) { this.webRoot = webRoot; + this.settings = new Settings(); } - public boolean needsUpdate() { + public Path getSettingsFile() { + return webRoot.resolve("data").resolve("settings.json"); + } + + public void loadSettings() throws IOException { + try (BufferedReader reader = Files.newBufferedReader(getSettingsFile())) { + this.settings = ResourcesGson.INSTANCE.fromJson(reader, Settings.class); + } + } + + public void saveSettings() throws IOException { + Files.createDirectories(getSettingsFile().getParent()); + try (BufferedWriter writer = Files.newBufferedWriter(getSettingsFile(), + StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { + ResourcesGson.INSTANCE.toJson(this.settings, writer); + } + } + + public void resetSettings() { + this.settings = new Settings(); + } + + public void addMap(String mapId) { + this.settings.maps.add(mapId); + } + + public void removeMap(String mapId) { + this.settings.maps.remove(mapId); + } + + public void setFrom(WebappConfig webappConfig) { + this.settings.setFrom(webappConfig); + } + + public boolean filesNeedUpdate() { return !Files.exists(webRoot.resolve("index.html")); } @@ -77,4 +118,42 @@ public void updateFiles() throws IOException { } } + @SuppressWarnings("all") + private static class Settings { + + private boolean useCookies = true; + + private boolean enableFreeFlight = true; + + private String startLocation = null; + + private float resolutionDefault = 1; + + private int hiresSliderMax = 500; + private int hiresSliderDefault = 200; + private int hiresSliderMin = 50; + + private int lowresSliderMax = 10000; + private int lowresSliderDefault = 2000; + private int lowresSliderMin = 500; + + private Set maps = new HashSet<>(); + + public void setFrom(WebappConfig config) { + this.useCookies = config.isUseCookies(); + this.enableFreeFlight = config.isEnableFreeFlight(); + this.startLocation = config.getStartLocation().orElse(null); + this.resolutionDefault = config.getResolutionDefault(); + + this.hiresSliderMax = config.getHiresSliderMax(); + this.hiresSliderDefault = config.getLowresSliderDefault(); + this.hiresSliderMin = config.getHiresSliderMin(); + + this.lowresSliderMax = config.getLowresSliderMax(); + this.lowresSliderDefault = config.getLowresSliderDefault(); + this.lowresSliderMin = config.getLowresSliderMin(); + } + + } + } 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 21e15402..9d755fca 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 @@ -1,7 +1,8 @@ package de.bluecolored.bluemap.common.config; +import de.bluecolored.bluemap.common.BlueMapConfigProvider; import de.bluecolored.bluemap.common.config.storage.StorageConfig; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.debug.DebugDump; import de.bluecolored.bluemap.core.logger.Logger; @@ -20,7 +21,7 @@ import java.util.stream.Stream; @DebugDump -public class BlueMapConfigs { +public class BlueMapConfigs implements BlueMapConfigProvider { private final ServerInterface serverInterface; private final ConfigManager configManager; @@ -33,14 +34,18 @@ public class BlueMapConfigs { private final Map storageConfigs; public BlueMapConfigs(ServerInterface serverInterface) throws ConfigurationException { + this(serverInterface, Path.of("bluemap"), Path.of("bluemap", "web"), true); + } + + public BlueMapConfigs(ServerInterface serverInterface, Path defaultDataFolder, Path defaultWebroot, boolean usePluginConf) throws ConfigurationException { this.serverInterface = serverInterface; this.configManager = new ConfigManager(serverInterface.getConfigFolder()); - this.coreConfig = loadCoreConfig(); - this.webserverConfig = loadWebserverConfig(); - this.webappConfig = loadWebappConfig(); - this.pluginConfig = serverInterface.isPluginConfigEnabled() ? loadPluginConfig() : new PluginConfig(); - this.storageConfigs = Collections.unmodifiableMap(loadStorageConfigs()); + this.coreConfig = loadCoreConfig(defaultDataFolder); + this.webappConfig = loadWebappConfig(defaultWebroot); + this.webserverConfig = loadWebserverConfig(webappConfig.getWebroot()); + this.pluginConfig = usePluginConf ? loadPluginConfig() : new PluginConfig(); + this.storageConfigs = Collections.unmodifiableMap(loadStorageConfigs(webappConfig.getWebroot())); this.mapConfigs = Collections.unmodifiableMap(loadMapConfigs()); } @@ -48,31 +53,37 @@ public ConfigManager getConfigManager() { return configManager; } + @Override public CoreConfig getCoreConfig() { return coreConfig; } + @Override public WebappConfig getWebappConfig() { return webappConfig; } + @Override public WebserverConfig getWebserverConfig() { return webserverConfig; } + @Override public PluginConfig getPluginConfig() { return pluginConfig; } + @Override public Map getMapConfigs() { return mapConfigs; } + @Override public Map getStorageConfigs() { return storageConfigs; } - private synchronized CoreConfig loadCoreConfig() throws ConfigurationException { + private synchronized CoreConfig loadCoreConfig(Path defaultDataFolder) throws ConfigurationException { Path configFileRaw = Path.of("core"); Path configFile = configManager.findConfigPath(configFileRaw); Path configFolder = configFile.getParent(); @@ -97,6 +108,7 @@ private synchronized CoreConfig loadCoreConfig() throws ConfigurationException { .setConditional("metrics", serverInterface.isMetricsEnabled() == Tristate.UNDEFINED) .setVariable("timestamp", LocalDateTime.now().withNano(0).toString()) .setVariable("version", BlueMap.VERSION) + .setVariable("data", formatPath(defaultDataFolder)) .setVariable("implementation", "bukkit") .setVariable("render-thread-count", Integer.toString(presetRenderThreadCount)) .build(), @@ -110,7 +122,7 @@ private synchronized CoreConfig loadCoreConfig() throws ConfigurationException { return configManager.loadConfig(configFileRaw, CoreConfig.class); } - private synchronized WebserverConfig loadWebserverConfig() throws ConfigurationException { + private synchronized WebserverConfig loadWebserverConfig(Path defaultWebroot) throws ConfigurationException { Path configFileRaw = Path.of("webserver"); Path configFile = configManager.findConfigPath(configFileRaw); Path configFolder = configFile.getParent(); @@ -121,6 +133,7 @@ private synchronized WebserverConfig loadWebserverConfig() throws ConfigurationE Files.writeString( configFolder.resolve("webserver.conf"), configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/webserver.conf") + .setVariable("webroot", formatPath(defaultWebroot)) .build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); @@ -132,7 +145,7 @@ private synchronized WebserverConfig loadWebserverConfig() throws ConfigurationE return configManager.loadConfig(configFileRaw, WebserverConfig.class); } - private synchronized WebappConfig loadWebappConfig() throws ConfigurationException { + private synchronized WebappConfig loadWebappConfig(Path defaultWebroot) throws ConfigurationException { Path configFileRaw = Path.of("webapp"); Path configFile = configManager.findConfigPath(configFileRaw); Path configFolder = configFile.getParent(); @@ -143,6 +156,7 @@ private synchronized WebappConfig loadWebappConfig() throws ConfigurationExcepti Files.writeString( configFolder.resolve("webapp.conf"), configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/webapp.conf") + .setVariable("webroot", formatPath(defaultWebroot)) .build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); @@ -259,7 +273,7 @@ private synchronized Map loadMapConfigs() throws Configuratio return mapConfigs; } - private synchronized Map loadStorageConfigs() throws ConfigurationException { + private synchronized Map loadStorageConfigs(Path defaultWebroot) throws ConfigurationException { Map storageConfigs = new HashMap<>(); Path storageFolder = Paths.get("storages"); @@ -270,7 +284,9 @@ private synchronized Map loadStorageConfigs() throws Conf Files.createDirectories(storageConfigFolder); Files.writeString( storageConfigFolder.resolve("file.conf"), - configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/storages/file.conf").build(), + configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/storages/file.conf") + .setVariable("root", formatPath(defaultWebroot.resolve("data"))) + .build(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING ); Files.writeString( @@ -315,6 +331,7 @@ private String sanitiseMapId(String id) { private ConfigTemplate createOverworldMapTemplate(String name, Path worldFolder) throws IOException { return configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/maps/map.conf") .setVariable("name", name) + .setVariable("sorting", "0") .setVariable("world", formatPath(worldFolder)) .setVariable("sky-color", "#7dabff") .setVariable("ambient-light", "0.1") @@ -327,6 +344,7 @@ private ConfigTemplate createOverworldMapTemplate(String name, Path worldFolder) private ConfigTemplate createNetherMapTemplate(String name, Path worldFolder) throws IOException { return configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/maps/map.conf") .setVariable("name", name) + .setVariable("sorting", "100") .setVariable("world", formatPath(worldFolder)) .setVariable("sky-color", "#290000") .setVariable("ambient-light", "0.6") @@ -339,6 +357,7 @@ private ConfigTemplate createNetherMapTemplate(String name, Path worldFolder) th private ConfigTemplate createEndMapTemplate(String name, Path worldFolder) throws IOException { return configManager.loadConfigTemplate("/de/bluecolored/bluemap/config/maps/map.conf") .setVariable("name", name) + .setVariable("sorting", "200") .setVariable("world", formatPath(worldFolder)) .setVariable("sky-color", "#080010") .setVariable("ambient-light", "0.6") diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/MapConfig.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/MapConfig.java index 7ef61384..a41ca9c9 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/MapConfig.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/config/MapConfig.java @@ -68,7 +68,7 @@ public int getSorting() { } public Optional getStartPos() { - return Optional.of(startPos); + return Optional.ofNullable(startPos); } public String getSkyColor() { 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 61b1651f..dbd5151f 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 @@ -3,10 +3,8 @@ import de.bluecolored.bluemap.core.debug.DebugDump; import org.spongepowered.configurate.objectmapping.ConfigSerializable; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.UnknownHostException; import java.nio.file.Path; +import java.util.Optional; @SuppressWarnings({"FieldMayBeFinal", "FieldCanBeLocal"}) @DebugDump @@ -14,6 +12,7 @@ public class WebappConfig { private boolean enabled = true; + private boolean updateSettingsFile = true; private Path webroot = Path.of("bluemap", "web"); @@ -21,6 +20,18 @@ public class WebappConfig { private boolean enableFreeFlight = true; + private String startLocation = null; + + private float resolutionDefault = 1; + + private int hiresSliderMax = 500; + private int hiresSliderDefault = 200; + private int hiresSliderMin = 50; + + private int lowresSliderMax = 10000; + private int lowresSliderDefault = 2000; + private int lowresSliderMin = 500; + public boolean isEnabled() { return enabled; } @@ -29,6 +40,10 @@ public Path getWebroot() { return webroot; } + public boolean isUpdateSettingsFile() { + return updateSettingsFile; + } + public boolean isUseCookies() { return useCookies; } @@ -37,4 +52,36 @@ public boolean isEnableFreeFlight() { return enableFreeFlight; } + public Optional getStartLocation() { + return Optional.ofNullable(startLocation); + } + + public float getResolutionDefault() { + return resolutionDefault; + } + + public int getHiresSliderMax() { + return hiresSliderMax; + } + + public int getHiresSliderDefault() { + return hiresSliderDefault; + } + + public int getHiresSliderMin() { + return hiresSliderMin; + } + + public int getLowresSliderMax() { + return lowresSliderMax; + } + + public int getLowresSliderDefault() { + return lowresSliderDefault; + } + + public int getLowresSliderMin() { + return lowresSliderMin; + } + } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/live/LiveAPIRequestHandler.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/live/LiveAPIRequestHandler.java index f5204901..0e202643 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/live/LiveAPIRequestHandler.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/live/LiveAPIRequestHandler.java @@ -26,8 +26,8 @@ import com.google.gson.stream.JsonWriter; import de.bluecolored.bluemap.common.config.PluginConfig; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; import de.bluecolored.bluemap.common.webserver.HttpRequest; import de.bluecolored.bluemap.common.webserver.HttpRequestHandler; import de.bluecolored.bluemap.common.webserver.HttpResponse; @@ -102,6 +102,7 @@ public HttpResponse handlePlayersRequest(HttpRequest request) { if (!player.isOnline()) continue; if (config.isHideInvisible() && player.isInvisible()) continue; + if (config.isHideVanished() && player.isVanished()) continue; if (config.isHideSneaking() && player.isSneaking()) continue; if (config.getHiddenGameModes().contains(player.getGamemode().getId())) continue; 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 579ddf5d..e94fc0c7 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 @@ -24,13 +24,14 @@ */ package de.bluecolored.bluemap.common.plugin; +import de.bluecolored.bluemap.common.BlueMapConfigProvider; import de.bluecolored.bluemap.common.BlueMapService; import de.bluecolored.bluemap.common.InterruptableReentrantLock; import de.bluecolored.bluemap.common.MissingResourcesException; import de.bluecolored.bluemap.common.config.*; import de.bluecolored.bluemap.common.live.LiveAPIRequestHandler; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; import de.bluecolored.bluemap.common.plugin.skins.PlayerSkinUpdater; import de.bluecolored.bluemap.common.rendermanager.MapUpdateTask; import de.bluecolored.bluemap.common.rendermanager.RenderManager; @@ -100,7 +101,7 @@ public void load() throws IOException { unload(); //ensure nothing is left running (from a failed load or something) //load configs - blueMap = new BlueMapService(serverInterface); + blueMap = new BlueMapService(serverInterface, new BlueMapConfigs(serverInterface)); CoreConfig coreConfig = getConfigs().getCoreConfig(); WebserverConfig webserverConfig = getConfigs().getWebserverConfig(); WebappConfig webappConfig = getConfigs().getWebappConfig(); @@ -123,7 +124,12 @@ public void load() throws IOException { } catch (MissingResourcesException ex) { Logger.global.logWarning("BlueMap is missing important resources!"); Logger.global.logWarning("You must accept the required file download in order for BlueMap to work!"); - Logger.global.logWarning("Please check: " + blueMap.getConfigs().getConfigManager().findConfigPath(Path.of("core")).toAbsolutePath().normalize()); + + BlueMapConfigProvider configProvider = blueMap.getConfigs(); + if (configProvider instanceof BlueMapConfigs) { + Logger.global.logWarning("Please check: " + ((BlueMapConfigs) configProvider).getConfigManager().findConfigPath(Path.of("core")).toAbsolutePath().normalize()); + } + Logger.global.logInfo("If you have changed the config you can simply reload the plugin using: /bluemap reload"); unload(); @@ -193,7 +199,6 @@ public void load() throws IOException { //update webapp and settings blueMap.createOrUpdateWebApp(false); - blueMap.updateWebAppSettings(); //start skin updater if (pluginConfig.isLivePlayerMarkers()) { @@ -428,7 +433,7 @@ public BlueMapService getBlueMap() { return blueMap; } - public BlueMapConfigs getConfigs() { + public BlueMapConfigProvider getConfigs() { return blueMap.getConfigs(); } 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 05d9a90f..0d18edaa 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 @@ -45,7 +45,7 @@ import de.bluecolored.bluemap.api.marker.POIMarker; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.PluginState; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.common.plugin.text.TextColor; import de.bluecolored.bluemap.common.plugin.text.TextFormat; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkinUpdater.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkinUpdater.java index 02d2d504..4fb7be29 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkinUpdater.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/skins/PlayerSkinUpdater.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.common.plugin.skins; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.core.debug.DebugDump; import org.apache.commons.io.FileUtils; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/CommandSource.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/CommandSource.java similarity index 96% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/CommandSource.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/CommandSource.java index add158a7..032cf2f8 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/CommandSource.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/CommandSource.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import java.util.Optional; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Dimension.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Dimension.java similarity index 89% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Dimension.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Dimension.java index aacb2515..202a8668 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Dimension.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Dimension.java @@ -1,4 +1,4 @@ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import java.nio.file.Path; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Gamemode.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Gamemode.java similarity index 96% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Gamemode.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Gamemode.java index 6c0ea8ba..6e65f6db 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Gamemode.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Gamemode.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; public enum Gamemode { diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Player.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Player.java similarity index 88% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Player.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Player.java index 92084927..607a8a73 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/Player.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/Player.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.text.Text; @@ -44,7 +44,6 @@ public interface Player { /** * Return true if the player is sneaking. *

If the player is offline the value of this method is undetermined.

- * @return */ boolean isSneaking(); @@ -54,6 +53,14 @@ public interface Player { */ boolean isInvisible(); + /** + * Returns true if the player is vanished + *

If the player is offline the value of this method is undetermined.

+ */ + default boolean isVanished() { + return false; + } + /** * Returns the {@link Gamemode} this player is in *

If the player is offline the value of this method is undetermined.

diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerEventListener.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerEventListener.java similarity index 96% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerEventListener.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerEventListener.java index ebcd5c38..96ddbe63 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerEventListener.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerEventListener.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import de.bluecolored.bluemap.common.plugin.text.Text; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerInterface.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerInterface.java similarity index 95% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerInterface.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerInterface.java index 29fd93ab..0a815689 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerInterface.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerInterface.java @@ -22,7 +22,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.util.Tristate; @@ -83,8 +83,4 @@ default Tristate isMetricsEnabled() { */ Optional getPlayer(UUID uuid); - default boolean isPluginConfigEnabled() { - return true; - } - } diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerWorld.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerWorld.java similarity index 94% rename from BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerWorld.java rename to BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerWorld.java index aa5d12bd..e1358820 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/plugin/serverinterface/ServerWorld.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/serverinterface/ServerWorld.java @@ -1,4 +1,4 @@ -package de.bluecolored.bluemap.common.plugin.serverinterface; +package de.bluecolored.bluemap.common.serverinterface; import java.io.IOException; import java.nio.file.Path; diff --git a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/FileRequestHandler.java b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/FileRequestHandler.java index 13818b8e..d3350baa 100644 --- a/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/FileRequestHandler.java +++ b/BlueMapCommon/src/main/java/de/bluecolored/bluemap/common/web/FileRequestHandler.java @@ -70,7 +70,6 @@ public HttpResponse handle(HttpRequest request) { return response; } - @SuppressWarnings ("resource") private HttpResponse generateResponse(HttpRequest request) { String path = request.getPath(); @@ -101,7 +100,7 @@ private HttpResponse generateResponse(HttpRequest request) { // default to index.html if (!file.exists() || file.isDirectory()){ - file = new File(filePath.toString() + "/index.html"); + file = new File(filePath + "/index.html"); } // send empty tile-file if tile not exists @@ -172,7 +171,6 @@ private static long stringToTimestamp(String timeString) throws IllegalArgumentE int month = Calendar.JANUARY; switch (timeString.substring(8, 11)){ - case "Jan" : month = Calendar.JANUARY; break; case "Feb" : month = Calendar.FEBRUARY; break; case "Mar" : month = Calendar.MARCH; break; case "Apr" : month = Calendar.APRIL; break; 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 1bf5a6d5..bc9e5f0c 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/core.conf @@ -13,7 +13,7 @@ accept-download: false # The folder where bluemap saves data-files it needs during runtime or to save e.g. the render-progress to resume it later. # Default is "bluemap" -data: "bluemap" +data: "${data}" # This changes the amount of threads that BlueMap will use to render the maps. # A higher value can improve render-speed but could impact performance on the host machine. diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/maps/map.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/maps/map.conf index 94d05bd8..5bd61175 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/maps/map.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/maps/map.conf @@ -11,9 +11,10 @@ name: "${name}" # The path to the save-folder of the world to render. world: "${world}" -# A higher value makes the map sorted first (in lists and menus), a lower value makes it sorted later. +# A lower value makes the map sorted first (in lists and menus), a higher value makes it sorted later. +# The value needs to be an integer but it can be negative. # Default is 0 -sorting: 0 +sorting: ${sorting} # The position on the world where the map will be centered if you open it. # You can change this at any time. 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 150f0f77..0516cbe5 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/plugin.conf @@ -15,6 +15,7 @@ hidden-gamemodes: [ ] # If this is true, players that are vanished (by a plugin) will be hidden on the map. +# (This only works with Spigot and Sponge based vanish-plugins) # Default is true hide-vanished: true diff --git a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/storages/file.conf b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/storages/file.conf index 34872e0f..8c1cd6a8 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/storages/file.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/storages/file.conf @@ -10,7 +10,7 @@ storage-type: FILE # The path to the folder on your file-system where bluemap will save the rendered map # The default is: "bluemap/web/data" -root: "bluemap/web/data" +root: "${root}" # The compression-type that bluemap will use to compress generated map-data. # Available compression-types are: 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 bdcf4709..05a328a8 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webapp.conf @@ -10,7 +10,13 @@ enabled: true # The webroot where the web-application files will be created. # Usually this should be set to the same directory like in the webserver.conf! # Default is "bluemap/web" -webroot: "bluemap/web" +webroot: "${webroot}" + +# Whether the settings.json of the webapp should be updated/synchronized with the current bluemap settings. +# If this is set to "false", bluemap will only add maps to the settings.json but never remove unknown ones or update other settings. +# Disabling this is for example useful if you are running multiple bluemap instances on the same webroot and don't want them to overwrite each others maps. +# Default is true +update-settings-file: true # If the web-application should use cookies to save the configurations of a user. # Default is true @@ -19,3 +25,27 @@ use-cookies: true # If the free-flight-mode in the web-application is enabled or not. # Default is true enable-free-flight: true + +# 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. +#start-location: "overworld:0:16:-32:390:0.1:0.19:0:0:perspective" + +# The default value of the resolution (settings-menu) +# Possible values are: 0.5, 1, 2 +# Default is 1 +resolution-default: 1 + +# The min, max and default values of the hires render-distance slider (settings-menu) +# The values are in blocks. +# Default is max:500 default:200 and min:50 +hires-slider-max: 500 +hires-slider-default: 200 +hires-slider-min: 50 + +# The min, max and default values of the lowres render-distance slider (settings-menu) +# The values are in blocks. +# Default is max:10000 default:2000 and min:500 +lowres-slider-max: 10000 +lowres-slider-default: 2000 +lowres-slider-min: 500 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 38806801..1c74a2cc 100644 --- a/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf +++ b/BlueMapCommon/src/main/resources/de/bluecolored/bluemap/config/webserver.conf @@ -11,7 +11,7 @@ enabled: true # The webroot that the server will host to the web. # Usually this should be set to the same directory like in the webapp.conf! # Default is "bluemap/web" -webroot: "bluemap/web" +webroot: "${webroot}" # The port that the webserver listens to. # Default is 8100 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 1b3c48ec..1fe81d43 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 @@ -72,9 +72,8 @@ public BmMap(String id, String name, String worldId, World world, Storage storag this.worldId = Objects.requireNonNull(worldId); this.world = Objects.requireNonNull(world); this.storage = Objects.requireNonNull(storage); - this.mapSettings = Objects.requireNonNull(settings); - this.resourcePack = Objects.requireNonNull(resourcePack); + this.mapSettings = Objects.requireNonNull(settings); this.renderState = new MapRenderState(); loadRenderState(); @@ -83,8 +82,6 @@ public BmMap(String id, String name, String worldId, World world, Storage storag this.textureGallery.put(resourcePack); saveTextureGallery(); - saveMapSettings(); - this.hiresModelManager = new HiresModelManager( storage.tileStorage(id, TileType.HIRES), this.resourcePack, @@ -103,6 +100,8 @@ public BmMap(String id, String name, String worldId, World world, Storage storag this.renderTimeSumNanos = 0; this.tilesRendered = 0; + + saveMapSettings(); } public void renderTile(Vector2i tile) { diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/MapSettingsSerializer.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/MapSettingsSerializer.java index cc80b5f0..6bb98f6e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/MapSettingsSerializer.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/adapter/MapSettingsSerializer.java @@ -20,6 +20,9 @@ public JsonElement serialize(BmMap map, Type typeOfSrc, JsonSerializationContext // name root.addProperty("name", map.getName()); + // sorting + root.addProperty("sorting", map.getMapSettings().getSorting()); + // hires Vector2i hiresTileSize = map.getHiresModelManager().getTileGrid().getGridSize(); Vector2i gridOrigin = map.getHiresModelManager().getTileGrid().getOffset(); 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 22e668fb..bc9284ec 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,9 +1,6 @@ package de.bluecolored.bluemap.core.resources.adapter; -import com.flowpowered.math.vector.Vector3d; -import com.flowpowered.math.vector.Vector3f; -import com.flowpowered.math.vector.Vector4d; -import com.flowpowered.math.vector.Vector4f; +import com.flowpowered.math.vector.*; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; @@ -29,6 +26,7 @@ private static Gson createGson() { .registerTypeAdapter(Axis.class, new AxisAdapter()) .registerTypeAdapter(Color.class, new ColorAdapter()) .registerTypeAdapter(Direction.class, new DirectionAdapter()) + .registerTypeAdapter(Vector2i.class, new Vector2iAdapter()) .registerTypeAdapter(Vector3d.class, new Vector3dAdapter()) .registerTypeAdapter(Vector3f.class, new Vector3fAdapter()) .registerTypeAdapter(Vector4d.class, new Vector4dAdapter()) 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 7c3ae669..a49bd9ef 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 @@ -24,16 +24,18 @@ */ package de.bluecolored.bluemap.cli; +import de.bluecolored.bluemap.common.BlueMapConfigProvider; import de.bluecolored.bluemap.common.BlueMapService; 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.MapConfig; import de.bluecolored.bluemap.common.config.WebserverConfig; import de.bluecolored.bluemap.common.plugin.RegionFileWatchService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.common.rendermanager.MapUpdateTask; import de.bluecolored.bluemap.common.rendermanager.RenderManager; import de.bluecolored.bluemap.common.rendermanager.RenderTask; @@ -69,7 +71,6 @@ public void renderMaps(BlueMapService blueMap, boolean watch, boolean forceRende if (blueMap.getConfigs().getCoreConfig().isMetrics()) Metrics.sendReportAsync("cli"); blueMap.createOrUpdateWebApp(forceGenerateWebapp); - blueMap.updateWebAppSettings(); //try load resources blueMap.getResourcePack(); @@ -254,11 +255,6 @@ public Optional getPlayer(UUID uuid) { return Optional.empty(); } - @Override - public boolean isPluginConfigEnabled() { - return false; - } - public static void main(String[] args) { CommandLineParser parser = new DefaultParser(); @@ -280,7 +276,7 @@ public static void main(String[] args) { } //config folder - cli.configFolder = Path.of("."); + cli.configFolder = Path.of("config"); if (cmd.hasOption("c")) { cli.configFolder = Path.of(cmd.getOptionValue("c")); Files.createDirectories(cli.configFolder); @@ -298,7 +294,8 @@ public static void main(String[] args) { } } - blueMap = new BlueMapService(cli); + BlueMapConfigs configs = new BlueMapConfigs(cli, Path.of("data"), Path.of("web"), false); + blueMap = new BlueMapService(cli, configs); boolean noActions = true; if (cmd.hasOption("w")) { @@ -322,15 +319,13 @@ public static void main(String[] args) { } if (cmd.hasOption("s")) { noActions = false; - blueMap.updateWebAppSettings(); + blueMap.createOrUpdateWebApp(false); } } // if nothing has been defined to do if (noActions) { - if (!Files.exists(blueMap.getConfigs().getConfigManager().findConfigPath(Path.of("core")))) { - Logger.global.logInfo("Generating default config files for you, here: " + cli.configFolder.toAbsolutePath().normalize() + "\n"); - } + Logger.global.logInfo("Generated default config files for you, here: " + cli.configFolder.toAbsolutePath().normalize() + "\n"); //create resourcepacks folder Files.createDirectories(cli.configFolder.resolve( "resourcepacks")); @@ -343,7 +338,12 @@ public static void main(String[] args) { } catch (MissingResourcesException e) { Logger.global.logWarning("BlueMap is missing important resources!"); Logger.global.logWarning("You must accept the required file download in order for BlueMap to work!"); - if (blueMap != null) Logger.global.logWarning("Please check: " + blueMap.getConfigs().getConfigManager().findConfigPath(Path.of("core")).toAbsolutePath().normalize()); + if (blueMap != null) { + BlueMapConfigProvider configProvider = blueMap.getConfigs(); + if (configProvider instanceof BlueMapConfigs) { + Logger.global.logWarning("Please check: " + ((BlueMapConfigs) configProvider).getConfigManager().findConfigPath(Path.of("core")).toAbsolutePath().normalize()); + } + } System.exit(2); } catch (ParseException e) { Logger.global.logError("Failed to parse provided arguments!", e); @@ -402,8 +402,8 @@ private static Options createOptions() { options.addOption("w", "webserver", false, "Starts the web-server, configured in the 'webserver.conf' file"); options.addOption("b", "verbose", false, "Causes the web-server to log requests to the console"); - options.addOption("g", "generate-webapp", false, "Generates the files for the web-app to the folder, configured in the 'render.conf' file (this is done automatically when rendering if the 'index.html' file in the webroot can't be found)"); - options.addOption("s", "generate-websettings", false, "Generates the settings for the web-app, using the settings from the 'render.conf' file (this is done automatically when rendering)"); + options.addOption("g", "generate-webapp", false, "Generates the files for the web-app to the folder configured in the 'webapp.conf' file"); + options.addOption("s", "generate-websettings", false, "Updates the settings.json for the web-app"); options.addOption("r", "render", false, "Renders the maps configured in the 'render.conf' file"); options.addOption("f", "force-render", false, "Forces rendering everything, instead of only rendering chunks that have been modified since the last render"); @@ -443,8 +443,8 @@ private static void printHelp() { footer.append("Render the configured maps\n\n"); footer.append(command).append(" -w\n"); footer.append("Start only the webserver without doing anything else\n\n"); - footer.append(command).append(" -gs\n"); - footer.append("Generate the web-app and settings without starting a render\n\n"); + footer.append(command).append(" -ru\n"); + footer.append("Render the configured maps and then keeps watching the world-files and updates the map once something changed.\n\n"); formatter.printHelp(command + " [options]", "\nOptions:", createOptions(), "\n" + footer); } diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java index 9c971911..96497a24 100644 --- a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -26,12 +26,11 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import me.lucko.fabric.api.permissions.v0.Permissions; import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.Vec3d; import java.io.IOException; diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index e9c88fae..0d716705 100644 --- a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; import net.minecraft.server.MinecraftServer; 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 d36a445c..f52d4171 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java index d936d947..c12369ff 100644 --- a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; diff --git a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java index b1d1c170..9335ff05 100644 --- a/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java +++ b/implementations/fabric-1.15.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.world.dimension.DimensionType; import java.io.IOException; diff --git a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java index 9c971911..96497a24 100644 --- a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java +++ b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -26,12 +26,11 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import me.lucko.fabric.api.permissions.v0.Permissions; import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.Vec3d; import java.io.IOException; diff --git a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index e9c88fae..0d716705 100644 --- a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; import net.minecraft.server.MinecraftServer; diff --git a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java index 07c7fb5e..25dcf3b9 100644 --- a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java +++ b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricMod.java @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java index d936d947..c12369ff 100644 --- a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java +++ b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; diff --git a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java index 97963482..1b482434 100644 --- a/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java +++ b/implementations/fabric-1.16.1/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.util.WorldSavePath; import net.minecraft.world.dimension.DimensionType; diff --git a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java index df4a2998..96497a24 100644 --- a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java +++ b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import me.lucko.fabric.api.permissions.v0.Permissions; diff --git a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index 89a0b91a..21a3366a 100644 --- a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; import net.minecraft.server.MinecraftServer; 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 2b6475e1..25d87c49 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java index d936d947..c12369ff 100644 --- a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java +++ b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; diff --git a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java index f062e9f8..e248fe97 100644 --- a/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java +++ b/implementations/fabric-1.16.2/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.util.WorldSavePath; import net.minecraft.world.World; diff --git a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java index df4a2998..96497a24 100644 --- a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java +++ b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import me.lucko.fabric.api.permissions.v0.Permissions; diff --git a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index 89a0b91a..21a3366a 100644 --- a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; import net.minecraft.server.MinecraftServer; 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 afe95d3b..fbbd222b 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java index b5db63c2..2ea8be7b 100644 --- a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java +++ b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; diff --git a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java index f062e9f8..e248fe97 100644 --- a/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java +++ b/implementations/fabric-1.17/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.util.WorldSavePath; import net.minecraft.world.World; diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java index df4a2998..96497a24 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import me.lucko.fabric.api.permissions.v0.Permissions; diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java index 89a0b91a..21a3366a 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.fabric.events.PlayerJoinCallback; import de.bluecolored.bluemap.fabric.events.PlayerLeaveCallback; import net.minecraft.server.MinecraftServer; 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 19a46a53..d0294649 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java index 468bbd08..63b1a52b 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricPlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; diff --git a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java index d86af0e2..6647b152 100644 --- a/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java +++ b/implementations/fabric-1.18/src/main/java/de/bluecolored/bluemap/fabric/FabricWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.fabric; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.util.WorldSavePath; import net.minecraft.world.World; diff --git a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java index cc666f48..8ce330dd 100644 --- a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java +++ b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java @@ -30,12 +30,11 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.minecraft.util.math.Vec3d; import net.minecraft.util.text.ITextComponent; -import net.minecraft.world.server.ServerWorld; public class ForgeCommandSource implements CommandSource { diff --git a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java index 0c852d52..173e5229 100644 --- a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java +++ b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; diff --git a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index d8d59e3f..14371a92 100644 --- a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java index d43de099..11dd9c44 100644 --- a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java +++ b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.potion.EffectInstance; diff --git a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java index aa9dbcb7..3ae24f28 100644 --- a/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java +++ b/implementations/forge-1.14.4/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.world.dimension.DimensionType; import java.io.IOException; diff --git a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java index 027df2d1..a72cbaa5 100644 --- a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java +++ b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.minecraft.util.math.Vec3d; diff --git a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java index 0c852d52..173e5229 100644 --- a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java +++ b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; diff --git a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index bb786823..15b60ee6 100644 --- a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java index 9d806491..f29446d6 100644 --- a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java +++ b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.potion.EffectInstance; diff --git a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java index aa9dbcb7..3ae24f28 100644 --- a/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java +++ b/implementations/forge-1.15.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.world.dimension.DimensionType; import java.io.IOException; diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java index 196ed0c4..f52fd834 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.minecraft.util.text.ITextComponent; diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java index 0c852d52..173e5229 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java index c453ea45..2d57d960 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeMod.java @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java index 03cbff76..47d7230f 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.potion.EffectInstance; diff --git a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java index 26aa8461..6ddbfecd 100644 --- a/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java +++ b/implementations/forge-1.16.2/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.world.DimensionType; import net.minecraft.world.World; diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java index 914a12a9..eadcd607 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.minecraft.commands.CommandSourceStack; diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java index 3766e872..ff54d23a 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; 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 219e024f..e9e805cc 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java index d7942628..fc6ea264 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java index e87421ec..cf82b718 100644 --- a/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java +++ b/implementations/forge-1.17.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java @@ -1,7 +1,7 @@ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.Level; diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java index 914a12a9..eadcd607 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.minecraft.commands.CommandSourceStack; diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java index 3766e872..ff54d23a 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeEventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent; 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 84382cfb..ccb99524 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 @@ -28,10 +28,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; import de.bluecolored.bluemap.common.plugin.commands.Commands; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java index d7942628..fc6ea264 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgePlayer.java @@ -26,8 +26,8 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.BlueMapService; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; diff --git a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java index a8f1dd59..ce92b260 100644 --- a/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java +++ b/implementations/forge-1.18.1/src/main/java/de/bluecolored/bluemap/forge/ForgeWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.forge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.world.level.Level; diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java index e69e2cc6..0f5c80e2 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import org.bukkit.Bukkit; diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlayer.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlayer.java index 5134410a..22428e11 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlayer.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitPlayer.java @@ -25,8 +25,8 @@ package de.bluecolored.bluemap.bukkit; import com.flowpowered.math.vector.Vector3d; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import org.bukkit.Bukkit; import org.bukkit.GameMode; @@ -56,6 +56,7 @@ public class BukkitPlayer implements Player { private boolean online; private boolean sneaking; private boolean invisible; + private boolean vanished; private Gamemode gamemode; public BukkitPlayer(UUID playerUUID) { @@ -98,6 +99,11 @@ public boolean isInvisible() { return this.invisible; } + @Override + public boolean isVanished() { + return vanished; + } + @Override public Gamemode getGamemode() { return this.gamemode; @@ -119,9 +125,11 @@ public void update() { this.invisible = player.hasPotionEffect(PotionEffectType.INVISIBILITY); //also check for "vanished" players + boolean vanished = false; for (MetadataValue meta : player.getMetadata("vanished")) { - if (meta.asBoolean()) this.invisible = true; + if (meta.asBoolean()) vanished = true; } + this.vanished = vanished; this.name = Text.of(player.getName()); this.online = player.isOnline(); 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 ab105100..2719b094 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 @@ -27,10 +27,10 @@ import com.github.benmanes.caffeine.cache.Caffeine; import com.github.benmanes.caffeine.cache.LoadingCache; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitWorld.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitWorld.java index 90182662..2a5d9444 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitWorld.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/BukkitWorld.java @@ -24,8 +24,8 @@ */ package de.bluecolored.bluemap.bukkit; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import org.bukkit.Bukkit; import org.bukkit.World; diff --git a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/EventForwarder.java b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/EventForwarder.java index 8e80cfa5..cce36500 100644 --- a/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/EventForwarder.java +++ b/implementations/spigot/src/main/java/de/bluecolored/bluemap/bukkit/EventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.bukkit; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.common.plugin.text.Text; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/EventForwarder.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/EventForwarder.java index d082d5ce..7cdf99c1 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/EventForwarder.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/EventForwarder.java @@ -24,7 +24,7 @@ */ package de.bluecolored.bluemap.sponge; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; import de.bluecolored.bluemap.common.plugin.text.Text; import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer; import org.spongepowered.api.event.Listener; diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeCommandSource.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeCommandSource.java index cb5fce93..ccf78012 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeCommandSource.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeCommandSource.java @@ -26,7 +26,7 @@ import com.flowpowered.math.vector.Vector3d; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.CommandSource; +import de.bluecolored.bluemap.common.serverinterface.CommandSource; import de.bluecolored.bluemap.common.plugin.text.Text; import de.bluecolored.bluemap.core.world.World; import net.kyori.adventure.audience.Audience; diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlayer.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlayer.java index edd118de..d29234c6 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlayer.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongePlayer.java @@ -25,8 +25,8 @@ package de.bluecolored.bluemap.sponge; import com.flowpowered.math.vector.Vector3d; -import de.bluecolored.bluemap.common.plugin.serverinterface.Gamemode; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.Gamemode; +import de.bluecolored.bluemap.common.serverinterface.Player; import de.bluecolored.bluemap.common.plugin.text.Text; import org.spongepowered.api.Sponge; import org.spongepowered.api.data.Keys; @@ -58,6 +58,7 @@ public class SpongePlayer implements Player { private boolean online; private boolean sneaking; private boolean invisible; + private boolean vanished; private Gamemode gamemode; public SpongePlayer(UUID playerUUID) { @@ -100,6 +101,11 @@ public boolean isInvisible() { return this.invisible; } + @Override + public boolean isVanished() { + return vanished; + } + @Override public Gamemode getGamemode() { return this.gamemode; @@ -118,18 +124,17 @@ public void update() { this.gamemode = GAMEMODE_MAP.get(player.get(Keys.GAME_MODE).orElse(GameModes.NOT_SET.get())); if (this.gamemode == null) this.gamemode = Gamemode.SURVIVAL; - boolean invis = player.get(Keys.VANISH_STATE).orElse(VanishState.unvanished()).invisible(); - if (!invis && player.get(Keys.IS_INVISIBLE).orElse(false)) invis = true; - if (!invis) { - Optional> effects = player.get(Keys.POTION_EFFECTS); - if (effects.isPresent()) { - for (PotionEffect effect : effects.get()) { - if (effect.type().equals(PotionEffectTypes.INVISIBILITY.get()) && effect.duration().ticks() > 0) invis = true; - } + boolean invis = false; + Optional> effects = player.get(Keys.POTION_EFFECTS); + if (effects.isPresent()) { + for (PotionEffect effect : effects.get()) { + if (effect.type().equals(PotionEffectTypes.INVISIBILITY.get()) && effect.duration().ticks() > 0) invis = true; } } this.invisible = invis; + this.vanished = player.get(Keys.VANISH_STATE).orElse(VanishState.unvanished()).invisible(); + this.name = Text.of(player.name()); this.online = player.isOnline(); this.position = SpongePlugin.fromSpongePoweredVector(player.position()); 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 3bf51e8b..1766b751 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 @@ -31,10 +31,10 @@ import com.github.benmanes.caffeine.cache.LoadingCache; import com.google.inject.Inject; import de.bluecolored.bluemap.common.plugin.Plugin; -import de.bluecolored.bluemap.common.plugin.serverinterface.Player; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerEventListener; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerInterface; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Player; +import de.bluecolored.bluemap.common.serverinterface.ServerEventListener; +import de.bluecolored.bluemap.common.serverinterface.ServerInterface; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import de.bluecolored.bluemap.core.BlueMap; import de.bluecolored.bluemap.core.MinecraftVersion; import de.bluecolored.bluemap.core.logger.Logger; diff --git a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeWorld.java b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeWorld.java index 345a25e0..080ac4db 100644 --- a/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeWorld.java +++ b/implementations/sponge-8.0.0/src/main/java/de/bluecolored/bluemap/sponge/SpongeWorld.java @@ -24,10 +24,9 @@ */ package de.bluecolored.bluemap.sponge; -import de.bluecolored.bluemap.common.plugin.serverinterface.Dimension; -import de.bluecolored.bluemap.common.plugin.serverinterface.ServerWorld; +import de.bluecolored.bluemap.common.serverinterface.Dimension; +import de.bluecolored.bluemap.common.serverinterface.ServerWorld; import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; -import org.spongepowered.api.world.WorldType; import org.spongepowered.api.world.WorldTypes; import java.io.IOException;