Fix incorrect transparency handling on copyblock: texture handling

This commit is contained in:
Mike Primm 2019-12-08 00:59:19 -06:00
parent 1be9f663c7
commit 24bb87d635
2 changed files with 8 additions and 6 deletions

View File

@ -97,7 +97,7 @@ public class HDBlockStateTextureMap {
if ((this.blockset != null) && (this.blockset.equals("core") == false)) {
HDBlockModels.resetIfNotBlockSet(bs, this.blockset);
}
copyToStateIndex(bs, this);
copyToStateIndex(bs, this, null);
}
}
else { // Else, loop over all state IDs for given block
@ -110,7 +110,7 @@ public class HDBlockStateTextureMap {
if ((this.blockset != null) && (this.blockset.equals("core") == false)) {
HDBlockModels.resetIfNotBlockSet(bs, this.blockset);
}
copyToStateIndex(bs, this);
copyToStateIndex(bs, this, null);
}
}
}
@ -144,9 +144,11 @@ public class HDBlockStateTextureMap {
return m;
}
// Copy given block state to given state index
public static void copyToStateIndex(DynmapBlockState blk, HDBlockStateTextureMap map) {
public static void copyToStateIndex(DynmapBlockState blk, HDBlockStateTextureMap map, TexturePack.BlockTransparency trans) {
resize(blk.globalStateIndex);
TexturePack.BlockTransparency trans = map.trans;
if (trans == null) {
trans = map.trans;
}
// Force waterloogged blocks to use SEMITRANSPARENT (same as water)
if ((trans == TexturePack.BlockTransparency.TRANSPARENT) && blk.isWaterlogged()) {
trans = TexturePack.BlockTransparency.SEMITRANSPARENT;

View File

@ -2222,13 +2222,13 @@ public class TexturePack {
if (stateids == null) {
for (int sid = 0; sid < dblk.getStateCount(); sid++) {
DynmapBlockState dblk2 = dblk.getState(sid);
HDBlockStateTextureMap.copyToStateIndex(dblk2, map);
HDBlockStateTextureMap.copyToStateIndex(dblk2, map, trans);
}
}
else {
for (int stateid = stateids.nextSetBit(0); stateid >= 0; stateid = stateids.nextSetBit(stateid+1)) {
DynmapBlockState dblk2 = dblk.getState(stateid);
HDBlockStateTextureMap.copyToStateIndex(dblk2, map);
HDBlockStateTextureMap.copyToStateIndex(dblk2, map, trans);
}
}
}