water flow endless

Discussion in 'Archived: Plugin Requests' started by Dubstep, Jan 20, 2012.

  1. Offline

    Dubstep

    hello,

    i need a water plugin where water flows endless;

    expample: i have a little lake with water (1), and a lake without water (2). now i pick water from the lake (1) in the lake without water (2). the lake where the water there was (1), now decreases with water (1). no infinite water.

    additional the water should also straight flow endlessly. until it no longer works (not uphill, downhill or just straight)

    practically like a "real water" mod

    Its important that the plugin features Bukkit (multiplayer)
     
  2. Offline

    AStevensTaylor

    Not sure I, or anyone else, understands what you mean by "endlessly flowing water" I assume you mean a plugin that replaces any water blocks when they are removed, therefore creating the effect of endless water.
    PS. I am not a developer, but I'll give it a go, not to dissuade any other devs from picking this up, your solution will be more elegant than mine.
     
  3. Offline

    dkabot

    If you mean making flowing water blocks into still water blocks which can then flow, it's doable.
     
  4. Offline

    AStevensTaylor

    Oh, is that what he means. I think WorldEdit has a function to do that, //fixwater [radius]
     
  5. Offline

    dkabot

    Worldedit's command is generally intended for flowing water where it should be solid.
    This person intends (I think) to have essentially the same result of /fixwater EVERY time water flows.
     
  6. Offline

    ledhead900

    Pretty sure he wants classic water, like before water would when placed just keep going and going as long as it did not hit any hills, water can't climb hill's.

    If this is case ask bergerkiller to give you a copy of a bugged version of Streamremover :p he will probably laugh when he reads this but that is pretty much what it did, every time water flowed it created a new source and thus an endless cycle of water just like classic that could flood a world really fast if you were not careful.
     
    caldabeast likes this.
  7. Offline

    AStevensTaylor

    Oh, in which case that's really easy. I can get to work on that now. ETA 3 hours, I need breakfast during this.
     
  8. Offline

    bergerkiller

    AStevensTaylor yup, all you have to do is use 'onBlockFromTo', and if the 'to' block is surrounded by 2 water, set the to block to a water source block. This system can fill entire deserts with water, but only one layer high.
     
  9. Offline

    AStevensTaylor

  10. Offline

    Dubstep

    I mean; Water flow 5 blocks, but i want a plugin, where water flow infinite blocks. simple.
     
  11. Offline

    Captain_Phillis

    Water flows for more than 5 blocks.. but this is a pretty good idea for a plugin
     
    Dubstep likes this.
  12. Offline

    Dubstep

    I have change my request

     
  13. Offline

    AStevensTaylor

    Sorry, I am not sure that I understand you. Could you explain it in terms of Blocks, and Flowing Blocks
     
  14. Offline

    Captain_Phillis

    [] <--- Water [~~~~~~] <--- Flowing water..
    How do you not understand?
     
  15. Offline

    Dubstep

    expample: i have a little lake with water (1), and a lake without water (2). now i pick water from the lake (1) in the lake without water (2). the lake where the water there was (1), now decreases with water (1). no infinite water.

    additional the water should also straight flow endlessly. until it no longer works (not uphill, downhill or just straight)
     
  16. Offline

    bergerkiller

    here you go:
    Code:
        @Override
        public void onBlockFromTo(BlockFromToEvent event) {
            if (!event.isCancelled()) {
                Block from = event.getBlock();
                Block to = event.getToBlock();
                if (to.getTypeId() != 0) return;
                int type = from.getTypeId();
                if (type == 9) {
                    if (flowLava(from, to)) {
                        event.setCancelled(true);
                    }
                } else if (type == 11) {
                    if (flowWater(from, to)) {
                        event.setCancelled(true);
                    }
                }
            }
        }
     
        public boolean blockEquals(Block b1, Block b2) {
            if (b1.getX() == b2.getX()) {
                if (b1.getY() == b2.getY()) {
                    if (b1.getZ() == b2.getZ()) {
                        return true;
                    }
                }
            }
            return false;
        }
     
        public boolean flowWater(Block from, Block to) {
            for (BlockFace face : new BlockFace[] {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST}) {
                Block relative = to.getRelative(face);
                if (blockEquals(from, relative)) continue;
                int id = relative.getTypeId();
                if (id == 10) {
                    to.setTypeId(11);
                    return true;
                }
            }
            return false;
        }
        public boolean flowLava(Block from, Block to) {
            for (BlockFace face : new BlockFace[] {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST}) {
                Block relative = to.getRelative(face);
                if (blockEquals(from, relative)) continue;
                int id = relative.getTypeId();
                if (id == 8) {
                    to.setTypeId(9);
                    return true;
                }
            }
            return false;
        }
    Modified it a bit from a previous Stream Remover buggy version:
    [​IMG]

    Works for both water and lava (it is up to the developer to add settings and all)
    That is the result of a single water stream on top of that roof, just so you know. :)

    You only need to register onBlockFromTo. I don't have time to maintain it, so any developer that is willing to publish this: feel free to do so. You are free to use above code and/or modify it, if you want to add credits, feel free to do so, but it's not needed.

    EDIT

    Wait this only causes a wall of water. Hang on...done.
     
    hawkfalcon, emericask8ur and Dubstep like this.
  17. Offline

    Dubstep


    nice. how i can test it?
     
  18. Offline

    bergerkiller



    Someone will have to export it, make a bukkit dev page for it, and all. I don't have time for all that unfortunately, but I am able to copy-paste my Stream Remover 'failing' code :)

    EDIT

    Lol up be careful with lava...I now have a 100-block radius of lava on top of stone on top of water xd
    2012-01-22_14.55.12.jpg
     
  19. Offline

    Dubstep

    i have test it, but one proplem: if I destroy the source of water, then goes the wather not away. the flowing water remains
     
  20. Offline

    bergerkiller

    Dubstep obviously, because there is no other way to make water flow endlessly if you don't make new water sources. Doing that is simply put impossible.

    EDIT

    ahahahaha now water is fighting against the lava xDD
     
  21. Offline

    Dubstep

    can you send me your .jar file? my water dont flows endlessly...
     
  22. Offline

    bergerkiller

    Attached Files:

    milp and Dubstep like this.
  23. Offline

    Dubstep

    nice, it works fine. but is possible that the water flows away if the water source is destroyed?

    by the way, the water flow not always straight... (screenshot)

    [​IMG]
     
  24. Offline

    bergerkiller

    Dubstep true, it works a bit different. If I go and change all surrounding edges with water, you got class water, and you don't want that. :)
     
    Dubstep likes this.
  25. Offline

    milp

    Great addon, can you please also make it spread more? Please make it so that if i place it at the top tile of a, say 8x8 cube area, the whole 8x8 will fill itself up to the highest point of water (where i placed it). I hope i did a good job describing this lol
     
  26. Offline

    AmoebaMan

    I was considering making a Finite Water plugin, and I think it would be possible actually. Not going to give out any details yet because I don't want it to get hijacked ;)
     
    milp likes this.
  27. Offline

    milp

    Finite water sound pretty cool already, but what about infinite water as previously discussed? :)
     
  28. Offline

    roeltrachsler

    If you want realistic water you have make a distinction between seawater and water from a bukkit.

    Source blocks from a bucket should be removed after a few seconds. Then a little stream will flow realistically until it lands on a smooth surface, were i should spread out and dissapear.

    Water from the sea should spread indefinitely, because the seas are so vast you can't notice the water level descending.

    This would however leave a problem for small lakes, where you should notice the water level decending after a while (when you let water flow out).

    Also i have no use for such a plugin, because my players are depending on minecraft's weird water for farms and grinders.

    It would be cool tho. XD
     
  29. Offline

    AmoebaMan

    Well of course most servers won't just pick it up because it'd ruin a bunch of the typical mechanical builds that you can create. My plan for the future is to create a server that is dedicated to taking Minecraft as close to real-life as possible, and Finite Water would be a necessity for that.
     
  30. Offline

    roeltrachsler

Share This Page