diff --git a/build.xml b/build.xml index 1528f958..5bf53e8c 100644 --- a/build.xml +++ b/build.xml @@ -22,6 +22,15 @@ + + + + + + + + + diff --git a/src/main/assembly/package.xml b/src/main/assembly/package.xml index a043c10a..b11688c4 100644 --- a/src/main/assembly/package.xml +++ b/src/main/assembly/package.xml @@ -23,21 +23,9 @@ ${project.basedir}/colorschemes /dynmap/colorschemes - - ${project.basedir} - /dynmap/ - - configuration.default - shaders.txt - perspectives.txt - lightings.txt - worlds.txt.sample ${project.basedir}/texturepacks /dynmap/texturepacks - - ${project.basedir}/templates - /dynmap/templates ${project.basedir}/renderdata /dynmap/renderdata diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index c3c6b598..1efae889 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -6,6 +6,7 @@ import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.Constructor; import java.net.InetAddress; import java.net.UnknownHostException; @@ -130,11 +131,22 @@ public class DynmapPlugin extends JavaPlugin { } } } + /* Table of default templates - all are resources in dynmap.jar unnder templates/, and go in templates directory when needed */ + private static final String[] stdtemplates = { "normal.txt", "nether.txt", "skylands.txt", "normal-lowres.txt", + "nether-lowres.txt", "skylands-lowres.txt", "normal-hires.txt", "nether-hires.txt", "skyands-hires.txt" + }; private static final String CUSTOM_PREFIX = "custom-"; /* Load templates from template folder */ private void loadTemplates() { File templatedir = new File(dataDirectory, "templates"); + templatedir.mkdirs(); + /* First, prime the templates directory with default standard templates, if needed */ + for(String stdtemplate : stdtemplates) { + File f = new File(templatedir, stdtemplate); + createDefaultFileFromResource("/templates/" + stdtemplate, f); + } + /* Now process files */ String[] templates = templatedir.list(); /* Go through list - process all ones not starting with 'custom' first */ for(String tname: templates) { @@ -174,49 +186,27 @@ public class DynmapPlugin extends JavaPlugin { /* Load texture mappings */ TexturePack.loadTextureMapping(dataDirectory); + /* Initialize confguration.txt if needed */ File f = new File(this.getDataFolder(), "configuration.txt"); - /* If configuration.txt not found, copy the default one */ - if(f.exists() == false) { - Log.info("configuration.txt not found - creating default"); - File deffile = new File(this.getDataFolder(), "configuration.default"); - try { - FileInputStream fis = new FileInputStream(deffile); - FileOutputStream fos = new FileOutputStream(f); - byte[] buf = new byte[512]; - int len; - while((len = fis.read(buf)) > 0) { - fos.write(buf, 0, len); - } - fos.close(); - fis.close(); - } catch (IOException iox) { - Log.severe("ERROR CREATING DEFAULT CONFIGURATION.TXT!"); - this.setEnabled(false); - return; - } + if(!createDefaultFileFromResource("/configuration.txt", f)) { + this.setEnabled(false); + return; } + /* Load configuration.txt */ org.bukkit.util.config.Configuration bukkitConfiguration = new org.bukkit.util.config.Configuration(f); bukkitConfiguration.load(); configuration = new ConfigurationNode(bukkitConfiguration); /* Now, process worlds.txt - merge it in as an override of existing values (since it is only user supplied values) */ f = new File(this.getDataFolder(), "worlds.txt"); - if(f.exists()) { - org.bukkit.util.config.Configuration cfg = new org.bukkit.util.config.Configuration(f); - cfg.load(); - ConfigurationNode cn = new ConfigurationNode(cfg); - mergeConfigurationBranch(cn, "worlds", true, true); - } - else { - try { - FileWriter fw = new FileWriter(f); - fw.write("# This file is intended to allow the user to define world-specific settings\n"); - fw.write("# Dynmap's install will not overwrite it\n"); - fw.write("worlds:\n"); - fw.close(); - } catch (IOException iox) { - } + if(!createDefaultFileFromResource("/worlds.txt", f)) { + this.setEnabled(false); + return; } + org.bukkit.util.config.Configuration cfg = new org.bukkit.util.config.Configuration(f); + cfg.load(); + ConfigurationNode cn = new ConfigurationNode(cfg); + mergeConfigurationBranch(cn, "worlds", true, true); /* Now, process templates */ loadTemplates(); @@ -672,4 +662,35 @@ public class DynmapPlugin extends JavaPlugin { public static void setIgnoreChunkLoads(boolean ignore) { ignore_chunk_loads = ignore; } + /* Uses resource to create default file, if file does not yet exist */ + public boolean createDefaultFileFromResource(String resourcename, File deffile) { + if(deffile.canRead()) + return true; + Log.info(deffile.getPath() + " not found - creating default"); + InputStream in = getClass().getResourceAsStream(resourcename); + if(in == null) { + Log.severe("Unable to find default resource - " + resourcename); + return false; + } + else { + FileOutputStream fos = null; + try { + fos = new FileOutputStream(deffile); + byte[] buf = new byte[512]; + int len; + while((len = in.read(buf)) > 0) { + fos.write(buf, 0, len); + } + } catch (IOException iox) { + Log.severe("ERROR creatomg default for " + deffile.getPath()); + return false; + } finally { + if(fos != null) + try { fos.close(); } catch (IOException iox) {} + if(in != null) + try { in.close(); } catch (IOException iox) {} + } + return true; + } + } } diff --git a/src/main/java/org/dynmap/hdmap/HDBlockModels.java b/src/main/java/org/dynmap/hdmap/HDBlockModels.java index 48778034..9a5e546e 100644 --- a/src/main/java/org/dynmap/hdmap/HDBlockModels.java +++ b/src/main/java/org/dynmap/hdmap/HDBlockModels.java @@ -1,10 +1,13 @@ package org.dynmap.hdmap; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; import java.io.LineNumberReader; import java.util.ArrayList; import java.util.HashMap; @@ -263,10 +266,24 @@ public class HDBlockModels { */ public static void loadModels(File datadir) { /* Load block models */ - loadModelFile(new File(datadir, "renderdata/models.txt")); + InputStream in = TexturePack.class.getResourceAsStream("/models.txt"); + if(in != null) { + loadModelFile(in, "models.txt"); + try { in.close(); } catch (IOException iox) {} in = null; + } File custom = new File(datadir, "renderdata/custom-models.txt"); if(custom.canRead()) { - loadModelFile(custom); + try { + in = new FileInputStream(custom); + loadModelFile(in, custom.getPath()); + } catch (IOException iox) { + Log.severe("Error loading " + custom.getPath()); + } finally { + if(in != null) { + try { in.close(); } catch (IOException iox) {} + in = null; + } + } } else { try { @@ -280,7 +297,7 @@ public class HDBlockModels { /** * Load models from file */ - private static void loadModelFile(File modelfile) { + private static void loadModelFile(InputStream in, String fname) { LineNumberReader rdr = null; int cnt = 0; try { @@ -289,7 +306,7 @@ public class HDBlockModels { int layerbits = 0; int rownum = 0; int scale = 0; - rdr = new LineNumberReader(new FileReader(modelfile)); + rdr = new LineNumberReader(new InputStreamReader(in)); while((line = rdr.readLine()) != null) { if(line.startsWith("block:")) { ArrayList blkids = new ArrayList(); @@ -322,7 +339,7 @@ public class HDBlockModels { } } else { - Log.severe("Block model missing required parameters = line " + rdr.getLineNumber() + " of " + modelfile.getPath()); + Log.severe("Block model missing required parameters = line " + rdr.getLineNumber() + " of " + fname); } layerbits = 0; } @@ -401,11 +418,11 @@ public class HDBlockModels { } } } - Log.verboseinfo("Loaded " + cnt + " block models from " + modelfile.getPath()); + Log.verboseinfo("Loaded " + cnt + " block models from " + fname); } catch (IOException iox) { Log.severe("Error reading models.txt - " + iox.toString()); } catch (NumberFormatException nfx) { - Log.severe("Format error - line " + rdr.getLineNumber() + " of " + modelfile.getPath()); + Log.severe("Format error - line " + rdr.getLineNumber() + " of " + fname); } finally { if(rdr != null) { try { diff --git a/src/main/java/org/dynmap/hdmap/HDMapManager.java b/src/main/java/org/dynmap/hdmap/HDMapManager.java index bb7bd41c..53ee2d0c 100644 --- a/src/main/java/org/dynmap/hdmap/HDMapManager.java +++ b/src/main/java/org/dynmap/hdmap/HDMapManager.java @@ -13,6 +13,7 @@ import org.bukkit.World; import org.bukkit.plugin.Plugin; import org.dynmap.ConfigurationNode; import org.dynmap.DynmapChunk; +import org.dynmap.DynmapPlugin; import org.dynmap.DynmapWorld; import org.dynmap.Log; import org.dynmap.MapManager; @@ -28,10 +29,14 @@ public class HDMapManager { public HashSet maps = new HashSet(); public HashMap> maps_by_world_perspective = new HashMap>(); - public void loadHDShaders(Plugin plugin) { + public void loadHDShaders(DynmapPlugin plugin) { Log.verboseinfo("Loading shaders..."); - - org.bukkit.util.config.Configuration bukkitShaderConfig = new org.bukkit.util.config.Configuration(new File(plugin.getDataFolder(), "shaders.txt")); + + File f = new File(plugin.getDataFolder(), "shaders.txt"); + if(!plugin.createDefaultFileFromResource("/shaders.txt", f)) { + return; + } + org.bukkit.util.config.Configuration bukkitShaderConfig = new org.bukkit.util.config.Configuration(f); bukkitShaderConfig.load(); ConfigurationNode shadercfg = new ConfigurationNode(bukkitShaderConfig); @@ -40,7 +45,8 @@ public class HDMapManager { shaders.put(shader.getName(), shader); } /* Load custom shaders, if file is defined - or create empty one if not */ - File f = new File(plugin.getDataFolder(), "custom-shaders.txt"); + f = new File(plugin.getDataFolder(), "custom-shaders.txt"); + plugin.createDefaultFileFromResource("/custom-shaders.txt", f); if(f.exists()) { bukkitShaderConfig = new org.bukkit.util.config.Configuration(f); bukkitShaderConfig.load(); @@ -50,22 +56,16 @@ public class HDMapManager { shaders.put(shader.getName(), shader); } } - else { - try { - FileWriter fw = new FileWriter(f); - fw.write("# The user is free to add new and custom shaders here, including replacements for standard ones\n"); - fw.write("# Dynmap's install will not overwrite it\n"); - fw.write("shaders:\n"); - fw.close(); - } catch (IOException iox) { - } - } Log.info("Loaded " + shaders.size() + " shaders."); } - public void loadHDPerspectives(Plugin plugin) { + public void loadHDPerspectives(DynmapPlugin plugin) { Log.verboseinfo("Loading perspectives..."); - org.bukkit.util.config.Configuration bukkitPerspectiveConfig = new org.bukkit.util.config.Configuration(new File(plugin.getDataFolder(), "perspectives.txt")); + File f = new File(plugin.getDataFolder(), "perspectives.txt"); + if(!plugin.createDefaultFileFromResource("/perspectives.txt", f)) { + return; + } + org.bukkit.util.config.Configuration bukkitPerspectiveConfig = new org.bukkit.util.config.Configuration(f); bukkitPerspectiveConfig.load(); ConfigurationNode perspectivecfg = new ConfigurationNode(bukkitPerspectiveConfig); for(HDPerspective perspective : perspectivecfg.createInstances("perspectives", new Class[0], new Object[0])) { @@ -73,7 +73,8 @@ public class HDMapManager { perspectives.put(perspective.getName(), perspective); } /* Load custom perspectives, if file is defined - or create empty one if not */ - File f = new File(plugin.getDataFolder(), "custom-perspectives.txt"); + f = new File(plugin.getDataFolder(), "custom-perspectives.txt"); + plugin.createDefaultFileFromResource("/custom-perspectives.txt", f); if(f.exists()) { bukkitPerspectiveConfig = new org.bukkit.util.config.Configuration(f); bukkitPerspectiveConfig.load(); @@ -83,22 +84,16 @@ public class HDMapManager { perspectives.put(perspective.getName(), perspective); } } - else { - try { - FileWriter fw = new FileWriter(f); - fw.write("# The user is free to add new and custom perspectives here, including replacements for standard ones\n"); - fw.write("# Dynmap's install will not overwrite it\n"); - fw.write("perspectives:\n"); - fw.close(); - } catch (IOException iox) { - } - } Log.info("Loaded " + perspectives.size() + " perspectives."); } - public void loadHDLightings(Plugin plugin) { + public void loadHDLightings(DynmapPlugin plugin) { Log.verboseinfo("Loading lightings..."); - org.bukkit.util.config.Configuration bukkitLightingsConfig = new org.bukkit.util.config.Configuration(new File(plugin.getDataFolder(), "lightings.txt")); + File f = new File(plugin.getDataFolder(), "lightings.txt"); + if(!plugin.createDefaultFileFromResource("/lightings.txt", f)) { + return; + } + org.bukkit.util.config.Configuration bukkitLightingsConfig = new org.bukkit.util.config.Configuration(f); bukkitLightingsConfig.load(); ConfigurationNode lightingcfg = new ConfigurationNode(bukkitLightingsConfig); @@ -107,7 +102,8 @@ public class HDMapManager { lightings.put(lighting.getName(), lighting); } /* Load custom lightings, if file is defined - or create empty one if not */ - File f = new File(plugin.getDataFolder(), "custom-lightings.txt"); + f = new File(plugin.getDataFolder(), "custom-lightings.txt"); + plugin.createDefaultFileFromResource("/custom-lightings.txt", f); if(f.exists()) { bukkitLightingsConfig = new org.bukkit.util.config.Configuration(f); bukkitLightingsConfig.load(); @@ -117,16 +113,6 @@ public class HDMapManager { lightings.put(lighting.getName(), lighting); } } - else { - try { - FileWriter fw = new FileWriter(f); - fw.write("# The user is free to add new and custom lightings here, including replacements for standard ones\n"); - fw.write("# Dynmap's install will not overwrite it\n"); - fw.write("lightings:\n"); - fw.close(); - } catch (IOException iox) { - } - } Log.info("Loaded " + lightings.size() + " lightings."); } diff --git a/src/main/java/org/dynmap/hdmap/TexturePack.java b/src/main/java/org/dynmap/hdmap/TexturePack.java index ecd8bf24..add4a66b 100644 --- a/src/main/java/org/dynmap/hdmap/TexturePack.java +++ b/src/main/java/org/dynmap/hdmap/TexturePack.java @@ -8,6 +8,7 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; +import java.io.InputStreamReader; import java.io.LineNumberReader; import java.util.ArrayList; import java.util.Collections; @@ -557,10 +558,24 @@ public class TexturePack { /* Initialize map with blank map for all entries */ HDTextureMap.initializeTable(); /* Load block models */ - loadTextureFile(new File(datadir, "renderdata/texture.txt")); + InputStream in = TexturePack.class.getResourceAsStream("/texture.txt"); + if(in != null) { + loadTextureFile(in, "texture.txt"); + if(in != null) { try { in.close(); } catch (IOException x) {} in = null; } + } + else + Log.severe("Error loading texture.txt"); + File custom = new File(datadir, "renderdata/custom-texture.txt"); if(custom.canRead()) { - loadTextureFile(custom); + try { + in = new FileInputStream(custom); + loadTextureFile(in, custom.getPath()); + } catch (IOException iox) { + Log.severe("Error loading renderdata/custom-texture.txt - " + iox); + } finally { + if(in != null) { try { in.close(); } catch (IOException x) {} in = null; } + } } else { try { @@ -575,13 +590,13 @@ public class TexturePack { /** * Load texture pack mappings from texture.txt file */ - private static void loadTextureFile(File txtfile) { + private static void loadTextureFile(InputStream txtfile, String txtname) { LineNumberReader rdr = null; int cnt = 0; try { String line; - rdr = new LineNumberReader(new FileReader(txtfile)); + rdr = new LineNumberReader(new InputStreamReader(txtfile)); while((line = rdr.readLine()) != null) { if(line.startsWith("block:")) { ArrayList blkids = new ArrayList(); @@ -642,7 +657,7 @@ public class TexturePack { trans = BlockTransparency.valueOf(av[1]); if(trans == null) { trans = BlockTransparency.OPAQUE; - Log.severe("Texture mapping has invalid transparency setting - " + av[1] + " - line " + rdr.getLineNumber() + " of " + txtfile.getPath()); + Log.severe("Texture mapping has invalid transparency setting - " + av[1] + " - line " + rdr.getLineNumber() + " of " + txtname); } } } @@ -655,17 +670,17 @@ public class TexturePack { cnt++; } else { - Log.severe("Texture mapping missing required parameters = line " + rdr.getLineNumber() + " of " + txtfile.getPath()); + Log.severe("Texture mapping missing required parameters = line " + rdr.getLineNumber() + " of " + txtname); } } else if(line.startsWith("#") || line.startsWith(";")) { } } - Log.verboseinfo("Loaded " + cnt + " texture mappings from " + txtfile.getPath()); + Log.verboseinfo("Loaded " + cnt + " texture mappings from " + txtname); } catch (IOException iox) { - Log.severe("Error reading " + txtfile.getPath() + " - " + iox.toString()); + Log.severe("Error reading " + txtname + " - " + iox.toString()); } catch (NumberFormatException nfx) { - Log.severe("Format error - line " + rdr.getLineNumber() + " of " + txtfile.getPath()); + Log.severe("Format error - line " + rdr.getLineNumber() + " of " + txtname); } finally { if(rdr != null) { try { diff --git a/configuration.default b/src/main/resources/configuration.txt similarity index 100% rename from configuration.default rename to src/main/resources/configuration.txt diff --git a/src/main/resources/custom-lightings.txt b/src/main/resources/custom-lightings.txt new file mode 100644 index 00000000..6c569b80 --- /dev/null +++ b/src/main/resources/custom-lightings.txt @@ -0,0 +1,3 @@ +# The user is free to add new and custom lightings here, including replacements for standard ones +# Dynmap's install will not overwrite it +lightings: \ No newline at end of file diff --git a/src/main/resources/custom-perspectives.txt b/src/main/resources/custom-perspectives.txt new file mode 100644 index 00000000..fe32e169 --- /dev/null +++ b/src/main/resources/custom-perspectives.txt @@ -0,0 +1,3 @@ +# The user is free to add new and custom perspectives here, including replacements for standard ones +# Dynmap's install will not overwrite it +perspectives: diff --git a/src/main/resources/custom-shaders.txt b/src/main/resources/custom-shaders.txt new file mode 100644 index 00000000..27f14d41 --- /dev/null +++ b/src/main/resources/custom-shaders.txt @@ -0,0 +1,3 @@ +# The user is free to add new and custom shaders here, including replacements for standard ones +# Dynmap's install will not overwrite it +shaders: diff --git a/lightings.txt b/src/main/resources/lightings.txt similarity index 85% rename from lightings.txt rename to src/main/resources/lightings.txt index a47b6b8e..2d9c51dd 100644 --- a/lightings.txt +++ b/src/main/resources/lightings.txt @@ -1,6 +1,7 @@ +version: 0.20 # -# This file contains default standard lighting profiles. The contents of this file are replaced and updated -# during upgrades, so new or updated lighing definitions should be done in the custom-lightings.txt file +# This file contains default standard lighting profiles. The contents of this file CAN need to be replaced and updated +# during upgrades, so new or updated lighting definitions should be done in the custom-lightings.txt file # lightings: # Default lighting - no effects, shadows, day/night diff --git a/renderdata/models.txt b/src/main/resources/models.txt similarity index 100% rename from renderdata/models.txt rename to src/main/resources/models.txt diff --git a/perspectives.txt b/src/main/resources/perspectives.txt similarity index 98% rename from perspectives.txt rename to src/main/resources/perspectives.txt index ff489562..30961ee8 100644 --- a/perspectives.txt +++ b/src/main/resources/perspectives.txt @@ -1,5 +1,6 @@ +version: 0.20 # -# This file contains default standard perspective definitions. The contents of this file are replaced and updated +# This file contains default standard perspective definitions. The contents of this file CAN need to be replaced and updated # during upgrades, so new or updated perspective definitions should be done in the custom-perspectives.txt file # perspectives: diff --git a/shaders.txt b/src/main/resources/shaders.txt similarity index 100% rename from shaders.txt rename to src/main/resources/shaders.txt diff --git a/templates/nether-hires.txt b/src/main/resources/templates/nether-hires.txt similarity index 87% rename from templates/nether-hires.txt rename to src/main/resources/templates/nether-hires.txt index db7a5ff5..54d64e85 100644 --- a/templates/nether-hires.txt +++ b/src/main/resources/templates/nether-hires.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Nether" environment worlds (deftemplatesuffix="hires") # Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-nether-hires.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-nether-hires.txt' if you wish to customize it # templates: # Nether world template (HDMap hires) diff --git a/templates/nether-lowres.txt b/src/main/resources/templates/nether-lowres.txt similarity index 88% rename from templates/nether-lowres.txt rename to src/main/resources/templates/nether-lowres.txt index da5924ba..9bee3dc7 100644 --- a/templates/nether-lowres.txt +++ b/src/main/resources/templates/nether-lowres.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Nether" environment worlds (deftemplatesuffix="lowres") # Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-nether-lowres.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-nether-lowres.txt' if you wish to customize it # templates: # Nether world template (HDMap lowres) diff --git a/templates/nether.txt b/src/main/resources/templates/nether.txt similarity index 90% rename from templates/nether.txt rename to src/main/resources/templates/nether.txt index de315546..fcdc8144 100644 --- a/templates/nether.txt +++ b/src/main/resources/templates/nether.txt @@ -1,6 +1,8 @@ +version: 0.20 # # Default template for "Nether" environment worlds (deftemplatesuffix="") -# To customize without losing updates during upgrade, rename file to 'custom-nether.txt' +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-nether.txt' if you wish to customize it # templates: # Nether world template (classic render) diff --git a/templates/normal-hires.txt b/src/main/resources/templates/normal-hires.txt similarity index 88% rename from templates/normal-hires.txt rename to src/main/resources/templates/normal-hires.txt index d01a186e..dac90a77 100644 --- a/templates/normal-hires.txt +++ b/src/main/resources/templates/normal-hires.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Normal" environment worlds (deftemplatesuffix="lhires") # Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-normal-lowres.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-normal-hires.txt' if you wish to customize it # templates: # Template for normal world (HDMap hires) diff --git a/templates/normal-lowres.txt b/src/main/resources/templates/normal-lowres.txt similarity index 89% rename from templates/normal-lowres.txt rename to src/main/resources/templates/normal-lowres.txt index 0847e168..b1f775d6 100644 --- a/templates/normal-lowres.txt +++ b/src/main/resources/templates/normal-lowres.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Normal" environment worlds (deftemplatesuffix="lowres") # Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-normal-lowres.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-normal-lowres.txt' if you wish to customize it # templates: # Template for normal world (HDMap lowres) diff --git a/templates/normal.txt b/src/main/resources/templates/normal.txt similarity index 96% rename from templates/normal.txt rename to src/main/resources/templates/normal.txt index e2f2b058..d884bf0a 100644 --- a/templates/normal.txt +++ b/src/main/resources/templates/normal.txt @@ -1,6 +1,8 @@ +version: 0.20 # # Default template for "Normal" environment worlds (deftemplatesuffix="") -# To customize without losing updates during upgrade, rename file to 'custom-normal.txt' +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-normal.txt' if you wish to customize it # templates: # Template for normal world (classic render) diff --git a/templates/skylands-hires.txt b/src/main/resources/templates/skylands-hires.txt similarity index 89% rename from templates/skylands-hires.txt rename to src/main/resources/templates/skylands-hires.txt index 28668d41..eba47136 100644 --- a/templates/skylands-hires.txt +++ b/src/main/resources/templates/skylands-hires.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Skylands" environment worlds (deftemplatesuffix="hires") # Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-skylands-hires.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-skylands-hires.txt' if you wish to customize it # templates: # Skylands world template (HDMap hires) diff --git a/templates/skylands-lowres.txt b/src/main/resources/templates/skylands-lowres.txt similarity index 90% rename from templates/skylands-lowres.txt rename to src/main/resources/templates/skylands-lowres.txt index f326e9d0..d0559cc7 100644 --- a/templates/skylands-lowres.txt +++ b/src/main/resources/templates/skylands-lowres.txt @@ -1,8 +1,9 @@ +version: 0.20 # # Default template for "Skylands" environment worlds (deftemplatesuffix="lowres") # Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge) # -# To customize without losing updates during upgrade, rename file to 'custom-skylands-lowres.txt' +# This file MAY need to be replaced during an upgrade - rename file to 'custom-skylands-lowres.txt' if you wish to customize it # templates: # Skylands world template (HDMap lowres) diff --git a/templates/skylands.txt b/src/main/resources/templates/skylands.txt similarity index 91% rename from templates/skylands.txt rename to src/main/resources/templates/skylands.txt index b3d8e657..ac52cadf 100644 --- a/templates/skylands.txt +++ b/src/main/resources/templates/skylands.txt @@ -1,6 +1,8 @@ +version: 0.20 # # Default template for "Skylands" environment worlds (deftemplatesuffix="") -# To customize without losing updates during upgrade, rename file to 'custom-skylands.txt' +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-skylands.txt' if you wish to customize it # templates: # Skylands world template (classic render) diff --git a/renderdata/texture.txt b/src/main/resources/texture.txt similarity index 100% rename from renderdata/texture.txt rename to src/main/resources/texture.txt diff --git a/worlds.txt.sample b/src/main/resources/worlds.txt similarity index 93% rename from worlds.txt.sample rename to src/main/resources/worlds.txt index be93643b..1a5aa08a 100644 --- a/worlds.txt.sample +++ b/src/main/resources/worlds.txt @@ -1,8 +1,9 @@ -# These are examples of world-specific settings, which can be defined in the worlds.txt file +# These are examples of world-specific settings - customize your content as you see fit # -# NOTE: -# This file only contains samples: actual world customizations must be done in the worlds.txt file (or the worlds: section of -# configuration.txt). All lines here are commented with the # symbol - delete the # symbol on copied lines you wish to enable +# NOTES: +# All lines here are commented with the # symbol - delete the # symbol on copied lines you wish to enable +# Definitions of a world made here will superecede any world definition with the same name in configuration.txt +# Deleting this file will result in a fresh copy being produced by dynmap.jar on the next startup. # worlds: # Worlds can be handled by templates, based on world type