Merge pull request #242 from ammaraskar/lava_water_logging

Properly consider world water/lava logging config. Fixes #202. I wouldn't accept bad git practices from anybody else :3
This commit is contained in:
md-5
2012-09-22 01:15:00 -07:00

View File

@@ -30,36 +30,42 @@ public class FluidFlowLogging extends LoggingListener
final int typeTo = to.getTypeId();
final boolean canFlow = typeTo == 0 || nonFluidProofBlocks.contains(typeTo);
if (typeFrom == 10 || typeFrom == 11) {
if (canFlow) {
if (canFlow && wcfg.isLogging(Logging.LAVAFLOW)) {
if (isSurroundedByWater(to) && event.getBlock().getData() <= 2)
consumer.queueBlockReplace("LavaFlow", to.getState(), 4, (byte)0);
else if (typeTo == 0) {
if (wcfg.isLogging(Logging.LAVAFLOW))
consumer.queueBlockPlace("LavaFlow", to.getLocation(), 10, (byte)(event.getBlock().getData() + 1));
} else
consumer.queueBlockPlace("LavaFlow", to.getLocation(), 10, (byte)(event.getBlock().getData() + 1));
} else {
consumer.queueBlockReplace("LavaFlow", to.getState(), 10, (byte)(event.getBlock().getData() + 1));
} else if (typeTo == 8 || typeTo == 9)
if (event.getFace() == BlockFace.DOWN)
}
} else if (typeTo == 8 || typeTo == 9) {
if (event.getFace() == BlockFace.DOWN) {
consumer.queueBlockReplace("LavaFlow", to.getState(), 1, (byte)0);
else
} else {
consumer.queueBlockReplace("LavaFlow", to.getState(), 4, (byte)0);
} else if (typeFrom == 8 || typeFrom == 9) {
}
}
} else if ((typeFrom == 8 || typeFrom == 9) && wcfg.isLogging(Logging.WATERFLOW)) {
if (typeTo == 0) {
if (wcfg.isLogging(Logging.WATERFLOW))
consumer.queueBlockPlace("WaterFlow", to.getLocation(), 8, (byte)(event.getBlock().getData() + 1));
} else if (nonFluidProofBlocks.contains(typeTo))
consumer.queueBlockPlace("WaterFlow", to.getLocation(), 8, (byte)(event.getBlock().getData() + 1));
} else if (nonFluidProofBlocks.contains(typeTo)) {
consumer.queueBlockReplace("WaterFlow", to.getState(), 8, (byte)(event.getBlock().getData() + 1));
else if (typeTo == 10 || typeTo == 11)
if (to.getData() == 0)
}
else if (typeTo == 10 || typeTo == 11) {
if (to.getData() == 0) {
consumer.queueBlockReplace("WaterFlow", to.getState(), 49, (byte)0);
else if (event.getFace() == BlockFace.DOWN)
} else if (event.getFace() == BlockFace.DOWN) {
consumer.queueBlockReplace("LavaFlow", to.getState(), 1, (byte)0);
if (typeTo == 0 || nonFluidProofBlocks.contains(typeTo))
}
}
if (typeTo == 0 || nonFluidProofBlocks.contains(typeTo)) {
for (final BlockFace face : new BlockFace[]{BlockFace.DOWN, BlockFace.NORTH, BlockFace.WEST, BlockFace.EAST, BlockFace.SOUTH}) {
final Block lower = to.getRelative(face);
if (lower.getTypeId() == 10 || lower.getTypeId() == 11)
if (lower.getTypeId() == 10 || lower.getTypeId() == 11) {
consumer.queueBlockReplace("WaterFlow", lower.getState(), lower.getData() == 0 ? 49 : 4, (byte)0);
}
}
}
}
}
}