From fc88dfad41c3787feee1fd0c7185a14ddad9f928 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 28 May 2011 03:22:50 -0500 Subject: [PATCH] Fix boundary condition on height field - raw can be zero, function return value must not be. Also, fix debugger loading function. --- src/main/java/org/dynmap/CraftChunkSnapshot.java | 5 ++++- src/main/java/org/dynmap/DynmapPlugin.java | 2 +- src/main/java/org/dynmap/flat/FlatMap.java | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/dynmap/CraftChunkSnapshot.java b/src/main/java/org/dynmap/CraftChunkSnapshot.java index a11e8378..9d461533 100644 --- a/src/main/java/org/dynmap/CraftChunkSnapshot.java +++ b/src/main/java/org/dynmap/CraftChunkSnapshot.java @@ -20,6 +20,9 @@ public class CraftChunkSnapshot implements ChunkSnapshot { this.z = z; this.buf = buf; this.hmap = hmap; + for(int i = 0; i < 256; i++) + if(hmap[i] < 1) + hmap[i] = 1; } /** @@ -95,6 +98,6 @@ public class CraftChunkSnapshot implements ChunkSnapshot { } public int getHighestBlockYAt(int x, int z) { - return hmap[z << 4 | x] & 255; + return hmap[z << 4 | x] & 255; } } diff --git a/src/main/java/org/dynmap/DynmapPlugin.java b/src/main/java/org/dynmap/DynmapPlugin.java index 88760b5f..fe8642f2 100644 --- a/src/main/java/org/dynmap/DynmapPlugin.java +++ b/src/main/java/org/dynmap/DynmapPlugin.java @@ -261,7 +261,7 @@ public class DynmapPlugin extends JavaPlugin { for (ConfigurationNode debuggerConfiguration : debuggersConfiguration) { try { Class debuggerClass = Class.forName((String) debuggerConfiguration.getString("class")); - Constructor constructor = debuggerClass.getConstructor(JavaPlugin.class, Map.class); + Constructor constructor = debuggerClass.getConstructor(JavaPlugin.class, ConfigurationNode.class); Debugger debugger = (Debugger) constructor.newInstance(this, debuggerConfiguration); Debug.addDebugger(debugger); } catch (Exception e) { diff --git a/src/main/java/org/dynmap/flat/FlatMap.java b/src/main/java/org/dynmap/flat/FlatMap.java index 25e52a56..21011528 100644 --- a/src/main/java/org/dynmap/flat/FlatMap.java +++ b/src/main/java/org/dynmap/flat/FlatMap.java @@ -122,6 +122,7 @@ public class FlatMap extends MapType { mapiter.initialize(t.x * t.size + x, 127, t.y * t.size); for (int y = 0; y < t.size; y++, mapiter.incrementZ()) { int blockType; + mapiter.setY(127); if(isnether) { while((blockType = mapiter.getBlockTypeID()) != 0) { mapiter.decrementY();