Re-merge the nether render support, and update race condition fixes

This commit is contained in:
Mike Primm 2011-05-14 23:25:59 -05:00
parent 600dd00bcd
commit 0ffc825b05
9 changed files with 197 additions and 154 deletions

View file

@ -23,17 +23,29 @@ public class HighlightTileRenderer extends DefaultTileRenderer {
}
@Override
protected Color scan(World world, int x, int y, int z, int seq) {
protected Color scan(World world, int x, int y, int z, int seq, boolean isnether) {
Color result = translucent;
int top_nether_id = 0;
for (;;) {
if (y < 0) {
break;
}
int id = world.getBlockTypeIdAt(x, y, z);
if(isnether) { /* Make bedrock ceiling into air in nether */
if(id != 0) {
/* Remember first color we see, in case we wind up solid */
if(result == translucent)
if(colorScheme.colors[id] != null)
result = colorScheme.colors[id][seq];
id = 0;
}
else
isnether = false;
}
byte data = 0;
if(colorScheme.datacolors[id] != null) { /* If data colored */
data = world.getBlockAt(x, y, z).getData();
if(colorScheme.datacolors[id] != null) { /* If data colored */
data = world.getBlockAt(x, y, z).getData();
}
switch (seq) {
@ -56,9 +68,9 @@ public class HighlightTileRenderer extends DefaultTileRenderer {
if (id != 0) {
Color[] colors;
if(data != 0)
colors = colorScheme.datacolors[id][data];
colors = colorScheme.datacolors[id][data];
else
colors = colorScheme.colors[id];
colors = colorScheme.colors[id];
if (colors != null) {
Color c = colors[seq];