[1.7.10]Regional Water V1.0--Make infinite water harder, but not completely disabled

  • (Posted here because you Gregtech types seem to like things harder)
    Want to make water a bit more of a challenge than vanilla, but don't QUITE like how codechickencore disables it completely? Use this mod.

    You can add biomes/dimensions/height levels via the generated config file using a whitelist or blacklist function.

    BY DEFAULT, infinite water only works if the conditions are as follows:
    • Biome = OCEAN, RIVER, BEACH (It uses the biomedictionary, so any mod biomes that are ocean, river, or beach work as well. Tested with ATG's GravelBeach)
    • Dim = 0 (No end, no nether. You can add more dimensions by adding to this array in the config file. I like setting Europa to have infinite water when using GalaxySpace)
    • Height = 0 - 255 (Any height)

    You can change the settings using 'reverse' in the config file to make infinite water spawn everywhere except in banned places using the config file.

    Source Code
    Download

    THIS IS A VERY EARLY RELEASE, SO I NEED BUG REPORTS AND INCOMPATIBILITIES. WORLD SAFETY NOT A GUARANTEE.

    How it Works

    This mod uses ASM to edit the method 'updateTick' in BlockDynamicLiquid.class by adding in another check method around line 70 which sets the variable 'field_149815_a' (basically how many source block neighbors this water block has) to 0 if the block is in incorrect surroundings, making the next check impossible to complete (which would create another source block).

    This mod should be compatible with every mod unless they affect the same thing I do (even if CodeChickenCore has finiteWater on, which would win precedence). For comparison, CodeChickenCore edits the 'field_149815_a' check to be 5 adjacent blocks instead of the vanilla 2, which is impossible since a block can only have 4 horizontal neighbors.

    Since updateTick is only ran when a random block update is called, this mod should do fine performance wise in normal gameplay, unless thousands of water blocks are updating at the same time..but even then, the added strain might not be noticeable since water is pretty inefficient anyway.

    Edited 4 times, last by Vexxel (April 30, 2016 at 8:23 AM).

  • If CCC's 'finiteWater' is set to false, this mod shouldn't act different from my testing. If it's set to true, having my mod would be pointless, as infinite water would NEVER spawn.

    Explanation:

    BlockDynamicLiquid.java

    in 'updateTick', line 71, I'm making the method go from

    to

    Chickenbones simply changes this line:

    Code
    if (this.field_149815_a >= 2 && this.blockMaterial == Material.water)


    to

    Code
    if (this.field_149815_a >= 5 && this.blockMaterial == Material.water)


    which is always an impossibility.

    I know of other ways of handing this, namely making

    Code
    if (this.field_149815_a >= 2 && this.blockMaterial == Material.water)


    be changed to

    Code
    if (this.field_149815_a >= 2 && this.blockMaterial == Material.water && TransformMethods.shouldGenerateSource(world, x, y, z))

    ,
    but I'm still new in learning ASM, and I need to get an already established LabelNode for the IFEQ for that one. I could make a new one on top of the one I need by just looping down to there, but... geeze.

    Edited 3 times, last by Vexxel (April 29, 2016 at 8:24 PM).

  • Great Mod. But I am just wondering if it's possible to set infinite water only when a lot of water are together, like lake or ocean? I don't like how I can easily get infinite water from three blocks of water.