|
3 | 3 | import static info.loenwind.enderioaddons.config.Config.seedsRFperGrowthTick; |
4 | 4 | import info.loenwind.enderioaddons.common.Log; |
5 | 5 | import info.loenwind.enderioaddons.common.WorldHelper; |
| 6 | +import info.loenwind.enderioaddons.config.Config; |
6 | 7 | import info.loenwind.enderioaddons.recipe.Recipes; |
7 | 8 |
|
8 | 9 | import java.lang.reflect.InvocationTargetException; |
@@ -56,6 +57,43 @@ public EioaGrowthRequirement() { |
56 | 57 |
|
57 | 58 | @Override |
58 | 59 | public boolean canGrow(World world, int x, int y, int z) { |
| 60 | + if (Config.growthRequirementDebuggingEnabled.getBoolean()) { |
| 61 | + String txt = "Plant at " + x + "/" + y + "/" + z + ": "; |
| 62 | + if (isValidSoil(world, x, y - 1, z)) { |
| 63 | + txt += "Soil (" + capBank + ") is valid. "; |
| 64 | + } else { |
| 65 | + txt += "Soil (" + capBank + ") is NOT valid, it is " + WorldHelper.getBlock(world, x, y, z) + ":" + WorldHelper.getMeta(world, x, y, z) + ". "; |
| 66 | + } |
| 67 | + if (isBaseBlockPresent(world, x, y, z)) { |
| 68 | + txt += "Base block (" + bedrock + ") is valid directly below soil. "; |
| 69 | + } else if (isBaseBlockPresent(world, x, y - 1, z)) { |
| 70 | + txt += "Base block (" + bedrock + ") is valid one below soil. "; |
| 71 | + } else { |
| 72 | + txt += "Base block (" + bedrock + ") is MISSING. Block directly below soil is " + WorldHelper.getBlock(world, x, y - 1, z) + ":" |
| 73 | + + WorldHelper.getMeta(world, x, y - 1, z) + ", block below that is " + WorldHelper.getBlock(world, x, y - 2, z) + ":" |
| 74 | + + WorldHelper.getMeta(world, x, y - 2, z) + ". "; |
| 75 | + } |
| 76 | + if (areBarsPresent(world, x, y, z)) { |
| 77 | + txt += "Bars (" + darkBar + ") are valid. "; |
| 78 | + } else { |
| 79 | + txt += "Bars (" + darkBar + ") are NOT valid. "; |
| 80 | + } |
| 81 | + if (isBrightnessOk(world, x, y, z)) { |
| 82 | + txt += "Light levels (sky light " + brightness[2] + "..." + brightness[3] + " and block light " + brightness[0] + "..." + brightness[1] + ") are ok. "; |
| 83 | + } else { |
| 84 | + txt += "Light levels (sky light " + brightness[2] + "..." + brightness[3] + " and block light " + brightness[0] + "..." + brightness[1] |
| 85 | + + ") are NOT ok, sky light is " + world.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) + ", block light is " |
| 86 | + + world.getSavedLightValue(EnumSkyBlock.Block, x, y, z) + ". "; |
| 87 | + } |
| 88 | + if (world.isRemote) { |
| 89 | + txt += "Power level in the capacitor bank can only be checked server-side. "; |
| 90 | + } else if (hasPower(world, x, y, z)) { |
| 91 | + txt += "Power level in the capacitor bank is ok. "; |
| 92 | + } else { |
| 93 | + txt += "Power level in the capacitor bank is too low. "; |
| 94 | + } |
| 95 | + Log.info(txt); |
| 96 | + } |
59 | 97 | return isValidSoil(world, x, y - 1, z) && (isBaseBlockPresent(world, x, y, z) || isBaseBlockPresent(world, x, y - 1, z)) && areBarsPresent(world, x, y, z) |
60 | 98 | && isBrightnessOk(world, x, y, z) && hasPower(world, x, y, z); |
61 | 99 | } |
|
0 commit comments