From 57ea6aefd6bf0f9af7ebfcc03bde032a95ae26fb Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Mon, 11 Jul 2011 09:37:03 -0500 Subject: [PATCH] Fix biome rendering --- src/main/java/org/dynmap/MapTile.java | 8 ++++---- src/main/java/org/dynmap/flat/FlatMap.java | 4 +++- src/main/java/org/dynmap/hdmap/IsoHDPerspective.java | 10 +++++++--- src/main/java/org/dynmap/kzedmap/KzedMapTile.java | 6 ++++++ .../java/org/dynmap/kzedmap/KzedZoomedMapTile.java | 5 +++++ 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/dynmap/MapTile.java b/src/main/java/org/dynmap/MapTile.java index 1b7f6ee3..3e32fd72 100644 --- a/src/main/java/org/dynmap/MapTile.java +++ b/src/main/java/org/dynmap/MapTile.java @@ -46,9 +46,9 @@ public abstract class MapTile { public abstract String getKey(); - public boolean isBiomeDataNeeded() { return false; } - public boolean isHightestBlockYDataNeeded() { return false; } - public boolean isRawBiomeDataNeeded() { return false; } - public boolean isBlockTypeDataNeeded() { return true; } + public abstract boolean isBiomeDataNeeded(); + public abstract boolean isHightestBlockYDataNeeded(); + public abstract boolean isRawBiomeDataNeeded(); + public abstract boolean isBlockTypeDataNeeded(); } diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index 1ada2645..293a8109 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -498,7 +498,9 @@ public class FlatMap extends MapType { } public boolean isHightestBlockYDataNeeded() { return true; } - + public boolean isBiomeDataNeeded() { return false; } + public boolean isRawBiomeDataNeeded() { return false; } + public boolean isBlockTypeDataNeeded() { return true; } } @Override diff --git a/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java b/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java index 5b6a5320..63db00e2 100644 --- a/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java +++ b/src/main/java/org/dynmap/hdmap/IsoHDPerspective.java @@ -330,9 +330,13 @@ public class IsoHDPerspective implements HDPerspective { } double mtend = Math.min(t_next_x, Math.min(t_next_y, t_next_z)); while(mt < mtend) { - if(model[modscale*modscale*my + modscale*mz + mx] > 0) { - return false; - } + try { + if(model[modscale*modscale*my + modscale*mz + mx] > 0) { + return false; + } + } catch (ArrayIndexOutOfBoundsException aioobx) { /* We're outside the model, so miss */ + return true; + } /* If X step is next best */ if((mt_next_x <= mt_next_y) && (mt_next_x <= mt_next_z)) { mx += x_inc; diff --git a/src/main/java/org/dynmap/kzedmap/KzedMapTile.java b/src/main/java/org/dynmap/kzedmap/KzedMapTile.java index 1070b202..24c25a23 100644 --- a/src/main/java/org/dynmap/kzedmap/KzedMapTile.java +++ b/src/main/java/org/dynmap/kzedmap/KzedMapTile.java @@ -86,4 +86,10 @@ public class KzedMapTile extends MapTile { public MapTile[] getAdjecentTiles() { return map.getAdjecentTiles(this); } + + public boolean isBiomeDataNeeded() { return map.isBiomeDataNeeded(); } + public boolean isHightestBlockYDataNeeded() { return false; } + public boolean isRawBiomeDataNeeded() { return map.isRawBiomeDataNeeded(); } + public boolean isBlockTypeDataNeeded() { return true; } + } diff --git a/src/main/java/org/dynmap/kzedmap/KzedZoomedMapTile.java b/src/main/java/org/dynmap/kzedmap/KzedZoomedMapTile.java index 897d2038..04edfc4b 100644 --- a/src/main/java/org/dynmap/kzedmap/KzedZoomedMapTile.java +++ b/src/main/java/org/dynmap/kzedmap/KzedZoomedMapTile.java @@ -98,4 +98,9 @@ public class KzedZoomedMapTile extends MapTile { return null; } + public boolean isBiomeDataNeeded() { return originalTile.isBiomeDataNeeded(); } + public boolean isHightestBlockYDataNeeded() { return false; } + public boolean isRawBiomeDataNeeded() { return originalTile.isRawBiomeDataNeeded(); } + public boolean isBlockTypeDataNeeded() { return true; } + }