First pass of custom renderer support

This commit is contained in:
Mike Primm 2012-11-19 15:56:55 -06:00
parent a39f99cab8
commit 3a57261120

View File

@ -24,6 +24,9 @@ import org.dynmap.DynmapCore;
import org.dynmap.DynmapWorld; import org.dynmap.DynmapWorld;
import org.dynmap.Log; import org.dynmap.Log;
import org.dynmap.common.BiomeMap; import org.dynmap.common.BiomeMap;
import org.dynmap.hdmap.HDBlockModels;
import org.dynmap.hdmap.HDBlockModels.HDBlockModel;
import org.dynmap.renderer.RenderPatchFactory;
import org.dynmap.utils.MapChunkCache; import org.dynmap.utils.MapChunkCache;
import org.dynmap.utils.MapIterator; import org.dynmap.utils.MapIterator;
import org.dynmap.utils.BlockStep; import org.dynmap.utils.BlockStep;
@ -543,6 +546,43 @@ public class NewMapChunkCache implements MapChunkCache {
return !isSectionNotEmpty[chunkindex][y >> 4]; return !isSectionNotEmpty[chunkindex][y >> 4];
} }
} }
@Override
public RenderPatchFactory getPatchFactory() {
return HDBlockModels.getPatchDefinitionFactory();
}
@Override
public Object getBlockTileEntityField(String fieldId) {
return null;
}
@Override
public int getBlockTypeIDAt(int xoff, int yoff, int zoff) {
int xx = this.x + xoff;
int yy = this.y + yoff;
int zz = this.z + zoff;
int idx = ((xx >> 4) - x_min) + (((zz >> 4) - z_min) * x_dim);
try {
return snaparray[idx].getBlockTypeId(xx & 0xF, yy, zz & 0xF);
} catch (Exception x) {
return 0;
}
}
@Override
public int getBlockDataAt(int xoff, int yoff, int zoff) {
int xx = this.x + xoff;
int yy = this.y + yoff;
int zz = this.z + zoff;
int idx = ((xx >> 4) - x_min) + (((zz >> 4) - z_min) * x_dim);
try {
return snaparray[idx].getBlockData(xx & 0xF, yy, zz & 0xF);
} catch (Exception x) {
return 0;
}
}
@Override
public Object getBlockTileEntityFieldAt(String fieldId, int xoff,
int yoff, int zoff) {
return null;
}
} }
private class OurEndMapIterator extends OurMapIterator { private class OurEndMapIterator extends OurMapIterator {