From c48d06eec111ae7ab062ed6a4845ee7849826d17 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 31 May 2011 21:20:23 -0500 Subject: [PATCH 1/6] Add file access synchronization to prevent conflicting tile updates --- src/main/java/org/dynmap/flat/FlatMap.java | 6 +- .../dynmap/kzedmap/DefaultTileRenderer.java | 9 ++ .../org/dynmap/utils/FileLockManager.java | 105 ++++++++++++++++++ .../org/dynmap/web/handlers/FileHandler.java | 7 +- .../web/handlers/FilesystemHandler.java | 10 ++ 5 files changed, 135 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/dynmap/utils/FileLockManager.java diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index 769e3509..1d641307 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -27,6 +27,7 @@ import org.dynmap.debug.Debug; import org.dynmap.kzedmap.KzedMap; import org.dynmap.kzedmap.KzedMap.KzedBufferedImage; import org.dynmap.MapChunkCache; +import org.dynmap.utils.FileLockManager; import org.json.simple.JSONObject; public class FlatMap extends MapType { @@ -236,6 +237,7 @@ public class FlatMap extends MapType { } } /* Test to see if we're unchanged from older tile */ + FileLockManager.getWriteLock(outputFile); TileHashManager hashman = MapManager.mapman.hashman; long crc = hashman.calculateTileHash(argb_buf); boolean tile_update = false; @@ -257,12 +259,13 @@ public class FlatMap extends MapType { Debug.debug("skipping image " + outputFile.getPath() + " - hash match"); } KzedMap.freeBufferedImage(im); + FileLockManager.releaseWriteLock(outputFile); MapManager.mapman.updateStatistics(tile, null, true, tile_update, !rendered); /* If day too, handle it */ if(night_and_day) { File dayfile = new File(outputFile.getParent(), tile.getDayFilename()); - + FileLockManager.getWriteLock(dayfile); crc = hashman.calculateTileHash(argb_buf_day); if((!dayfile.exists()) || (crc != hashman.getImageHashCode(tile.getKey(), "day", t.x, t.y))) { Debug.debug("saving image " + dayfile.getPath()); @@ -282,6 +285,7 @@ public class FlatMap extends MapType { tile_update = false; } KzedMap.freeBufferedImage(im_day); + FileLockManager.releaseWriteLock(dayfile); MapManager.mapman.updateStatistics(tile, "day", true, tile_update, !rendered); } diff --git a/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java b/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java index eb62f8ba..a7f6dbfd 100644 --- a/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java +++ b/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java @@ -20,6 +20,7 @@ import org.dynmap.TileHashManager; import org.dynmap.debug.Debug; import org.dynmap.MapChunkCache; import org.dynmap.kzedmap.KzedMap.KzedBufferedImage; +import org.dynmap.utils.FileLockManager; import org.json.simple.JSONObject; public class DefaultTileRenderer implements MapTileRenderer { @@ -228,6 +229,7 @@ public class DefaultTileRenderer implements MapTileRenderer { int oy = (mtile.py == zmtile.getTileY())?0:KzedMap.tileHeight/2; /* Test to see if we're unchanged from older tile */ + FileLockManager.getWriteLock(fname); TileHashManager hashman = MapManager.mapman.hashman; long crc = hashman.calculateTileHash(img.argb_buf); boolean updated_fname = false; @@ -245,6 +247,7 @@ public class DefaultTileRenderer implements MapTileRenderer { updated_fname = true; } KzedMap.freeBufferedImage(img); + FileLockManager.releaseWriteLock(fname); MapManager.mapman.updateStatistics(mtile, null, true, updated_fname, !rendered); mtile.file = fname; @@ -252,6 +255,7 @@ public class DefaultTileRenderer implements MapTileRenderer { boolean updated_dfname = false; File dfname = new File(fname.getParent(), mtile.getDayFilename()); if(img_day != null) { + FileLockManager.getWriteLock(dfname); crc = hashman.calculateTileHash(img.argb_buf); if((!dfname.exists()) || (crc != hashman.getImageHashCode(mtile.getKey(), "day", mtile.px, mtile.py))) { Debug.debug("saving image " + dfname.getPath()); @@ -267,12 +271,14 @@ public class DefaultTileRenderer implements MapTileRenderer { updated_dfname = true; } KzedMap.freeBufferedImage(img_day); + FileLockManager.releaseWriteLock(dfname); MapManager.mapman.updateStatistics(mtile, "day", true, updated_dfname, !rendered); } // Since we've already got the new tile, and we're on an async thread, just // make the zoomed tile here boolean ztile_updated = false; + FileLockManager.getWriteLock(zoomFile); if(updated_fname || (!zoomFile.exists())) { saveZoomedTile(zmtile, zoomFile, zimg, ox, oy); MapManager.mapman.pushUpdate(zmtile.getWorld(), @@ -280,11 +286,13 @@ public class DefaultTileRenderer implements MapTileRenderer { ztile_updated = true; } KzedMap.freeBufferedImage(zimg); + FileLockManager.releaseWriteLock(zoomFile); MapManager.mapman.updateStatistics(zmtile, null, true, ztile_updated, !rendered); if(zimg_day != null) { File zoomFile_day = new File(zoomFile.getParent(), zmtile.getDayFilename()); ztile_updated = false; + FileLockManager.getWriteLock(zoomFile_day); if(updated_dfname || (!zoomFile_day.exists())) { saveZoomedTile(zmtile, zoomFile_day, zimg_day, ox, oy); MapManager.mapman.pushUpdate(zmtile.getWorld(), @@ -292,6 +300,7 @@ public class DefaultTileRenderer implements MapTileRenderer { ztile_updated = true; } KzedMap.freeBufferedImage(zimg_day); + FileLockManager.releaseWriteLock(zoomFile_day); MapManager.mapman.updateStatistics(zmtile, "day", true, ztile_updated, !rendered); } } diff --git a/src/main/java/org/dynmap/utils/FileLockManager.java b/src/main/java/org/dynmap/utils/FileLockManager.java new file mode 100644 index 00000000..e6f5b7a4 --- /dev/null +++ b/src/main/java/org/dynmap/utils/FileLockManager.java @@ -0,0 +1,105 @@ +package org.dynmap.utils; +import java.io.File; +import java.util.HashMap; + +import org.dynmap.Log; +/** + * Implements soft-locks for prevent concurrency issues with file updates + */ +public class FileLockManager { + private static Object lock = new Object(); + private static HashMap filelocks = new HashMap(); + private static final Integer WRITELOCK = new Integer(-1); + /** + * Get write lock on file - exclusive lock, no other writers or readers + * @throws InterruptedException + */ + public static void getWriteLock(File f) { + String fn = f.getPath(); + synchronized(lock) { + boolean got_lock = false; + while(!got_lock) { + Integer lockcnt = filelocks.get(fn); /* Get lock count */ + if(lockcnt != null) { /* If any locks, can't get write lock */ + try { + lock.wait(); + } catch (InterruptedException ix) { + Log.severe("getWriteLock(" + fn + ") interrupted"); + } + } + else { + filelocks.put(fn, WRITELOCK); + got_lock = true; + } + } + } + //Log.info("getWriteLock(" + f + ")"); + } + /** + * Release write lock + */ + public static void releaseWriteLock(File f) { + String fn = f.getPath(); + synchronized(lock) { + Integer lockcnt = filelocks.get(fn); /* Get lock count */ + if(lockcnt == null) + Log.severe("releaseWriteLock(" + fn + ") on unlocked file"); + else if(lockcnt.equals(WRITELOCK)) { + filelocks.remove(fn); /* Remove lock */ + lock.notifyAll(); /* Wake up folks waiting for locks */ + } + else + Log.severe("releaseWriteLock(" + fn + ") on read-locked file"); + } + //Log.info("releaseWriteLock(" + f + ")"); + } + /** + * Get read lock on file - multiple readers allowed, blocks writers + */ + public static void getReadLock(File f) { + String fn = f.getPath(); + synchronized(lock) { + boolean got_lock = false; + while(!got_lock) { + Integer lockcnt = filelocks.get(fn); /* Get lock count */ + if(lockcnt == null) { + filelocks.put(fn, Integer.valueOf(1)); /* First lock */ + got_lock = true; + } + else if(!lockcnt.equals(WRITELOCK)) { /* Other read locks */ + filelocks.put(fn, Integer.valueOf(lockcnt+1)); + got_lock = true; + } + else { /* Write lock in place */ + try { + lock.wait(); + } catch (InterruptedException ix) { + Log.severe("getReadLock(" + fn + ") interrupted"); + } + } + } + } + //Log.info("getReadLock(" + f + ")"); + } + /** + * Release read lock + */ + public static void releaseReadLock(File f) { + String fn = f.getPath(); + synchronized(lock) { + Integer lockcnt = filelocks.get(fn); /* Get lock count */ + if(lockcnt == null) + Log.severe("releaseReadLock(" + fn + ") on unlocked file"); + else if(lockcnt.equals(WRITELOCK)) + Log.severe("releaseReadLock(" + fn + ") on write-locked file"); + else if(lockcnt > 1) { + filelocks.put(fn, Integer.valueOf(lockcnt-1)); + } + else { + filelocks.remove(fn); /* Remove lock */ + lock.notifyAll(); /* Wake up folks waiting for locks */ + } + } + //Log.info("releaseReadLock(" + f + ")"); + } +} diff --git a/src/main/java/org/dynmap/web/handlers/FileHandler.java b/src/main/java/org/dynmap/web/handlers/FileHandler.java index 9c6a2daa..439f78e2 100644 --- a/src/main/java/org/dynmap/web/handlers/FileHandler.java +++ b/src/main/java/org/dynmap/web/handlers/FileHandler.java @@ -13,6 +13,7 @@ import org.dynmap.web.HttpHandler; import org.dynmap.web.HttpRequest; import org.dynmap.web.HttpResponse; import org.dynmap.web.HttpStatus; +import org.dynmap.utils.FileLockManager; public abstract class FileHandler implements HttpHandler { protected static final Logger log = Logger.getLogger("Minecraft"); @@ -42,6 +43,10 @@ public abstract class FileHandler implements HttpHandler { } protected abstract InputStream getFileInput(String path, HttpRequest request, HttpResponse response); + + protected void closeFileInput(String path, InputStream in) throws IOException { + in.close(); + } protected String getExtension(String path) { int dotindex = path.lastIndexOf('.'); @@ -113,7 +118,7 @@ public abstract class FileHandler implements HttpHandler { } finally { freeReadBuffer(readBuffer); } - fileInput.close(); + closeFileInput(path, fileInput); } catch (Exception e) { if (fileInput != null) { try { fileInput.close(); } catch (IOException ex) { } diff --git a/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java b/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java index fa630c37..de4e0091 100644 --- a/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java +++ b/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java @@ -3,8 +3,10 @@ package org.dynmap.web.handlers; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; +import org.dynmap.utils.FileLockManager; import org.dynmap.web.HttpField; import org.dynmap.web.HttpRequest; import org.dynmap.web.HttpResponse; @@ -20,6 +22,7 @@ public class FilesystemHandler extends FileHandler { @Override protected InputStream getFileInput(String path, HttpRequest request, HttpResponse response) { File file = new File(root, path); + FileLockManager.getReadLock(file); if (file.getAbsolutePath().startsWith(root.getAbsolutePath()) && file.isFile()) { FileInputStream result; try { @@ -30,6 +33,13 @@ public class FilesystemHandler extends FileHandler { response.fields.put(HttpField.ContentLength, Long.toString(file.length())); return result; } + FileLockManager.releaseReadLock(file); return null; } + protected void closeFileInput(String path, InputStream in) throws IOException { + super.closeFileInput(path, in); + File file = new File(root, path); + FileLockManager.releaseReadLock(file); + } + } From c4646dc299c8bec55fc1a2afe563a07c5c12470f Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 31 May 2011 23:44:17 -0500 Subject: [PATCH 2/6] Add transparency option on Flat and Surface map, fix file locks --- src/main/java/org/dynmap/flat/FlatMap.java | 98 +++++++++++++++++-- .../dynmap/kzedmap/DefaultTileRenderer.java | 8 +- .../org/dynmap/utils/FileLockManager.java | 2 +- .../org/dynmap/web/handlers/FileHandler.java | 8 +- .../web/handlers/FilesystemHandler.java | 1 + 5 files changed, 102 insertions(+), 15 deletions(-) diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index 1d641307..e3b44ae5 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -38,7 +38,8 @@ public class FlatMap extends MapType { private int ambientlight = 15;; private int shadowscale[] = null; private boolean night_and_day; /* If true, render both day (prefix+'-day') and night (prefix) tiles */ - + protected boolean transparency; + public FlatMap(ConfigurationNode configuration) { this.configuration = configuration; prefix = (String) configuration.get("prefix"); @@ -69,6 +70,7 @@ public class FlatMap extends MapType { ambientlight = Integer.parseInt(String.valueOf(o)); } night_and_day = configuration.getBoolean("night-and-day", false); + transparency = configuration.getBoolean("transparency", false); /* Default off */ } @Override @@ -115,8 +117,8 @@ public class FlatMap extends MapType { boolean rendered = false; Color rslt = new Color(); - int[] pixel = new int[3]; - int[] pixel_day = new int[3]; + int[] pixel = new int[4]; + int[] pixel_day = null; KzedBufferedImage im = KzedMap.allocateBufferedImage(t.size, t.size); int[] argb_buf = im.argb_buf; KzedBufferedImage im_day = null; @@ -124,6 +126,7 @@ public class FlatMap extends MapType { if(night_and_day) { im_day = KzedMap.allocateBufferedImage(t.size, t.size); argb_buf_day = im_day.argb_buf; + pixel_day = new int[4]; } MapChunkCache.MapIterator mapiter = cache.getIterator(t.x * t.size, 127, t.y * t.size); for (int x = 0; x < t.size; x++) { @@ -178,20 +181,27 @@ public class FlatMap extends MapType { pixel[0] = c.getRed(); pixel[1] = c.getGreen(); pixel[2] = c.getBlue(); - + pixel[3] = c.getAlpha(); + + /* If transparency needed, process it */ + if(transparency && (pixel[3] < 255)) { + process_transparent(pixel, pixel_day, mapiter); + } /* If ambient light less than 15, do scaling */ - if((shadowscale != null) && (ambientlight < 15)) { + else if((shadowscale != null) && (ambientlight < 15)) { if(mapiter.y < 127) mapiter.incrementY(); if(night_and_day) { /* Use unscaled color for day (no shadows from above) */ pixel_day[0] = pixel[0]; pixel_day[1] = pixel[1]; pixel_day[2] = pixel[2]; + pixel_day[3] = 255; } int light = Math.max(ambientlight, mapiter.getBlockEmittedLight()); pixel[0] = (pixel[0] * shadowscale[light]) >> 8; pixel[1] = (pixel[1] * shadowscale[light]) >> 8; pixel[2] = (pixel[2] * shadowscale[light]) >> 8; + pixel[3] = 255; } else { /* Only do height keying if we're not messing with ambient light */ boolean below = mapiter.y < 64; @@ -215,22 +225,25 @@ public class FlatMap extends MapType { pixel[0] -= pixel[0] * scale; pixel[1] -= pixel[1] * scale; pixel[2] -= pixel[2] * scale; + pixel[3] = 255; } else { pixel[0] += (255-pixel[0]) * scale; pixel[1] += (255-pixel[1]) * scale; pixel[2] += (255-pixel[2]) * scale; + pixel[3] = 255; } if(night_and_day) { pixel_day[0] = pixel[0]; pixel_day[1] = pixel[1]; pixel_day[2] = pixel[2]; + pixel_day[3] = 255; } } - rslt.setRGBA(pixel[0], pixel[1], pixel[2], 255); + rslt.setRGBA(pixel[0], pixel[1], pixel[2], pixel[3]); argb_buf[(t.size-y-1) + (x*t.size)] = rslt.getARGB(); if(night_and_day) { - rslt.setRGBA(pixel_day[0], pixel_day[1], pixel_day[2], 255); + rslt.setRGBA(pixel_day[0], pixel_day[1], pixel_day[2], pixel[3]); argb_buf_day[(t.size-y-1) + (x*t.size)] = rslt.getARGB(); } rendered = true; @@ -291,7 +304,76 @@ public class FlatMap extends MapType { return rendered; } - + private void process_transparent(int[] pixel, int[] pixel_day, MapChunkCache.MapIterator mapiter) { + int r = pixel[0], g = pixel[1], b = pixel[2], a = pixel[3]; + int r_day = 0, g_day = 0, b_day = 0, a_day = 0; + if(pixel_day != null) { + r_day = pixel[0]; g_day = pixel[1]; b_day = pixel[2]; a_day = pixel[3]; + } + /* Handle lighting on cube */ + if((shadowscale != null) && (ambientlight < 15)) { + boolean did_inc = false; + if(mapiter.y < 127) { + mapiter.incrementY(); + did_inc = true; + } + if(night_and_day) { /* Use unscaled color for day (no shadows from above) */ + r_day = r; g_day = g; b_day = b; a_day = a; + } + int light = Math.max(ambientlight, mapiter.getBlockEmittedLight()); + r = (r * shadowscale[light]) >> 8; + g = (g * shadowscale[light]) >> 8; + b = (b * shadowscale[light]) >> 8; + if(did_inc) + mapiter.decrementY(); + } + if(a < 255) { /* If not opaque */ + pixel[0] = pixel[1] = pixel[2] = pixel[3] = 0; + if(pixel_day != null) + pixel_day[0] = pixel_day[1] = pixel_day[2] = pixel_day[3] = 0; + mapiter.decrementY(); + if(mapiter.y >= 0) { + int blockType = mapiter.getBlockTypeID(); + int data = 0; + Color[] colors = colorScheme.colors[blockType]; + if(colorScheme.datacolors[blockType] != null) { + data = mapiter.getBlockData(); + colors = colorScheme.datacolors[blockType][data]; + } + if (colors != null) { + Color c = colors[0]; + if (c != null) { + pixel[0] = c.getRed(); + pixel[1] = c.getGreen(); + pixel[2] = c.getBlue(); + pixel[3] = c.getAlpha(); + /* Recurse to resolve color here */ + process_transparent(pixel, pixel_day, mapiter); + } + } + } + } + /* Blend colors from behind block and block, based on alpha */ + r *= a; + g *= a; + b *= a; + int na = 255 - a; + pixel[0] = (pixel[0] * na + r) >> 8; + pixel[1] = (pixel[1] * na + g) >> 8; + pixel[2] = (pixel[2] * na + b) >> 8; + pixel[3] = 255; + if(pixel_day != null) { + r_day *= a_day; + g_day *= a_day; + b_day *= a_day; + na = 255 - a_day; + pixel_day[0] = (pixel_day[0] * na + r_day) >> 8; + pixel_day[1] = (pixel_day[1] * na + g_day) >> 8; + pixel_day[2] = (pixel_day[2] * na + b_day) >> 8; + pixel_day[3] = 255; + } + } + public String getName() { return prefix; } diff --git a/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java b/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java index a7f6dbfd..1180b8a8 100644 --- a/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java +++ b/src/main/java/org/dynmap/kzedmap/DefaultTileRenderer.java @@ -36,6 +36,7 @@ public class DefaultTileRenderer implements MapTileRenderer { protected int shadowscale[]; /* index=skylight level, value = 256 * scaling value */ protected int lightscale[]; /* scale skylight level (light = lightscale[skylight] */ protected boolean night_and_day; /* If true, render both day (prefix+'-day') and night (prefix) tiles */ + protected boolean transparency; /* Is transparency support active? */ @Override public String getName() { return name; @@ -78,6 +79,7 @@ public class DefaultTileRenderer implements MapTileRenderer { } colorScheme = ColorScheme.getScheme((String)configuration.get("colorscheme")); night_and_day = configuration.getBoolean("night-and-day", false); + transparency = configuration.getBoolean("transparency", true); /* Default on */ } public boolean render(MapChunkCache cache, KzedMapTile tile, File outputFile) { @@ -438,10 +440,10 @@ public class DefaultTileRenderer implements MapTileRenderer { if (colors != null) { Color c = colors[seq]; if (c.getAlpha() > 0) { - /* we found something that isn't transparent! */ - if (c.getAlpha() == 255) { + /* we found something that isn't transparent, or not doing transparency */ + if ((!transparency) || (c.getAlpha() == 255)) { /* it's opaque - the ray ends here */ - result.setColor(c); + result.setARGB(c.getARGB() | 0xFF000000); if(lightlevel < 15) { /* Not full light? */ shadowColor(result, lightlevel); } diff --git a/src/main/java/org/dynmap/utils/FileLockManager.java b/src/main/java/org/dynmap/utils/FileLockManager.java index e6f5b7a4..c60efcf5 100644 --- a/src/main/java/org/dynmap/utils/FileLockManager.java +++ b/src/main/java/org/dynmap/utils/FileLockManager.java @@ -72,7 +72,7 @@ public class FileLockManager { } else { /* Write lock in place */ try { - lock.wait(); + lock.wait(); } catch (InterruptedException ix) { Log.severe("getReadLock(" + fn + ") interrupted"); } diff --git a/src/main/java/org/dynmap/web/handlers/FileHandler.java b/src/main/java/org/dynmap/web/handlers/FileHandler.java index 439f78e2..9ee75128 100644 --- a/src/main/java/org/dynmap/web/handlers/FileHandler.java +++ b/src/main/java/org/dynmap/web/handlers/FileHandler.java @@ -113,15 +113,17 @@ public abstract class FileHandler implements HttpHandler { out.write(readBuffer, 0, readBytes); } } catch (IOException e) { - fileInput.close(); throw e; } finally { freeReadBuffer(readBuffer); + if(fileInput != null) { + closeFileInput(path, fileInput); + fileInput = null; + } } - closeFileInput(path, fileInput); } catch (Exception e) { if (fileInput != null) { - try { fileInput.close(); } catch (IOException ex) { } + try { closeFileInput(path, fileInput); fileInput = null; } catch (IOException ex) { } } throw e; } diff --git a/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java b/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java index de4e0091..50a82e25 100644 --- a/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java +++ b/src/main/java/org/dynmap/web/handlers/FilesystemHandler.java @@ -28,6 +28,7 @@ public class FilesystemHandler extends FileHandler { try { result = new FileInputStream(file); } catch (FileNotFoundException e) { + FileLockManager.releaseReadLock(file); return null; } response.fields.put(HttpField.ContentLength, Long.toString(file.length())); From 19984946ac91c5f5351873c212f365fe7ddd0e96 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 31 May 2011 23:49:04 -0500 Subject: [PATCH 3/6] Add transparency samples to configuration.txt --- configuration.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configuration.txt b/configuration.txt index cfee3852..a633bb96 100644 --- a/configuration.txt +++ b/configuration.txt @@ -130,6 +130,8 @@ templates: # To render a world as a "night view", set shadowstrength and ambientlight # shadowstrength: 1.0 # ambientlight: 4 + # Option to turn on transparency support (off by default) - slows render + # transparency: true - class: org.dynmap.kzedmap.KzedMap renderers: - class: org.dynmap.kzedmap.DefaultTileRenderer @@ -144,6 +146,8 @@ templates: # ambientlight: 4 # To render both night and day versions of tiles (when ambientlight is set), set true # night-and-day: true + # Option to turn off transparency support (on by default) - speeds render + # transparency: false # Sets the icon to 'images/block_custom.png' # icon: custom #- class: org.dynmap.kzedmap.HighlightTileRenderer @@ -214,6 +218,8 @@ worlds: # # To render a world as a "night view", set shadowstrength and ambientlight # # shadowstrength: 1.0 # # ambientlight: 4 + # # Option to turn on transparency support (off by default) - slows render + # # transparency: true # - class: org.dynmap.kzedmap.KzedMap # renderers: # - class: org.dynmap.kzedmap.DefaultTileRenderer @@ -228,6 +234,8 @@ worlds: # # ambientlight: 4 # # To render both night and day versions of tiles (when ambientlight is set), set true # # night-and-day: true + # # Option to turn off transparency support (on by default) - speeds render + # # transparency: false # # Sets the icon to 'images/block_custom.png' # # icon: custom # #- class: org.dynmap.kzedmap.HighlightTileRenderer From 4af247593d88408a556cfe3a46cbea34f37736b9 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 1 Jun 2011 00:12:27 -0500 Subject: [PATCH 4/6] Improve transparency processing on flat map --- src/main/java/org/dynmap/flat/FlatMap.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index e3b44ae5..ba9189f9 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -347,10 +347,10 @@ public class FlatMap extends MapType { pixel[1] = c.getGreen(); pixel[2] = c.getBlue(); pixel[3] = c.getAlpha(); - /* Recurse to resolve color here */ - process_transparent(pixel, pixel_day, mapiter); } } + /* Recurse to resolve color here */ + process_transparent(pixel, pixel_day, mapiter); } } /* Blend colors from behind block and block, based on alpha */ From 68a78023c88b74c209909e6c79ccd695423a0a7f Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 1 Jun 2011 01:50:57 -0500 Subject: [PATCH 5/6] Add new block IDs, remove obsolete ones from colorschemes --- colorschemes/default.txt | 59 +++++++++++++--------- colorschemes/flames.txt | 59 +++++++++++++--------- colorschemes/ovocean.txt | 59 +++++++++++++--------- colorschemes/sk89q.txt | 31 +++++++++++- src/main/java/org/dynmap/flat/FlatMap.java | 3 ++ 5 files changed, 134 insertions(+), 77 deletions(-) diff --git a/colorschemes/default.txt b/colorschemes/default.txt index 0684873b..21c93019 100644 --- a/colorschemes/default.txt +++ b/colorschemes/default.txt @@ -8,7 +8,7 @@ Cobblestone 4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Wooden Plank 5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 -Sappling +Sapling 6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0 Bedrock 7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255 @@ -48,24 +48,18 @@ Sandstone 24 218 210 158 255 174 168 126 255 109 105 79 255 87 84 63 255 Note Block 25 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 -Aqua Green Cloth -26 43 192 117 255 38 168 101 255 34 150 90 255 29 130 78 255 -Cyan Cloth -27 43 192 192 255 36 185 185 255 29 130 130 255 22 99 99 255 -Blue Cloth -28 0 0 255 255 0 0 204 255 0 0 127 255 0 0 102 255 -Purple Cloth -29 101 101 188 255 95 95 175 255 86 86 160 255 78 78 145 255 -Indigo Cloth -30 113 41 186 255 99 38 165 255 85 32 142 255 72 27 119 255 -Violet Cloth -31 156 65 198 255 132 55 168 255 112 47 142 255 84 35 107 255 -Magenta Cloth -32 187 42 187 255 160 36 160 255 135 31 135 255 112 25 112 255 -Pink Cloth -33 192 43 117 255 168 38 103 255 142 32 87 255 127 29 78 255 -Black Cloth -34 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 +Bed +26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255 +Powered Rail +27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Detector Rail +28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Cobweb +30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255 +Tall Grass +31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255 +Dead Shrubs +32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255 Wool 35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255 35:0 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255 @@ -99,8 +93,6 @@ Wool - Red 35:14 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255 Wool - Black 35:15 24 20 20 255 19 16 16 255 12 10 10 255 9 8 8 255 -Gray Cloth -36 125 125 125 255 114 114 114 255 104 104 104 255 86 86 86 255 Yellow Flower 37 255 255 0 255 204 204 0 255 127 127 0 255 102 102 0 255 Red Rose @@ -136,7 +128,7 @@ Brick TNT 46 160 83 65 255 128 66 52 255 80 41 32 255 64 33 26 255 Bookshelf -54 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 +47 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 Moss Stone 48 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Obsidian @@ -151,7 +143,8 @@ Wooden Stair 53 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 Chest 54 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 - +Redstone Wire +55 240 30 30 64 160 20 20 64 120 15 15 64 100 12 12 64 Diamond Ore 56 129 140 143 255 103 112 114 255 64 70 71 255 51 56 57 255 Diamond Block @@ -176,10 +169,16 @@ Minecart Tracks 66 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 Cobblestone Stairs 67 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 - +Wall Sign +68 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Lever +69 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Stone Pressure Plate +70 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Iron Door 71 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255 - +Wooden Pressure Plate +72 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 Redstone Ore 73 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255 Glowing Redstone Ore @@ -188,6 +187,8 @@ Redstone Torch off 75 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 Redstone Torch on 76 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Stone Button +77 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Snow 78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255 Ice @@ -218,3 +219,11 @@ Jack-o-lantern 91 255 115 0 255 204 92 0 255 126 57 0 255 102 46 0 255 Cake Block 92 234 234 234 255 210 210 210 255 203 203 203 255 190 190 190 255 +Redstone Repeater off +93 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 +Redstone Repeater on +94 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Locked Chest +95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 +Trap Door +96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 diff --git a/colorschemes/flames.txt b/colorschemes/flames.txt index 8dccb7eb..af440b79 100644 --- a/colorschemes/flames.txt +++ b/colorschemes/flames.txt @@ -8,7 +8,7 @@ Cobblestone 4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Wooden Plank 5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 -Sappling +Sapling 6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0 Bedrock 7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255 @@ -48,24 +48,18 @@ Sandstone 24 192 178 110 255 160 148 92 255 134 124 77 255 160 148 92 255 Note Block 25 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 -Aqua Green Cloth -26 43 192 117 255 38 168 101 255 34 150 90 255 29 130 78 255 -Cyan Cloth -27 43 192 192 255 36 185 185 255 29 130 130 255 22 99 99 255 -Blue Cloth -28 0 0 255 255 0 0 204 255 0 0 127 255 0 0 102 255 -Purple Cloth -29 101 101 188 255 95 95 175 255 86 86 160 255 78 78 145 255 -Indigo Cloth -30 113 41 186 255 99 38 165 255 85 32 142 255 72 27 119 255 -Violet Cloth -31 156 65 198 255 132 55 168 255 112 47 142 255 84 35 107 255 -Magenta Cloth -32 187 42 187 255 160 36 160 255 135 31 135 255 112 25 112 255 -Pink Cloth -33 192 43 117 255 168 38 103 255 142 32 87 255 127 29 78 255 -Black Cloth -34 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 +Bed +26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255 +Powered Rail +27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Detector Rail +28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Cobweb +30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255 +Tall Grass +31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255 +Dead Shrubs +32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255 Wool 35 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255 35:0 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255 @@ -99,8 +93,6 @@ Wool - Red 35:14 159 45 38 255 157 44 38 255 131 37 32 255 157 44 38 255 Wool - Black 35:15 26 23 22 255 26 23 21 255 22 19 18 255 26 23 21 255 -Gray Cloth -36 125 125 125 255 114 114 114 255 104 104 104 255 86 86 86 255 Yellow Flower 37 255 255 0 255 204 204 0 255 127 127 0 255 102 102 0 255 Red Rose @@ -136,7 +128,7 @@ Brick TNT 46 160 83 65 255 128 66 52 255 80 41 32 255 64 33 26 255 Bookshelf -54 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 +47 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 Moss Stone 48 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Obsidian @@ -151,7 +143,8 @@ Wooden Stair 53 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 Chest 54 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 - +Redstone Wire +55 240 30 30 64 160 20 20 64 120 15 15 64 100 12 12 64 Diamond Ore 56 129 140 143 255 103 112 114 255 64 70 71 255 51 56 57 255 Diamond Block @@ -176,10 +169,16 @@ Minecart Tracks 66 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 Cobblestone Stairs 67 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 - +Wall Sign +68 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Lever +69 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Stone Pressure Plate +70 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Iron Door 71 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255 - +Wooden Pressure Plate +72 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 Redstone Ore 73 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255 Glowing Redstone Ore @@ -188,6 +187,8 @@ Redstone Torch off 75 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 Redstone Torch on 76 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Stone Button +77 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Snow 78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255 Ice @@ -218,3 +219,11 @@ Jack-o-lantern 91 255 115 0 255 204 92 0 255 126 57 0 255 102 46 0 255 Cake Block 92 234 234 234 255 210 210 210 255 203 203 203 255 190 190 190 255 +Redstone Repeater off +93 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 +Redstone Repeater on +94 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Locked Chest +95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 +Trap Door +96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 diff --git a/colorschemes/ovocean.txt b/colorschemes/ovocean.txt index 36474f09..d401eeba 100644 --- a/colorschemes/ovocean.txt +++ b/colorschemes/ovocean.txt @@ -8,7 +8,7 @@ Cobblestone 4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Wooden Plank 5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 -Sappling +Sapling 6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0 Bedrock 7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255 @@ -48,24 +48,18 @@ Sandstone 24 214 182 111 255 203 171 100 255 186 154 83 255 173 141 70 255 Note Block 25 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 -Aqua Green Cloth -26 43 192 117 255 38 168 101 255 34 150 90 255 29 130 78 255 -Cyan Cloth -27 43 192 192 255 36 185 185 255 29 130 130 255 22 99 99 255 -Blue Cloth -28 0 0 255 255 0 0 204 255 0 0 127 255 0 0 102 255 -Purple Cloth -29 101 101 188 255 95 95 175 255 86 86 160 255 78 78 145 255 -Indigo Cloth -30 113 41 186 255 99 38 165 255 85 32 142 255 72 27 119 255 -Violet Cloth -31 156 65 198 255 132 55 168 255 112 47 142 255 84 35 107 255 -Magenta Cloth -32 187 42 187 255 160 36 160 255 135 31 135 255 112 25 112 255 -Pink Cloth -33 192 43 117 255 168 38 103 255 142 32 87 255 127 29 78 255 -Black Cloth -34 0 0 0 255 0 0 0 255 0 0 0 255 0 0 0 255 +Bed +26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255 +Powered Rail +27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Detector Rail +28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +Cobweb +30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255 +Tall Grass +31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255 +Dead Shrubs +32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255 Wool 35 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255 35:0 222 222 222 255 177 177 177 255 111 111 111 255 88 88 88 255 @@ -99,8 +93,6 @@ Wool - Red 35:14 143 39 36 255 114 31 28 255 71 20 18 255 57 16 14 255 Wool - Black 35:15 24 20 20 255 19 16 16 255 12 10 10 255 9 8 8 255 -Gray Cloth -36 125 125 125 255 114 114 114 255 104 104 104 255 86 86 86 255 Yellow Flower 37 255 255 0 255 204 204 0 255 127 127 0 255 102 102 0 255 Red Rose @@ -136,7 +128,7 @@ Brick TNT 46 160 83 65 255 128 66 52 255 80 41 32 255 64 33 26 255 Bookshelf -54 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 +47 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 Moss Stone 48 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Obsidian @@ -151,7 +143,8 @@ Wooden Stair 53 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 Chest 54 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 - +Redstone Wire +55 240 30 30 64 160 20 20 64 120 15 15 64 100 12 12 64 Diamond Ore 56 129 140 143 255 103 112 114 255 64 70 71 255 51 56 57 255 Diamond Block @@ -176,10 +169,16 @@ Minecart Tracks 66 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 Cobblestone Stairs 67 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 - +Wall Sign +68 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Lever +69 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +Stone Pressure Plate +70 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Iron Door 71 191 191 191 255 152 152 152 255 95 95 95 255 76 76 76 255 - +Wooden Pressure Plate +72 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 Redstone Ore 73 131 107 107 255 104 85 85 255 65 53 53 255 52 42 42 255 Glowing Redstone Ore @@ -188,6 +187,8 @@ Redstone Torch off 75 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 Redstone Torch on 76 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Stone Button +77 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Snow 78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255 Ice @@ -218,3 +219,11 @@ Jack-o-lantern 91 255 115 0 255 204 92 0 255 126 57 0 255 102 46 0 255 Cake Block 92 234 234 234 255 210 210 210 255 203 203 203 255 190 190 190 255 +Redstone Repeater off +93 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 +Redstone Repeater on +94 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +Locked Chest +95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 +Trap Door +96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 diff --git a/colorschemes/sk89q.txt b/colorschemes/sk89q.txt index 4b052513..23854832 100644 --- a/colorschemes/sk89q.txt +++ b/colorschemes/sk89q.txt @@ -15,8 +15,19 @@ 16 56 60 70 255 46 50 58 255 39 42 49 255 46 50 58 255 17 119 97 74 255 99 81 62 255 83 68 52 255 99 81 62 255 18 27 69 37 180 22 57 31 180 19 48 25 180 22 57 31 180 +19 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255 20 178 217 223 90 148 181 186 90 124 151 155 90 148 181 186 90 +21 23 68 196 255 18 56 158 255 14 43 122 255 14 43 78 255 +22 23 68 196 255 18 56 158 255 14 43 122 255 14 43 78 255 +23 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255 24 192 178 110 255 160 148 92 255 134 124 77 255 160 148 92 255 +25 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 +26 200 20 20 255 160 16 16 255 100 10 10 255 80 8 8 255 +27 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +28 150 134 102 180 120 107 81 180 75 67 51 180 60 53 40 180 +30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255 +31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255 +32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255 35 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255 35:0 247 255 239 255 244 251 236 255 204 210 197 255 244 251 236 255 35:1 227 128 52 255 224 126 51 255 187 105 42 255 224 126 51 255 @@ -34,7 +45,6 @@ 35:13 54 77 22 255 54 76 22 255 45 63 19 255 54 76 22 255 35:14 159 45 38 255 157 44 38 255 131 37 32 255 157 44 38 255 35:15 26 23 22 255 26 23 21 255 22 19 18 255 26 23 21 255 -36 0 0 0 254 0 0 0 254 0 0 0 254 0 0 0 254 37 73 108 60 254 61 90 50 254 51 75 42 254 61 90 50 254 38 84 139 187 254 70 116 155 254 59 97 130 254 70 116 155 254 39 184 144 0 254 153 119 0 254 128 100 0 254 153 119 0 254 @@ -53,6 +63,7 @@ 44:3 118 112 96 255 98 93 80 255 82 78 67 255 98 93 80 255 45 230 103 73 255 192 86 61 255 160 71 50 255 192 86 61 255 46 255 79 30 255 231 72 27 255 193 60 22 255 231 72 27 255 +47 125 91 38 192 100 72 30 192 62 45 19 192 50 36 15 192 48 96 108 70 255 80 90 58 255 67 75 49 255 80 90 58 255 49 83 67 83 255 69 56 69 255 58 47 58 255 69 56 69 255 50 255 203 58 200 255 203 58 200 212 169 48 200 255 203 58 200 @@ -73,11 +84,16 @@ 65 144 128 99 32 120 106 82 32 100 89 69 32 120 106 82 32 66 113 109 102 180 94 91 85 180 79 76 71 180 94 91 85 180 67 115 107 93 255 96 89 78 255 80 75 65 255 96 89 78 255 +68 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +69 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +70 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 71 255 255 255 255 229 229 229 255 191 191 191 255 229 229 229 255 +72 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 73 174 107 107 255 145 89 89 255 121 75 75 255 145 89 89 255 74 174 107 107 255 145 89 89 255 121 75 75 255 145 89 89 255 75 255 140 61 254 217 119 52 254 181 99 43 254 217 119 52 254 76 255 0 0 254 255 0 0 254 212 0 0 254 255 0 0 254 +77 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 78 237 248 255 254 237 248 255 254 198 207 212 254 237 248 255 254 79 166 222 255 55 166 222 255 55 139 185 212 55 166 222 255 55 80 237 248 255 255 237 248 255 255 198 207 212 255 237 248 255 255 @@ -85,4 +101,15 @@ 82 234 240 255 255 216 221 235 255 180 185 196 255 216 221 235 255 83 136 167 74 255 114 139 62 255 95 116 52 255 114 139 62 255 84 116 97 80 255 97 81 67 255 81 68 55 255 97 81 67 255 -85 115 99 63 255 96 82 52 255 80 69 44 255 96 82 52 255 \ No newline at end of file +85 115 99 63 255 96 82 52 255 80 69 44 255 96 82 52 255 +86 255 115 0 200 204 92 0 200 126 57 0 200 102 46 0 200 +87 166 89 89 255 141 80 62 255 135 15 15 255 96 6 6 255 +88 133 109 94 255 121 97 82 255 90 70 57 255 79 59 46 255 +89 249 212 156 255 255 188 94 255 192 143 70 255 122 91 44 255 +90 140 0 196 128 120 0 196 128 140 0 196 128 120 0 196 128 +91 255 115 0 255 204 92 0 255 126 57 0 255 102 46 0 255 +92 234 234 234 255 210 210 210 255 203 203 203 255 190 190 190 255 +93 159 127 80 255 72 56 25 0 181 140 64 255 144 112 51 0 +94 159 127 80 255 102 0 0 0 255 0 0 255 204 0 0 0 +95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 +96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 \ No newline at end of file diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index ba9189f9..1704e66c 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -310,6 +310,9 @@ public class FlatMap extends MapType { if(pixel_day != null) { r_day = pixel[0]; g_day = pixel[1]; b_day = pixel[2]; a_day = pixel[3]; } + /* Scale alpha to be proportional to iso view (where we go through 4 blocks to go sqrt(6) or 2.45 units of distance */ + if(a < 255) + a = a_day = 255 - ((255-a)*(255-a) >> 8); /* Handle lighting on cube */ if((shadowscale != null) && (ambientlight < 15)) { boolean did_inc = false; From 28ccb2ae71c567550eafbd7dd7faa392a7df0439 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 1 Jun 2011 14:18:24 -0500 Subject: [PATCH 6/6] Incorporate ovocean's updates, plus fix for bad bookshelf ID --- colorschemes/ovocean.txt | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/colorschemes/ovocean.txt b/colorschemes/ovocean.txt index d401eeba..fd889dba 100644 --- a/colorschemes/ovocean.txt +++ b/colorschemes/ovocean.txt @@ -1,27 +1,27 @@ Stone -1 119 104 84 255 104 95 80 255 96 87 72 255 77 68 53 255 +1 149 145 138 255 125 122 116 255 114 111 105 255 88 85 81 255 Grass -2 75 156 43 255 56 117 32 255 35 104 10 255 32 82 0 255 +2 111 185 79 255 86 158 53 255 65 131 40 255 57 105 21 255 Dirt -3 134 96 67 255 107 76 53 255 67 48 33 255 68 49 33 255 +3 174 133 106 255 152 113 82 255 136 102 74 255 93 73 57 255 Cobblestone 4 115 115 115 255 92 92 92 255 57 57 57 255 46 46 46 255 Wooden Plank 5 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 -Sapling +Sappling 6 120 120 120 0 96 96 96 0 60 60 60 0 48 48 48 0 Bedrock 7 84 84 84 255 67 67 67 255 42 42 42 255 33 33 33 255 Water -8 21 88 125 80 7 70 117 80 6 68 115 80 5 53 90 80 +8 47 116 160 80 40 100 138 80 33 92 129 80 26 74 103 80 Stationary Water -9 21 88 125 80 7 70 117 80 6 68 115 80 5 53 90 80 +9 47 116 160 80 40 100 138 80 33 92 129 80 26 74 103 80 Lava 10 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255 Stationary Lava 11 255 90 0 255 204 72 0 255 127 45 0 255 102 36 0 255 Sand -12 214 182 111 255 203 171 100 255 186 154 83 255 173 141 70 255 +12 251 240 193 255 251 223 157 255 237 202 135 255 200 168 107 255 Gravel 13 136 126 126 255 108 100 100 255 68 63 63 255 54 50 50 255 Gold Ore @@ -33,7 +33,7 @@ Coal Ore Wood 17 102 81 51 255 81 64 40 255 51 40 25 255 40 32 20 255 Leaves -18 23 68 6 100 12 56 0 100 6 52 0 100 0 42 0 100 +18 47 99 32 255 34 86 20 255 24 66 14 255 23 57 13 255 Sponge 19 193 193 65 255 174 174 47 255 97 97 5 255 76 76 20 255 Glass @@ -45,7 +45,7 @@ Lapis Lazuli Block Dispenser 23 96 96 96 255 76 76 76 255 48 48 48 255 38 38 38 255 Sandstone -24 214 182 111 255 203 171 100 255 186 154 83 255 173 141 70 255 +24 251 240 193 255 251 223 157 255 237 202 135 255 200 168 107 255 Note Block 25 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 Bed @@ -57,7 +57,7 @@ Detector Rail Cobweb 30 138 145 145 255 110 115 115 255 69 72 72 255 55 57 57 255 Tall Grass -31 97 156 53 255 73 120 38 255 38 68 16 255 26 50 9 255 +31 111 185 79 255 86 158 53 255 65 131 40 255 57 105 21 255 Dead Shrubs 32 75 44 24 255 60 35 19 255 37 22 12 255 30 18 10 255 Wool @@ -109,7 +109,7 @@ Double Stone Slab 43 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255 43:0 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255 Double Stone Slab - Sandstone -43:1 214 182 111 255 203 171 100 255 186 154 83 255 173 141 70 255 +43:1 218 210 158 255 174 168 126 255 109 105 79 255 87 84 63 255 Double Stone Slab - Wood 43:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 Double Stone Slab - Cobblestone @@ -118,7 +118,7 @@ Stone Slab 44 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255 44:0 200 200 200 255 160 160 160 255 100 100 100 255 80 80 80 255 Stone Slab - Sandstone -44:1 214 182 111 255 203 171 100 255 186 154 83 255 173 141 70 255 +44:1 218 210 158 255 174 168 126 255 109 105 79 255 87 84 63 255 Stone Slab - Wood 44:2 157 128 79 255 125 102 63 255 78 64 39 255 62 51 31 255 Stone Slab - Cobblestone @@ -134,7 +134,7 @@ Moss Stone Obsidian 49 26 11 43 255 20 8 34 255 13 5 21 255 10 4 17 255 Torch -50 159 127 80 255 98 88 20 0 245 220 50 255 196 176 40 0 +50 103 80 45 255 98 88 20 0 255 249 79 255 196 176 40 0 Fire 51 255 170 30 200 204 136 24 200 127 85 15 200 102 68 12 200 Monster Spawner @@ -190,9 +190,9 @@ Redstone Torch on Stone Button 77 120 120 120 255 96 96 96 255 60 60 60 255 48 48 48 255 Snow -78 255 255 255 255 204 204 204 255 127 127 127 255 102 102 102 255 +78 255 255 255 255 252 253 253 255 198 220 225 255 129 179 190 255 Ice -79 83 113 163 51 66 90 130 51 41 56 81 51 33 45 65 51 +79 182 211 235 150 164 189 211 150 138 177 211 150 128 165 196 150 Snow Block 80 250 250 250 255 200 200 200 255 125 125 125 255 100 100 100 255 Cactus @@ -227,3 +227,4 @@ Locked Chest 95 125 91 38 255 100 72 30 255 62 45 19 255 50 36 15 255 Trap Door 96 111 91 54 255 88 72 43 255 55 45 27 255 44 36 21 255 +