Forge fixes

This commit is contained in:
Mike Primm 2018-09-03 16:51:04 -05:00
parent 78dceaa8ff
commit 179bf0098e
5 changed files with 96 additions and 68 deletions

View file

@ -176,28 +176,35 @@ public class DynmapPlugin
for (int m = 1; m < 16; m++) { for (int m = 1; m < 16; m++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m); DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs; stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m); IBlockState blkstate = null;
Material mat = blkstate.getMaterial(); try {
if (mat.isSolid()) { blkstate = b.getStateFromMeta(m);
bs.setSolid(); } catch (Exception x) {
// Invalid meta
} }
if (mat == Material.AIR) { if (blkstate != null) {
bs.setAir(); Material mat = blkstate.getMaterial();
} if (mat.isSolid()) {
if (mat == Material.WOOD) { bs.setSolid();
bs.setLog(); }
} if (mat == Material.AIR) {
if (mat == Material.LEAVES) { bs.setAir();
bs.setLeaves(); }
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
} }
} }
} }
} }
} }
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { //for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); // DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); // Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
} //}
} }
public static final int getBlockID(World w, int x, int y, int z) { public static final int getBlockID(World w, int x, int y, int z) {

View file

@ -176,28 +176,35 @@ public class DynmapPlugin
for (int m = 1; m < 16; m++) { for (int m = 1; m < 16; m++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m); DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs; stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m); IBlockState blkstate = null;
Material mat = blkstate.getMaterial(); try {
if (mat.isSolid()) { blkstate = b.getStateFromMeta(m);
bs.setSolid(); } catch (Exception x) {
// Bad metadata
} }
if (mat == Material.AIR) { if (blkstate != null) {
bs.setAir(); Material mat = blkstate.getMaterial();
} if (mat.isSolid()) {
if (mat == Material.WOOD) { bs.setSolid();
bs.setLog(); }
} if (mat == Material.AIR) {
if (mat == Material.LEAVES) { bs.setAir();
bs.setLeaves(); }
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
} }
} }
} }
} }
} }
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { //for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); // DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); // Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
} //}
} }
public static final int getBlockID(World w, int x, int y, int z) { public static final int getBlockID(World w, int x, int y, int z) {

View file

@ -176,28 +176,35 @@ public class DynmapPlugin
for (int m = 1; m < 16; m++) { for (int m = 1; m < 16; m++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m); DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs; stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m); IBlockState blkstate = null;
Material mat = blkstate.getMaterial(); try {
if (mat.isSolid()) { blkstate = b.getStateFromMeta(m);
bs.setSolid(); } catch (Exception x) {
// Invalid metadata
} }
if (mat == Material.AIR) { if (blkstate != null) {
bs.setAir(); Material mat = blkstate.getMaterial();
} if (mat.isSolid()) {
if (mat == Material.WOOD) { bs.setSolid();
bs.setLog(); }
} if (mat == Material.AIR) {
if (mat == Material.LEAVES) { bs.setAir();
bs.setLeaves(); }
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
} }
} }
} }
} }
} }
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { //for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); // DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); // Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
} //}
} }
public static final int getBlockID(World w, int x, int y, int z) { public static final int getBlockID(World w, int x, int y, int z) {

View file

@ -195,10 +195,10 @@ public class DynmapPlugin
} }
} }
} }
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { //for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); // DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); // Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
} //}
} }
public static final int getBlockID(World w, int x, int y, int z) { public static final int getBlockID(World w, int x, int y, int z) {

View file

@ -176,28 +176,35 @@ public class DynmapPlugin
for (int m = 1; m < 16; m++) { for (int m = 1; m < 16; m++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m); DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs; stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m); IBlockState blkstate = null;
Material mat = blkstate.getMaterial(); try {
if (mat.isSolid()) { blkstate = b.getStateFromMeta(m);
bs.setSolid(); } catch (Exception x) {
// Invalid meta
} }
if (mat == Material.AIR) { if (blkstate != null) {
bs.setAir(); Material mat = blkstate.getMaterial();
} if (mat.isSolid()) {
if (mat == Material.WOOD) { bs.setSolid();
bs.setLog(); }
} if (mat == Material.AIR) {
if (mat == Material.LEAVES) { bs.setAir();
bs.setLeaves(); }
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
} }
} }
} }
} }
} }
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) { //for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx); // DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex); // Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
} //}
} }
public static final int getBlockID(World w, int x, int y, int z) { public static final int getBlockID(World w, int x, int y, int z) {