Compare commits

...

10 Commits

19 changed files with 135 additions and 47 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dynmap</groupId>
<artifactId>dynmap</artifactId>
<version>0.20</version>
<version>0.20.1</version>
<name>dynmap</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -242,8 +242,6 @@ public class IsoHDPerspective implements HDPerspective {
t = 0;
/* Compute number of steps and increments for each */
n = 1;
int mxout, myout, mzout;
/* If perpendicular to X axis */
if (dx == 0) {
@@ -552,9 +550,11 @@ public class IsoHDPerspective implements HDPerspective {
}
}
private boolean logit = false;
private boolean raytraceSubblock(short[] model, boolean firsttime) {
if(firsttime) {
mt = t + 0.0000001;
mt = t + 0.00000001;
xx = top.x + mt *(bottom.x - top.x);
yy = top.y + mt *(bottom.y - top.y);
zz = top.z + mt *(bottom.z - top.z);
@@ -583,7 +583,7 @@ public class IsoHDPerspective implements HDPerspective {
}
subalpha = -1;
boolean skip = !firsttime; /* Skip first block on continue */
while(mt < mtend) {
while(mt <= mtend) {
if(!skip) {
try {
int blkalpha = model[modscale*modscale*my + modscale*mz + mx];
@@ -605,8 +605,9 @@ public class IsoHDPerspective implements HDPerspective {
mt = mt_next_x;
mt_next_x += mdt_dx;
laststep = stepx;
if(mx == mxout)
if(mx == mxout) {
return true;
}
}
/* If Y step is next best */
else if((mt_next_y <= mt_next_x) && (mt_next_y <= mt_next_z)) {
@@ -614,8 +615,9 @@ public class IsoHDPerspective implements HDPerspective {
mt = mt_next_y;
mt_next_y += mdt_dy;
laststep = stepy;
if(my == myout)
if(my == myout) {
return true;
}
}
/* Else, Z step is next best */
else {
@@ -623,22 +625,28 @@ public class IsoHDPerspective implements HDPerspective {
mt = mt_next_z;
mt_next_z += mdt_dz;
laststep = stepz;
if(mz == mzout)
if(mz == mzout) {
return true;
}
}
}
return true;
}
public final int[] getSubblockCoord() {
double tt = t + 0.000001;
if(subalpha >= 0)
tt = mt;
double xx = top.x + tt * (bottom.x - top.x);
double yy = top.y + tt * (bottom.y - top.y);
double zz = top.z + tt * (bottom.z - top.z);
subblock_xyz[0] = (int)((xx - Math.floor(xx)) * modscale);
subblock_xyz[1] = (int)((yy - Math.floor(yy)) * modscale);
subblock_xyz[2] = (int)((zz - Math.floor(zz)) * modscale);
if(subalpha < 0) {
double tt = t + 0.0000001;
double xx = top.x + tt * (bottom.x - top.x);
double yy = top.y + tt * (bottom.y - top.y);
double zz = top.z + tt * (bottom.z - top.z);
subblock_xyz[0] = (int)((xx - Math.floor(xx)) * modscale);
subblock_xyz[1] = (int)((yy - Math.floor(yy)) * modscale);
subblock_xyz[2] = (int)((zz - Math.floor(zz)) * modscale);
}
else {
subblock_xyz[0] = mx;
subblock_xyz[1] = my;
subblock_xyz[2] = mz;
}
return subblock_xyz;
}
}
@@ -885,8 +885,11 @@ public class TexturePack {
}
private static final int biomeLookup(int[] argb, int width, double rainfall, double temp) {
int t = (int)((1.0-temp)*(width-1));
int h = width - (int)(temp*rainfall*(width-1)) - 1;
int w = width-1;
int t = (int)((1.0-temp)*w);
int h = (int)((1.0 - (temp*rainfall))*w);
if(h > w) h = w;
if(t > w) t = w;
return argb[width*h + t];
}
}
@@ -131,6 +131,7 @@ public class TexturePackHDShader implements HDShader {
if(blocktype == 0) {
return false;
}
/* Get color from textures */
scaledtp.readColor(ps, mapiter, c, blocktype, lastblocktype, do_biome_shading);
@@ -155,13 +156,14 @@ public class TexturePackHDShader implements HDShader {
/* Handle light level, if needed */
lighting.applyLighting(ps, this, c, tmpcolor);
/* If we got alpha from subblock model, use it instead if it is lower */
if(subalpha >= 0) {
for(Color clr : tmpcolor) {
int a = clr.getAlpha();
if(subalpha < a)
clr.setAlpha(subalpha);
}
}
/* (disable for now: weighting is wrong, as crosssection is 2D, not 3D based) */
// if(subalpha >= 0) {
// for(Color clr : tmpcolor) {
// int a = clr.getAlpha();
// if(subalpha < a)
// clr.setAlpha(subalpha);
// }
// }
/* If no previous color contribution, use new color */
if(color[0].isTransparent()) {
for(int i = 0; i < color.length; i++)
+1 -1
View File
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# This file contains default standard lighting profiles. The contents of this file CAN need to be replaced and updated
# during upgrades, so new or updated lighting definitions should be done in the custom-lightings.txt file
+19
View File
@@ -1908,3 +1908,22 @@ layer:7
# Ground lever, pff tp west
block:id=69,data=5,data=14,scale=16
rotate:id=69,data=6,rot=90
# Cactus
block:id=81,data=*,scale=16
layer:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
-*------------*-
****************
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
-**************-
****************
-*------------*-
+1 -1
View File
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# This file contains default standard perspective definitions. The contents of this file CAN need to be replaced and updated
# during upgrades, so new or updated perspective definitions should be done in the custom-perspectives.txt file
+50 -1
View File
@@ -1,6 +1,6 @@
name: dynmap
main: org.dynmap.DynmapPlugin
version: "0.20"
version: "0.20.1"
authors: [FrozenCow, mikeprimm, zeeZ]
softdepend: [Permissions]
commands:
@@ -21,3 +21,52 @@ commands:
/<command> stats world - Show render statistics for maps on world 'world'.
/<command> resetstats - Reset render statistics.
/<command> resetstats world - Reset render statistics for maps on world 'world'.
permissions:
dynmap.*:
description: Gives access to all dynmap functions
default: op
children:
dynmap.render: true
dynmap.show.self: true
dynmap.show.others: true
dynmap.hide.self: true
dynmap.hide.others: true
dynmap.fullrender: true
dynmap.radiusrender: true
dynmap.cancelrender: true
dynmap.reload: true
dynmap.stats: true
dynmap.resetstats: true
dynmap.render:
description: Allows /dynmap render command
default: true
dynmap.show.self:
description: Allows /dynmap show (on self)
default: true
dynmap.show.others:
description: Allows /dynmap show <player>
default: op
dynmap.hide.self:
description: Allows /dynmap hide (on self)
default: true
dynmap.hide.others:
description: Allows /dynmap hide <player>
default: op
dynmap.fullrender:
description: Allows /dynmap fullrender or /dynmap fullrender <world>
default: op
dynmap.radiusrender:
description: Allows /dynmap radiusrender
default: op
dynmap.cancelrender:
description: Allows /dynmap cancelrender <world>
default: op
dynmap.reload:
description: Allows /dynmap reload
default: op
dynmap.stats:
description: Allows /dynmap stats or /dynmap stats <world>
default: true
dynmap.resetstats:
description: Allows /dynmap resetstats or /dynmap resetstats <world>
default: op
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Nether" environment worlds (deftemplatesuffix="hires")
# Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge)
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Nether" environment worlds (deftemplatesuffix="lowres")
# Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge)
+1 -1
View File
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Nether" environment worlds (deftemplatesuffix="")
#
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Normal" environment worlds (deftemplatesuffix="lhires")
# Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge)
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Normal" environment worlds (deftemplatesuffix="lowres")
# Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge)
+1 -1
View File
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Normal" environment worlds (deftemplatesuffix="")
#
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Skylands" environment worlds (deftemplatesuffix="hires")
# Uses the HDMap renderer with view from the SE with the "hires" resolution (16 pixels per block edge)
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Skylands" environment worlds (deftemplatesuffix="lowres")
# Uses the HDMap renderer with view from the SE with the "lowres" resolution (4 pixels per block edge)
+1 -1
View File
@@ -1,4 +1,4 @@
version: 0.20
version: 0.20.1
#
# Default template for "Skylands" environment worlds (deftemplatesuffix="")
#
+5 -3
View File
@@ -48,11 +48,13 @@ block:id=17,data=1,allsides=116,top=21,bottom=21
# Wood (birch)
block:id=17,data=2,allsides=117,top=21,bottom=21
# Leaves (std)
block:id=18,data=0,allfaces=2052,transparency=TRANSPARENT
block:id=18,data=0,data=4,data=8,data=12,allfaces=2052,transparency=TRANSPARENT
# Leaves (spruce/pine)
block:id=18,data=1,allfaces=2132,transparency=TRANSPARENT
block:id=18,data=1,data=5,data=9,data=13,allfaces=2132,transparency=TRANSPARENT
# Leaves (birch)
block:id=18,data=2,allfaces=2052,transparency=TRANSPARENT
block:id=18,data=2,data=6,data=10,data=14,allfaces=2052,transparency=TRANSPARENT
# Leaves (std-alpha migrated?)
block:id=18,data=3,data=7,data=11,data=15,allfaces=2052,transparency=TRANSPARENT
# Sponge
block:id=19,allfaces=48
# Glass
+11 -6
View File
@@ -14,7 +14,7 @@ regionConstructors['WorldGuard'] = function(dynmap, configuration) {
return boxCreator(ArrayMax(xs), ArrayMin(xs), region['max-y'], region['min-y'], ArrayMax(zs), ArrayMin(zs));
}
if(!region.min || !region.max)
return [];
return null;
if(region.max.y <= region.min.y)
region.min.y = region.max.y - 1;
return boxCreator(region.max.x, region.min.x, region.max.y, region.min.y, region.max.z, region.min.z);
@@ -25,11 +25,16 @@ regionConstructors['WorldGuard'] = function(dynmap, configuration) {
$.getJSON('standalone/'+regionFile, function(data) {
var boxLayers = [];
$.each(data, function(name, region) {
var boxLayer = createBoxFromRegion(region, configuration.createBoxLayer);
boxLayer.bindPopup(configuration.createPopupContent(name, region));
boxLayers.push(boxLayer);
// Only handle cuboids for the moment (therefore skipping 'global')
if (region.type === 'cuboid') {
var boxLayer = createBoxFromRegion(region, configuration.createBoxLayer);
// Skip errorous regions.
if (boxLayer) {
boxLayer.bindPopup(configuration.createPopupContent(name, region));
boxLayers.push(boxLayer);
}
}
});
configuration.result(new L.LayerGroup(boxLayers));