Fix redstone in hideores=true

This commit is contained in:
Mike Primm 2018-09-12 19:32:47 -05:00
parent df43618354
commit b741bb522d
2 changed files with 9 additions and 9 deletions

View File

@ -84,19 +84,19 @@ public class HDBlockModels {
private static void remapModel(String bn, String newbn) {
DynmapBlockState frombs = DynmapBlockState.getBaseStateByName(bn);
DynmapBlockState tobs = DynmapBlockState.getBaseStateByName(bn);
int minstate = Math.min(frombs.getStateCount(), tobs.getStateCount());
for (int bs = 0; bs < minstate; bs++) {
DynmapBlockState fb = frombs.getState(bs);
int fcnt = frombs.getStateCount();
for (int bs = 0; bs < tobs.getStateCount(); bs++) {
DynmapBlockState tb = tobs.getState(bs);
HDBlockModel m = models_by_id_data.get(fb.globalStateIndex);
DynmapBlockState fs = tobs.getState(bs % fcnt);
HDBlockModel m = models_by_id_data.get(fs.globalStateIndex);
if (m != null) {
models_by_id_data.put(tb.globalStateIndex, m);
}
else {
models_by_id_data.remove(tb.globalStateIndex);
}
customModelsRequestingTileData.set(tb.globalStateIndex, customModelsRequestingTileData.get(fb.globalStateIndex));
changeIgnoredBlocks.set(tb.globalStateIndex, changeIgnoredBlocks.get(fb.globalStateIndex));
customModelsRequestingTileData.set(tb.globalStateIndex, customModelsRequestingTileData.get(fs.globalStateIndex));
changeIgnoredBlocks.set(tb.globalStateIndex, changeIgnoredBlocks.get(fs.globalStateIndex));
}
}

View File

@ -157,10 +157,10 @@ public class HDBlockStateTextureMap {
public static void remapTexture(String dest, String src) {
DynmapBlockState dblk = DynmapBlockState.getBaseStateByName(dest);
DynmapBlockState sblk = DynmapBlockState.getBaseStateByName(src);
int mincnt = Math.min(dblk.getStateCount(), sblk.getStateCount());
for (int i = 0; i < mincnt; i++) {
int scnt = sblk.getStateCount();
for (int i = 0; i < dblk.getStateCount(); i++) {
int didx = dblk.getState(i).globalStateIndex;
int sidx = sblk.getState(i).globalStateIndex;
int sidx = sblk.getState(i % scnt).globalStateIndex;
texmaps[didx] = new HDBlockStateTextureMap(texmaps[sidx], null);
}
}