From fc824013b7e598353cc4e91c85f06fa465b80f0c Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 21 Nov 2011 19:25:11 -0600 Subject: [PATCH] Add support and templates for "The End" --- src/main/java/org/dynmap/DynmapPlugin.java | 3 +- .../org/dynmap/utils/NewMapChunkCache.java | 27 +++++++------ .../resources/templates/the_end-hires.txt | 35 +++++++++++++++++ .../resources/templates/the_end-lowres.txt | 37 ++++++++++++++++++ .../resources/templates/the_end-vlowres.txt | 37 ++++++++++++++++++ src/main/resources/templates/the_end.txt | 34 ++++++++++++++++ web/images/block_the_end.png | Bin 0 -> 1062 bytes 7 files changed, 160 insertions(+), 13 deletions(-) create mode 100644 src/main/resources/templates/the_end-hires.txt create mode 100644 src/main/resources/templates/the_end-lowres.txt create mode 100644 src/main/resources/templates/the_end-vlowres.txt create mode 100644 src/main/resources/templates/the_end.txt create mode 100644 web/images/block_the_end.png diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index 150e1024..7d62ba77 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -168,7 +168,8 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI { /* 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", "skylands-hires.txt", - "normal-vlowres.txt", "skylands-vlowres.txt", "nether-vlowres.txt" + "normal-vlowres.txt", "skylands-vlowres.txt", "nether-vlowres.txt", "the_end.txt", "the_end-vlowres.txt", + "the_end-lowres.txt", "the_end-hires.txt" }; private static final String CUSTOM_PREFIX = "custom-"; diff --git a/src/main/java/org/dynmap/utils/NewMapChunkCache.java b/src/main/java/org/dynmap/utils/NewMapChunkCache.java index 2e3451f3..271ebd88 100644 --- a/src/main/java/org/dynmap/utils/NewMapChunkCache.java +++ b/src/main/java/org/dynmap/utils/NewMapChunkCache.java @@ -95,13 +95,13 @@ public class NewMapChunkCache implements MapChunkCache { public final int getHighestBlockYAt() { return snap.getHighestBlockYAt(bx, bz); } - public final int getBlockSkyLight() { + public int getBlockSkyLight() { return snap.getBlockSkyLight(bx, y, bz); } public final int getBlockEmittedLight() { return snap.getBlockEmittedLight(bx, y, bz); } - public Biome getBiome() { + public final Biome getBiome() { return snap.getBiome(bx, bz); } public double getRawBiomeTemperature() { @@ -234,6 +234,15 @@ public class NewMapChunkCache implements MapChunkCache { } } + private class OurEndMapIterator extends OurMapIterator { + + OurEndMapIterator(int x0, int y0, int z0) { + super(x0, y0, z0); + } + public final int getBlockSkyLight() { + return 15; + } + } /** * Chunk cache for representing unloaded chunk (or air) */ @@ -377,9 +386,6 @@ public class NewMapChunkCache implements MapChunkCache { @SuppressWarnings({ "unchecked", "rawtypes" }) public void setChunks(World w, List chunks) { this.w = w; - //if(w.getEnvironment() != Environment.NORMAL) { - // biome = biomeraw = false; - //} this.chunks = chunks; if(poppreservedchunk == null) { /* Get CraftWorld.popPreservedChunk(x,z) - reduces memory bloat from map traversals (optional) */ @@ -658,6 +664,8 @@ public class NewMapChunkCache implements MapChunkCache { * Get cache iterator */ public MapIterator getIterator(int x, int y, int z) { + if(w.getEnvironment().toString().equals("THE_END")) + return new OurEndMapIterator(x, y, z); return new OurMapIterator(x, y, z); } /** @@ -726,13 +734,8 @@ public class NewMapChunkCache implements MapChunkCache { } @Override public boolean setChunkDataTypes(boolean blockdata, boolean biome, boolean highestblocky, boolean rawbiome) { -// if((w != null) && (w.getEnvironment() != Environment.NORMAL)) { -// this.biome = this.biomeraw = false; -// } -// else { - this.biome = biome; - this.biomeraw = rawbiome; -// } + this.biome = biome; + this.biomeraw = rawbiome; this.highesty = highestblocky; this.blockdata = blockdata; return true; diff --git a/src/main/resources/templates/the_end-hires.txt b/src/main/resources/templates/the_end-hires.txt new file mode 100644 index 00000000..0a97d0ba --- /dev/null +++ b/src/main/resources/templates/the_end-hires.txt @@ -0,0 +1,35 @@ +version: 0.20 +# +# Default template for "The End" environment worlds (deftemplatesuffix="hires") +# Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge) +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-the_end-hires.txt' if you wish to customize it +# +templates: + # The End world template (HDMap hires) + the_end-hires: + enabled: true + # Number of extra zoom-out levels for world (each level is twice as big as the previous one) + extrazoomout: 2 + #center: + # x: 0 + # y: 64 + # z: 0 + maps: + - class: org.dynmap.hdmap.HDMap + name: flat + title: "Flat" + prefix: flat + perspective: iso_S_90_lowres + shader: stdtexture + lighting: brightnight + mapzoomin: 1 + - class: org.dynmap.hdmap.HDMap + name: the_end + title: "Surface" + prefix: st + perspective: iso_SE_30_hires + shader: stdtexture + lighting: brightnight + mapzoomin: 1 + \ No newline at end of file diff --git a/src/main/resources/templates/the_end-lowres.txt b/src/main/resources/templates/the_end-lowres.txt new file mode 100644 index 00000000..43a3c18d --- /dev/null +++ b/src/main/resources/templates/the_end-lowres.txt @@ -0,0 +1,37 @@ +version: 0.20 +# +# Default template for "The End" environment worlds (deftemplatesuffix="lowres") +# Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge) +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-the_end-lowres.txt' if you wish to customize it +# +templates: + # The End world template (HDMap lowres) + the_end-lowres: + enabled: true + # Number of extra zoom-out levels for world (each level is twice as big as the previous one) + extrazoomout: 2 + #center: + # x: 0 + # y: 64 + # z: 0 + maps: + - class: org.dynmap.hdmap.HDMap + name: flat + title: "Flat" + prefix: flat + perspective: iso_S_90_lowres + shader: stdtexture + lighting: brightnight + # Adjust extra zoom in levels - default is 2 + mapzoomin: 2 + - class: org.dynmap.hdmap.HDMap + name: the_end + title: "Surface" + prefix: st + perspective: iso_SE_60_lowres + shader: stdtexture + lighting: brightnight + # Adjust extra zoom in levels - default is 2 + mapzoomin: 2 + \ No newline at end of file diff --git a/src/main/resources/templates/the_end-vlowres.txt b/src/main/resources/templates/the_end-vlowres.txt new file mode 100644 index 00000000..563a923a --- /dev/null +++ b/src/main/resources/templates/the_end-vlowres.txt @@ -0,0 +1,37 @@ +version: 0.24 +# +# Default template for "The End" environment worlds (deftemplatesuffix="vlowres") +# Uses the HDMap renderer with view from the SE with the "vlowres" resolution (2 pixels per block edge) +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-the_end-vlowres.txt' if you wish to customize it +# +templates: + # The End world template (HDMap vlowres) + the_end-vlowres: + enabled: true + # Number of extra zoom-out levels for world (each level is twice as big as the previous one) + extrazoomout: 2 + #center: + # x: 0 + # y: 64 + # z: 0 + maps: + - class: org.dynmap.hdmap.HDMap + name: flat + title: "Flat" + prefix: flat + perspective: iso_S_90_vlowres + shader: stdtexture + lighting: brightnight + # Adjust extra zoom in levels - default is 2 + mapzoomin: 2 + - class: org.dynmap.hdmap.HDMap + name: the_end + title: "Surface" + prefix: st + perspective: iso_SE_60_vlowres + shader: stdtexture + lighting: brightnight + # Adjust extra zoom in levels - default is 2 + mapzoomin: 2 + \ No newline at end of file diff --git a/src/main/resources/templates/the_end.txt b/src/main/resources/templates/the_end.txt new file mode 100644 index 00000000..c37f1b6e --- /dev/null +++ b/src/main/resources/templates/the_end.txt @@ -0,0 +1,34 @@ +version: 0.20 +# +# Default template for "The End" environment worlds (deftemplatesuffix="") +# +# This file MAY need to be replaced during an upgrade - rename file to 'custom-the_end.txt' if you wish to customize it +# +templates: + # The End world template (classic render) + the_end: + enabled: true + # # If bigworld set to true, use alternate directory layout better suited to large worlds + # bigworld: true + # # Number of extra zoom-out levels for world (each level is twice as big as the previous one) + # extrazoomout: 3 + #center: + # x: 0 + # y: 64 + # z: 0 + maps: + - class: org.dynmap.flat.FlatMap + name: flat + title: "Flat" + prefix: flat + colorscheme: default + # The textured setting makes the flat render toning much more consistent with the other maps: set to 'none' for the original flat texture, 'smooth' for blended tile top colors, 'dither' for dither pattern + textured: smooth + - class: org.dynmap.kzedmap.KzedMap + renderers: + - class: org.dynmap.kzedmap.DefaultTileRenderer + name: the_end + title: "Surface" + prefix: st + maximumheight: 127 + colorscheme: default diff --git a/web/images/block_the_end.png b/web/images/block_the_end.png new file mode 100644 index 0000000000000000000000000000000000000000..69bcc329dcd335f99ea67f7d590ff54ec24f128a GIT binary patch literal 1062 zcmV+>1ljwEP)4Tx0C)j~RNrgUP!#^!Wu36$i#lf!2|j3%Ze&w*L!7p2SGvtw>Nd9_NSmf@ zT$;ut?S8Na*^6&F#dq-sKKTa>*@JI;k`2ZbVfd_wB24xov!0tYO(#d#()tZ$I5%3%!zLYh@BH>w}XODA7?mkV}ap}jU$$3 zG&Mk)3Bm`(LOM&hKscCb;PVaG&Vdx+MpZJHTQ(R_;DA31$+jOGBoLXk_De?ey1m!ik&_4G zH9n^))_*|$z4!HUisgBd@awc5jn(v9k~&t~+vLrrBg4dZQ9lDnLV}JQWGLW~LJVP= zW5lZXOcog;N~F?hbX0k=IMzETla}oqM|jC!4!B+x^;@#I_Tc-T-6hwKycLDTx1-om z?X`jFy0R0R8-I0SrK4`)H@W4T8*Qr#2vPou<*`U!Wy(*2QP*`g=8#jD{B;Y@GL-Hm zb`n?&x~%YC_$q7)PlXr4m%r4=&fcvN%Ybn#KC7Nn&Bp8{(oE9pWVpYI^+LuN`H(R~ zTAjWmO`M83^4d@fCkA(d>*nHIFV_d2yUbnT`nd?LE^;G|!WZ>Ld?E0@Grm4ww{M7H zr`x{MWb30bTI;*hk-DO>dX$gbC-yy#suLNqvA(f>RtPJ!qGM`Gvvf}Y10`)vm-7Xa z?-7Ixe2A_siI1ydSCCID3U8SVUY86>uSnT0use_K1GZDvUFKY)t}F* z)!pahe+zh{{06Bb3f97*Uorpy0K-W{K~y*qWBmXBKLajs^U)lzq`F)RBQ75p(N#{%k#mRM^07+ gNx}@mrV*wF0O;&eZ!%I$umAu607*qoM6N<$f{kqJEC2ui literal 0 HcmV?d00001