Forge fixes

This commit is contained in:
Mike Primm 2018-09-03 16:51:04 -05:00
parent 5dd7abaddb
commit 5f13c8f74f
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++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m);
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
IBlockState blkstate = null;
try {
blkstate = b.getStateFromMeta(m);
} catch (Exception x) {
// Invalid meta
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
if (blkstate != null) {
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
}
}
}
}
}
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
}
//for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
// Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
//}
}
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++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m);
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
IBlockState blkstate = null;
try {
blkstate = b.getStateFromMeta(m);
} catch (Exception x) {
// Bad metadata
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
if (blkstate != null) {
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
}
}
}
}
}
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
}
//for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
// Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
//}
}
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++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m);
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
IBlockState blkstate = null;
try {
blkstate = b.getStateFromMeta(m);
} catch (Exception x) {
// Invalid metadata
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
if (blkstate != null) {
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
}
}
}
}
}
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
}
//for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
// Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
//}
}
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++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
}
//for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
// Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
//}
}
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++) {
DynmapBlockState bs = new DynmapBlockState(basebs, m, bn, "meta=" + m);
stateByID[(i << 4) + m] = bs;
IBlockState blkstate = b.getStateFromMeta(m);
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
IBlockState blkstate = null;
try {
blkstate = b.getStateFromMeta(m);
} catch (Exception x) {
// Invalid meta
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
if (blkstate != null) {
Material mat = blkstate.getMaterial();
if (mat.isSolid()) {
bs.setSolid();
}
if (mat == Material.AIR) {
bs.setAir();
}
if (mat == Material.WOOD) {
bs.setLog();
}
if (mat == Material.LEAVES) {
bs.setLeaves();
}
}
}
}
}
}
for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
Log.info(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
}
//for (int gidx = 0; gidx < DynmapBlockState.getGlobalIndexMax(); gidx++) {
// DynmapBlockState bs = DynmapBlockState.getStateByGlobalIndex(gidx);
// Log.verboseinfo(gidx + ":" + bs.toString() + ", gidx=" + bs.globalStateIndex + ", sidx=" + bs.stateIndex);
//}
}
public static final int getBlockID(World w, int x, int y, int z) {