diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/Settings.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/Settings.java index 1ba9f5cc..3f20b872 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/Settings.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/Settings.java @@ -43,8 +43,8 @@ public class Settings { timeFormat = parseTimeFormatter(config.timeFormat, config.timeZone, errorCollector); updateNotification = config.updateNotification; - imageSymbol = DisplayFormat.apply(config.imageSymbol); - transparencySymbol = DisplayFormat.apply(config.transparencySymbol); + imageSymbol = DisplayFormat.apply(config.imageRenderingSolidPixel); + transparencySymbol = DisplayFormat.apply(config.imageRenderingTransparentPixel); bungeeRefreshSeconds = parseBungeeRefreshInterval(config.bungeeRefreshSeconds, errorCollector); useRedisBungee = config.useRedisBungee; diff --git a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/SettingsModel.java b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/SettingsModel.java index c1ceb94f..6e9971d9 100644 --- a/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/SettingsModel.java +++ b/plugin/src/main/java/me/filoghost/holographicdisplays/plugin/disk/SettingsModel.java @@ -20,11 +20,11 @@ public class SettingsModel implements MappedConfig { @Path("quick-edit-commands") boolean quickEditCommands = true; - @Path("images.symbol") - String imageSymbol = "[x]"; + @Path("image-rendering.solid-pixel") + String imageRenderingSolidPixel = "[x]"; - @Path("images.transparency.space") - String transparencySymbol = " [|] "; + @Path("image-rendering.transparent-pixel") + String imageRenderingTransparentPixel = "&7 [|] "; @Path("bungee.refresh-seconds") int bungeeRefreshSeconds = 3; @@ -77,7 +77,25 @@ public class SettingsModel implements MappedConfig { } @Override - public boolean beforeSave(Config rawConfig) { + public boolean beforeLoad(Config rawConfig) { + boolean modified = false; + + if (rawConfig.contains("images") && !rawConfig.contains("image-rendering")) { + String oldTransparencyColor = rawConfig.getString("images.transparency.color"); + String oldTransparencySpace = rawConfig.getString("images.transparency.space"); + String oldSolidSymbol = rawConfig.getString("images.symbol"); + + if (oldTransparencyColor != null && oldTransparencySpace != null) { + rawConfig.setString("image-rendering.transparent-pixel", oldTransparencyColor + oldTransparencySpace); + modified = true; + } + + if (oldSolidSymbol != null) { + rawConfig.setString("image-rendering.solid-pixel", oldSolidSymbol); + modified = true; + } + } + List pathsToRemove = Arrays.asList( "vertical-spacing", "time-format", @@ -86,13 +104,12 @@ public class SettingsModel implements MappedConfig { "bungee-online-format", "bungee-offline-format", "precise-hologram-movement", - "images.transparency.color" + "images" ); - boolean modified = false; for (String path : pathsToRemove) { - if (rawConfig.get(path) != null) { + if (rawConfig.contains(path)) { rawConfig.remove(path); modified = true; }