Add 'fence-to-block-join' flag to enable 1.9+ fence rendering behavior
This commit is contained in:
parent
bdd3238498
commit
7345442479
3 changed files with 20 additions and 5 deletions
|
|
@ -84,6 +84,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||||
public Events events = new Events();
|
public Events events = new Events();
|
||||||
public String deftemplatesuffix = "";
|
public String deftemplatesuffix = "";
|
||||||
boolean swampshading = false;
|
boolean swampshading = false;
|
||||||
|
boolean fencejoin = false;
|
||||||
|
|
||||||
/* Flag to let code know that we're doing reload - make sure we don't double-register event handlers */
|
/* Flag to let code know that we're doing reload - make sure we don't double-register event handlers */
|
||||||
public boolean is_reload = false;
|
public boolean is_reload = false;
|
||||||
private boolean generate_only = false;
|
private boolean generate_only = false;
|
||||||
|
|
@ -251,6 +253,8 @@ public class DynmapPlugin extends JavaPlugin {
|
||||||
deftemplatesuffix = configuration.getString("deftemplatesuffix", "");
|
deftemplatesuffix = configuration.getString("deftemplatesuffix", "");
|
||||||
/* Default swamp shading off for 1.8, on after */
|
/* Default swamp shading off for 1.8, on after */
|
||||||
swampshading = configuration.getBoolean("swampshaded", !getServer().getVersion().contains("(MC: 1.8"));
|
swampshading = configuration.getBoolean("swampshaded", !getServer().getVersion().contains("(MC: 1.8"));
|
||||||
|
/* Default fence-to-block-join off for 1.8, on after */
|
||||||
|
fencejoin = configuration.getBoolean("fence-to-block-join", !getServer().getVersion().contains("(MC: 1.8"));
|
||||||
|
|
||||||
loadDebuggers();
|
loadDebuggers();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1144,7 +1144,11 @@ public class MapManager {
|
||||||
public boolean getSwampShading() {
|
public boolean getSwampShading() {
|
||||||
return plug_in.swampshading;
|
return plug_in.swampshading;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean getFenceJoin() {
|
||||||
|
return plug_in.fencejoin;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getHideOres() {
|
public boolean getHideOres() {
|
||||||
return hideores;
|
return hideores;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ public class IsoHDPerspective implements HDPerspective {
|
||||||
public double scale; /* Scale - tile pixel widths per block */
|
public double scale; /* Scale - tile pixel widths per block */
|
||||||
public double maxheight;
|
public double maxheight;
|
||||||
public double minheight;
|
public double minheight;
|
||||||
|
private boolean fencejoin;
|
||||||
/* Coordinate space for tiles consists of a plane (X, Y), corresponding to the projection of each tile on to the
|
/* Coordinate space for tiles consists of a plane (X, Y), corresponding to the projection of each tile on to the
|
||||||
* plane of the bottom of the world (X positive to the right, Y positive to the top), with Z+ corresponding to the
|
* plane of the bottom of the world (X positive to the right, Y positive to the top), with Z+ corresponding to the
|
||||||
* height above this plane on a vector towards the viewer). Logically, this makes the parallelogram representing the
|
* height above this plane on a vector towards the viewer). Logically, this makes the parallelogram representing the
|
||||||
|
|
@ -345,22 +346,26 @@ public class IsoHDPerspective implements HDPerspective {
|
||||||
int id;
|
int id;
|
||||||
/* Check north */
|
/* Check north */
|
||||||
id = mapiter.getBlockTypeIDAt(BlockStep.X_MINUS);
|
id = mapiter.getBlockTypeIDAt(BlockStep.X_MINUS);
|
||||||
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
|
if((id == blkid) || (id == FENCEGATE_BLKTYPEID) ||
|
||||||
|
(fencejoin && (id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) { /* Fence? */
|
||||||
blockdata |= 1;
|
blockdata |= 1;
|
||||||
}
|
}
|
||||||
/* Look east */
|
/* Look east */
|
||||||
id = mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS);
|
id = mapiter.getBlockTypeIDAt(BlockStep.Z_MINUS);
|
||||||
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
|
if((id == blkid) || (id == FENCEGATE_BLKTYPEID) ||
|
||||||
|
(fencejoin && (id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) { /* Fence? */
|
||||||
blockdata |= 2;
|
blockdata |= 2;
|
||||||
}
|
}
|
||||||
/* Look south */
|
/* Look south */
|
||||||
id = mapiter.getBlockTypeIDAt(BlockStep.X_PLUS);
|
id = mapiter.getBlockTypeIDAt(BlockStep.X_PLUS);
|
||||||
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
|
if((id == blkid) || (id == FENCEGATE_BLKTYPEID) ||
|
||||||
|
(fencejoin && (id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) { /* Fence? */
|
||||||
blockdata |= 4;
|
blockdata |= 4;
|
||||||
}
|
}
|
||||||
/* Look west */
|
/* Look west */
|
||||||
id = mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS);
|
id = mapiter.getBlockTypeIDAt(BlockStep.Z_PLUS);
|
||||||
if((id == blkid) || (id == FENCEGATE_BLKTYPEID)) { /* Fence? */
|
if((id == blkid) || (id == FENCEGATE_BLKTYPEID) ||
|
||||||
|
(fencejoin && (id > 0) && (HDTextureMap.getTransparency(id) == BlockTransparency.OPAQUE))) { /* Fence? */
|
||||||
blockdata |= 8;
|
blockdata |= 8;
|
||||||
}
|
}
|
||||||
return blockdata;
|
return blockdata;
|
||||||
|
|
@ -739,6 +744,8 @@ public class IsoHDPerspective implements HDPerspective {
|
||||||
if(maxheight > 127) maxheight = 127;
|
if(maxheight > 127) maxheight = 127;
|
||||||
minheight = configuration.getInteger("minimumheight", 0);
|
minheight = configuration.getInteger("minimumheight", 0);
|
||||||
if(minheight < 0) minheight = 0;
|
if(minheight < 0) minheight = 0;
|
||||||
|
/* Fence-to-block-join setting */
|
||||||
|
fencejoin = configuration.getBoolean("fence-to-block-join", MapManager.mapman.getFenceJoin());
|
||||||
|
|
||||||
/* Generate transform matrix for world-to-tile coordinate mapping */
|
/* Generate transform matrix for world-to-tile coordinate mapping */
|
||||||
/* First, need to fix basic coordinate mismatches before rotation - we want zero azimuth to have north to top
|
/* First, need to fix basic coordinate mismatches before rotation - we want zero azimuth to have north to top
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue