mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-09-18 17:11:02 +02:00
Fix boundary condition on height field - raw can be zero, function
return value must not be. Also, fix debugger loading function.
This commit is contained in:
parent
340da29e18
commit
fc88dfad41
@ -20,6 +20,9 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
this.z = z;
|
this.z = z;
|
||||||
this.buf = buf;
|
this.buf = buf;
|
||||||
this.hmap = hmap;
|
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) {
|
public int getHighestBlockYAt(int x, int z) {
|
||||||
return hmap[z << 4 | x] & 255;
|
return hmap[z << 4 | x] & 255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ public class DynmapPlugin extends JavaPlugin {
|
|||||||
for (ConfigurationNode debuggerConfiguration : debuggersConfiguration) {
|
for (ConfigurationNode debuggerConfiguration : debuggersConfiguration) {
|
||||||
try {
|
try {
|
||||||
Class<?> debuggerClass = Class.forName((String) debuggerConfiguration.getString("class"));
|
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);
|
Debugger debugger = (Debugger) constructor.newInstance(this, debuggerConfiguration);
|
||||||
Debug.addDebugger(debugger);
|
Debug.addDebugger(debugger);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -122,6 +122,7 @@ public class FlatMap extends MapType {
|
|||||||
mapiter.initialize(t.x * t.size + x, 127, t.y * t.size);
|
mapiter.initialize(t.x * t.size + x, 127, t.y * t.size);
|
||||||
for (int y = 0; y < t.size; y++, mapiter.incrementZ()) {
|
for (int y = 0; y < t.size; y++, mapiter.incrementZ()) {
|
||||||
int blockType;
|
int blockType;
|
||||||
|
mapiter.setY(127);
|
||||||
if(isnether) {
|
if(isnether) {
|
||||||
while((blockType = mapiter.getBlockTypeID()) != 0) {
|
while((blockType = mapiter.getBlockTypeID()) != 0) {
|
||||||
mapiter.decrementY();
|
mapiter.decrementY();
|
||||||
|
Loading…
Reference in New Issue
Block a user