Inactive [FUN/MISC] Vegetation 3.4.6 - Wild Grass/Vines/Plants/Moss/Grazing Animals (Permissions 2.6+) [1060]

Discussion in 'Inactive/Unsupported Plugins' started by zeff, Mar 9, 2011.

  1. Offline

    zeff

    Vegetation: Wild Grass, Vines, Plants and Moss Growth! v3.4.6

    This plugin implements the functionality of ejhopkins' Wild Grass Collection v15.2 server mod, as well as vines on trees, (partially working) lily pads and mini-cacti on land, mossy growth spreading on cobblestone and surface plant spreading functionality based on Master-Guy's PlantSpreader plugin. **Note that in order for the players to see the wild grass, you must install the client mod following the instructions found here.** Of course, the grass and/or plant growth can be disabled.

    Now supports vines! See the latest screenshots in the list below.


    Screenshots (I'm using Misa's HD Texture Pack):
    Show Spoiler

    [​IMG]
    Yeah, I didn't let much grass grow. I had it set too low for the demo screenshot.

    [​IMG]
    Holy cow, that's seriously planty.

    [​IMG]
    Single grow of a square of tall (10) grass blocks around me using the /gg 10 command on each block.

    [​IMG]

    This field was grown using /growfield 8.

    [​IMG]
    ...and then mowed back down with /mow.

    [​IMG]
    Nice pretty vines hanging down from this tree... (stock MC textures)


    Features/caveats:
    Show Spoiler

    • Placed plants (vines, cacti, lilypads) will sometimes (actually, semi-frequently) pop out and become plant pickups. This is an issue with the Minecraft server automatically doing its environmental plant-population algorithms. Until I find a way to circumvent this, your mileage may vary. Again, anyone is welcome to tweak the source code and make it work better.
    • To be able to plant flowers on sand or water requires a server patch.
      (see below)
    • Grass will grow taller. It can get pretty ridiculous. Without the optional client-side mod, players will only see normal grass blocks.
    • Specified animals will eat whatever grass they encounter, down by one level, on a timed basis.
    • Plants (flowers, mushrooms, cacti, canes, and pumpkins) will spread to nearby adjacent blocks of the same type.
    • Tall Grass and Dead Scrubs now also grow and spread
    • Growth will only occur during the daytime.
    • It will also only occur in the biomes set in the .ini file (see below)
    • It will also occur in all worlds hosted by a server, and only in chunks occupied by at least one player.
    • Configuration folder/file will be created if not found. To reset to factory defaults, simply delete the plugins/Vegetation/Settings.ini file.




    Server Patcher:
    Show Spoiler

    Bukkit Patcher (Download):
    If you want to be able to plant flowers on sand/water, you need to patch your craftbukkit version with the patcher provided here. However, putting flower blocks on water requires you to target the non-water block beneath the water block you want to plant your flower on. This is due to the way the client mod renders lilies, something I can not change. Bugs may occur if you don't plant them correctly, however there is no way your server map will get corrupted. In that case the client thinks there is a plant block on top of water while there actually is none. You will be able to see the "fake" lily but nobody else will, those fake ones will disappear once you relog.
    You may also use /grow flower to grow lily pads on water.

    This patch will not corrupt your map in any way. If you don't have it installed, the server will just unroot all flowers previously planted on sand/water blocks. They'll just pop.


    start_patcher.bat:
    @echo off
    java -Xincgc -Xmx1G -jar BukkitPatcher_0.0.jar craftbukkit.jar
    pause

    Open the start_patcher.bat file and edit the highlighted portion to the name of your carftbukkit file. You have to put both files into the same directory as your craftbukkit.jar in order to patch it.

    Commands:
    Show Spoiler

    • /grow [type]: trigger a manual growth loop for the specified plant type.
      Valid types are: flower, mushroom, cactus, sugar_cane, moss, scrub
    • /mow: removes all grass within growthRange of player (see configuration) - it will reduce all tall grass blocks into grass-covered dirt blocks.
    • /biome: returns the type of biome the player is currently standing on. You can use this command to collect information on which biome the new tall grass blocks are placed in. Please post your findings in here so I can implement it.
    • /purge [type]: purges your map and removes vines and wild grass
      Valid type are: wild_grass, vines, tall_grass
    (Working on adding back the other commands / features)​


    Configuration:
    Show Spoiler

    • The configuration file (plugins/Vegetation/<your worlds name>.ini) looks like this:
    Code:
    /* Block Search Settings:
    growthRange=20
    verticalRadius=5
    
    /* Vegetation Settings:
    enableGrass=false
    enableTallGrass=false
    
    /* Set max grass height from 1-9
    maxGrassHeight=9
    enablePlants=false
    enableFlowers=false
    enableFungi=false
    enablePumpkins=false
    enableCacti=false
    enableCanes=false
    enableMoss=false
    enableLilyPads=false
    enableVines=false
    
    /* If this option is set to true,
    /* moss will grow on any cobblestones touching water
    /* regardless if there was a moss block to spread from or not.
    waterGrowsMoss=false
    
    /* Player related Settings:
    maxActivePlayerCommands=40
    spreadAmountFlowers=5
    spreadAmountFungi=5
    spreadAmountCacti=5
    spreadAmountSugarCane=5
    spreadAmountMoss=5
    spreadAmountTallGrass=5
    /* The player will trample a path through the grass if set to true.
    trampleGrass=false
    
    /* ENTITIES:
    enableGrazers=false
    /* Sets max number of grazing animals.
    /* You should decrease this number if you encounter server lag.
    grazerMaxCount=10
    grazingSheep=true
    grazingCows=true
    grazingPigs=true
    grazingChickens=true
    
    /* BIOMES:
    /* Enabled/Disables the growth of vegetation on
    /* certain biomes.
    growForestBiome=true
    growRainforestBiome=true
    growShrublandBiome=true
    growSavannahBiome=true
    growPlainsBiome=true
    growSeasonalForestBiome=true
    growIceDesertBiome=true
    growDesertBiome=true
    growHellBiome=true
    growSwamplandBiome=true
    growTaigaBiome=true
    growTundraBiome=true
    
    /* EVENTS:
    /* The following parameters determine how many ticks of
    /* 100 ticks a specific type of action is being executed.
    /* (Example: If grassPercent is set to 60, there is the possibility
    /*  of grass growing at 60/100 ticks if a grass block is found 60 times.
    grassPercent=40
    tallGrassPercent=20
    plantsPercent=5
    mossPercent=5
    lilyPadPercent=5
    vinePercent=5
    grazePercent=10
    
    
    • growthRange: width radius (from each player), in blocks, of horizontal block-checking and growth to occur - this affects server performance.
    • verticalRadius: height radius (from each player), in blocks, of vertical block-checking and growth to occur - this also affects server performance.
    • enableGrass, enable tallGrass, enablePlants, enableMoss, enableGrazers: self-explanatory :)
    • enableFlowers, enableFungi, enableCacti, enablePumpkins, enableCanes, enableVines, enableLilyPads: individually enable/disable growth types as needed. If enablePlants is set to false, these options will be ignored.
    • waterGrowsMoss: if set to true, any cobblestone touching water will become mossy over time. If moss spreading is also enabled, it will continue to spread from there.
    • grassPercent: percent of the time in which grass should grow
      (see also grazePercent below)
    • plantsPercent: percent of the time in which plants should spread
    • mossPercent: percent of the time in which moss should spread
    • lilyPadPercent: percent of the time in which lilypads should spread
    • vinePercent: percent of the time in which vines should grow
    • tallGrassPercent: percent of the time in which tall grass should spread

    • growForestBiome, growRainforestBiome, growShrublandBiome, growSavannahBiome, growPlainsBiome, growSeasonalForestBiome, growIceDesertBiome, growDesertBiome, growSwamplandBiome, growTaigaBiome, and growTundraBiome: individually enable/disable growth in these biomes as needed.
    • enableGrazers: if set to true, then the mobs (if enabled with the following directives) will eat the grass down by one level.
    • grazePercent: percent of the time in which animals will eat the grass
    • grazingSheep, grazingCows, grazingPigs, grazingChickens: enable/disable the ability for these individual animal types to graze on the grass, accordingly.




    Permissions:
    Show Spoiler

    - 'vegetation.grow' - grants access to the /grow command​
    - 'vegetation.growall' - grants access to the /growall command​
    - 'vegetation.mow' - grants access to the /mow command​
    - 'vegetation.purge' - grants acces to the /purge command​
    - player command biome does not require any player permissions​

    Download:
    Download the Plugin (latest version, JAR) v3.4.6​



    Source is now at Github - most recent releases can be found under the test branch.​

    Previous builds can be found here (and on Github).​

    Changelog:



    Show Spoiler

    Version 3.4.6 09-August-2011
    * fixed Long Grass growing on sand and water upon chunk creation​

    Version 3.4.5 22-July-2011
    * fixed playerlist for nether and skylands​
    * fixed possible memory leak​
    * fixed a lot of NullPointerExceptions​

    Version 3.4.4 20-July-2011
    * vines will now vanish if a tree burns down​
    * tweaked tall grass spread a bit​
    * added option to purge command (wild_flowers will purge all sand flowers and lily pads)​

    Version 3.4.3 10-July-2011
    * fixed vines turning back into sugar cane blocks (hopefully)​
    * vines decay now​

    Version 3.4.2 22-June-2011
    * it should be possible to edit signs again​

    Version 3.4.1 16-June-2011
    * fixed Wild Grass​
    * adjusted spreading of Tall Grass​
    * added more options for purge command (self-explaining)​
    * new algorithm for trample grass!​
    * Wild Grass no longer grows on the same block as Tall Grass​

    Version 3.4 14-June-2011
    * added new purge command which removes vine blocks and resets grass blocks meta data (removes wild grass)​
    * vines will only grow on normal trees​
    * added Tall Grass aka Dead Scrubs, Tall Grass and Green Scrubs​
    * added settings check for the grow command, players now only can grow plants which are also enabled in the settings​
    * plants now only spread within their biome type​
    * enabled wild grass and trample grass again​

    Version 3.3 06-June-2011
    * implemented Operator commands for those who don't have Permissions installed on their server​
    * disabled grass for now, pending investigation​
    * fixed plant growth explosion​
    * added "biome" player command, which will just tell you in which type of biome you currently in​

    Version 3.2.2 20-May-2011 zeff
    * vines will no longer drop sugar canes​
    * player can now mow grass with hoes​
    * trampleGrass changed so that it appears more natural (kicks off with a chance of 40% now)​

    Version 3.2.1 14-May-2011 zeff
    * fixed a nasty bug where plants, especially lilies would sometimes replace a block instead of growing on one​
    * flowers and mushrooms now only grow if the light level is appropriate​
    * fixed a bug with planting flowers on water​
    * red roses no longer spread yellow flowers​

    Version 3.2 12-May-2011 zeff
    * separate setting files for each world
    * lily pads added​
    * sand flowers added​
    * performance improved​

    Version 3.1.2 06-May-2011 zeff
    * Implemented thread-safe playerlist as preparation for multi world support​
    * changed default settings for first plugin run​

    Version 3.1.1 02-May-2011 zeff
    * Cacti no longer spawn directly beside blocks which would unroot them instantly​
    * Sneaking players no longer trample down grass​
    * Minor bug fixes​

    Version 3.1 28-Apr-2011 zeff
    * Animals can once again graze grass​
    * Implemented spreading ratio for flowers/mushrooms/cacti. This will prevent them from covering your whole map as they can only spawn in a specific ratio per area​
    * Vines are growing now once you enable them​
    * "trampleGrass": If enabled, players will trample down grass and create a path​
    * "maxGrassHeight": self-explaining​

    Version 3.0 27-Apr-2011 zeff
    * disabled growall command since it's kind of useless the way it is now​
    * fixed mow player command​
    * disabled vines since they are not working properly and create lag​
    * added new setting option for player commands: maxActivePlayerCommands only allows a set amount of commands to run simultaneously​

    Version 2.31 13-Apr-2011 w5i2
    * Recompiled against latest recommended Craftbukkit build #674.​
    * Fixed another pretty ridiculous bug in the plant growth player-getting subroutine, one which was seriously affecting performance. Should work even more as it was designed to work now. :)

    Version 2.3 09-Apr-2011 w5i2
    * Recompiled against latest recommended Craftbukkit build #670.​
    * Grass grows through snow blocks now. Can't wait until 1.5 comes out!
    * Fixed a pretty ridiculous bug in the plant growth percentage calculations. Should work as it was designed to work now. :)

    Version 2.21 01-Apr-2011 w5i2
    * Recompiled against latest recommended Craftbukkit build #617.​
    * Added the ability to have water cause cobblestone to become mossy. Only if the cobblestone is touching the water, obviously.. And of course, normal moss spreading can take over from there if you have that enabled as well.​


    Version 2.2 30-Mar-2011 w5i2
    * Updated to incorporate new features of Wild Grass 10.1+ -- vines!!
    * Changed growth percentages to doubles, so now fractional percentages may be used in the .ini file.​
    * Added HELL biome to the list of configurable biomes (see above)​
    * added /growvines # command. For example, /growvines 10 will grow ten random vines within growthRange number of blocks.​
    * added /vine # command. If you aim at any lower leaf block on a tree and type /vine 3 it will grow a single vine from that block, three blocks tall.​
    * Recompiled against latest recommended Craftbukkit build #602.​

    Version 2.11 25-Mar-2011 w5i2
    * Fixed the /growgrass # command handling. Try /growgrass 1000 and watch it grow!​

    Version 2.1 24-Mar-2011 w5i2
    * Improved the plant spreading code, now my world has way too many flowers. :) Still not seeing any cacti growth, but I do see evidence of canes spreading.​
    * Grazing animals now will only eat grass that is >3 in height. I will most likely add a grazeHeight setting to the .ini file.​
    * Added /gg, /growfield and /grass commands (see Usage above)​
    * Added optional numeric arguments to the /overgrow and /growgrass commands to temporarily change/set the grassPerGrow value to something higher if needed.​
    * /overgrow now has one plant cycle included per 10 grass cycles (unless growPlants is disabled, of course)​
    * /mow now sets the surrounding grass level to 3 instead of 1 (completely flat). If you prefer the completely flat look, you can use /growfield 1 to achieve the same effect.​
    * Removed the obnoxious "Updating player position.." spam from the debug logging​

    Version 2.0 20-Mar-2011 w5i2
    * Major rewrite of the timer task code. This should greatly help with CPU performance issues.​
    * /overgrow now only grows around the player who typed it, rather than all players. It also now runs 1,000 growGrass() cycles, and notifies you at 25%, 50%, 75%, and completion, since it takes a while to run.​
    * Rewrote the way the timer handles the growth tasks - now it is based on a 100-slot timeslot system, so grass/plant/moss/graze amounts can be specified as percentages.​
    * Removed a few unneeded configuration directives and added some others.​

    Version 1.5 19-Mar-2011 w5i2
    * Had the idea to add animal grazing. This should help keep the grass down. :)

    Version 1.41 18-Mar-2011 w5i2
    * Recompiled against the latest recommended Craftbukkit build #556.​
    * Fixed the cacti/canes growth.​

    Version 1.4 18-Mar-2011 *it is recommended that you update to this version or newer* w5i2
    * Divided the moss, grass, plants, and block manipulation functions into separate Java classes.​
    * Added /growmoss command.​
    * Added mossEnabled and mossPerCycle to the .ini settings.​
    * Rewrote the TimerTask threads to be properly implemented (as classes instead of functions)​
    * Finally got the mossy cobblestone spreading to work​
    * I completely forgot to fix the cacti/canes growth, it will be fixed in the next release :)

    Version 1.31 15-Mar-2011 w5i2
    * Fixed a serious bug in which it would "grow" half-blocks into other types of half-blocks, or rotate stairs and rails. I apologise for any inconvenience this may have caused.​
    * Added the remaining biomes (sans Biome.HELL) to the configuration​
    * Apparently TimerTask asynchronicity is discouraged, so I changed the timer tasks to synchronous.​

    Version 1.3 14-Mar-2011 w5i2
    * Rewrote the looping routines again! They actually work properly now.​

    Version 1.21 10-Mar-2011 w5i2
    * Rewrote the looping routines to be a bit more efficient.​
    * Fixed a couple more mathematical bugs.​
    * Discovered and implemented the nifty Block.getRelative(BlockFace.UP) method.​

    Version 1.2 10-Mar-2011 w5i2
    * Added /overgrow command.​
    * Recompiled against latest recommended Craftbukkit build #531.​

    Version 1.1 10-Mar-2011 w5i2
    * Fixed flawed multi-world checking code. :)
    * Fixed flawed block-checking code.​
    * Added more configuration options.​
    * Added more biomes in which growth may occur.​

    Version 1.0 09-Mar-2011 w5i2
    * Created plugin.​
     
    Teteros, Sphax, kahlilnc and 2 others like this.
  2. Offline

    valdark

    In other words have the code require water next to cobblestone to create mossy cobble.

    I'm currently running iGrow with settings to do just that. Unfortunately iGrow is out of date and does not play nice with servers... hoping he can incorporate some of iGrow's features in this plugin.

    Cool thanks I'll see what I can come up with.

    I tinkered around with it a bit.. still not 100% satisfied (need to clean up some edges). Let me know if you like what I have going.
    [​IMG]

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  3. Offline

    Greylocke

    It loaded OK for me on [600]. Did it break for you at [602]? I didn't actually test anything, just noted that it loaded OK and assumed that it was doing its thing. :)
     
  4. Offline

    Celtic Minstrel

    602 will not break anything that worked on 600.
     
  5. Offline

    jk7800

    Unfortunately I must report, that the plugin does not work for me. At least the grass growth. Instead of growing on grass blocks it grows on... canes. Which looks quite odd:
    [​IMG]
    Am I doing something wrong or is it a bug related to the plugin? I'm using just the vegetation plugin.
     
  6. Offline

    Kainzo

    What are the performance hits with this installed? any benchmarks?
     
  7. Offline

    weasel5i2

    Hmm, that is weird.. The grass should only appear on dirt blocks, and cane blocks should appear as vines only when their data value == 15.. Maybe the Wild Grass client mod didn't install properly? I've found that Minecraft glitches sometimes (and doesn't start up at all) when I mess with the class files, and end up having to re-download the stock JAR and modify it again, at which point it works normally.. Weirdness, I tell you.

    Where does all that awesome snow come from? Is that a client mod?!

    --W5i2

    I don't have any benchmarks, per se, since I dunno how to gather such information.. But I did do a System.nanoTime() check on the main timer routine and each slice takes less than .0006 of a second to execute :)

    Of the few timer-based plugins I've created, this one is by far the most stable and doesn't seem to be too CPU intensive as it used to be. It doesn't trigger those console "Couldn't keep up!" messages anymore.

    I created one plugin which sets all surrounding water blocks' data values to zero, which will cause the blocks to re-flow into the surrounding areas if possible.. The net result is a FREAKIN' HUGE TSUNAMI!! but, it eats the server. Often. Only a few thousand water blocks get generated before the server locks up and I have to restart it..

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 11, 2016
  8. Offline

    Maddin

    Please update it to build 617 (latest recommented)
     
    bluej100 likes this.
  9. Offline

    Flipp

    Hi! Works with 617? maybe, but the client mod from Plantspreader doesn´t work with MC 1.4 i think. I tried it with my normal updated, and brandnew downloaded MC. With and without modloader, with Misa´s Textures and with the ones which in the client download. I don´t know, but normally i get everything working. (If I put this client in the .jar (and erase Meta), I login, but the Mojang Logo never will come. If i click on it, no reaction any more, I have to kill it. With modloader alone, no Problem. Looks like the updating bars apper for a 1000/sec, but I´m not sure, it´s only one frame.
    Greets
     
  10. Offline

    zwarmapapa

    Have you fixed that isue with npc's?
     
  11. Offline

    Phych

    I'm having an odd couple of issues.
    1) This mod is working over my CPU whenever I log into the server.
    2) If I try to use the overgrow command it says it to dark to grow plants
     
  12. Offline

    sintri

    spams cannot keep up the moment a second person joins, had to remove it, that and it sorta serves no purpose without the client counterpart.
     
  13. Offline

    weasel5i2

    I discovered an issue with vine growth going absolutely nuts on my server, to the point where I had to disable vine growth altogether.. I'm looking into this currently, along with the other reported issues. Thank you all for your feedback. :)

    On the plus side, ejhopkins will be releasing his 1.4 update for Wild Grass sometime in the next 24 hours!!

    Also, I just discovered another mod called Nature Overhaul, which looks interesting. Lots of tree/plant growth modifications, as well as snow spreading! The creator plans a Bukkit plugin version in the future.
     
  14. Offline

    datLicht

    Heeeeeeeeeeeeeeeeelp... have canes everywhere growing still if the plugin is disabled/deleted
     
  15. Offline

    jk7800

    Yes, it turned out that the client wasn't patched properly. After redownloading the jar and patching everything from scratch it started to work. Thanks for help.

    Yes, that's a client mod. I'm glad you like it. :D It detects the current biome and draws snow in tundra, snow deserts or rain in rainforests. It was a small project I've been working on, although snow regeneration turned out a bit buggy.
     
  16. Offline

    pixartist

    I had this mod installed shortly after the 1.3 release, and somehow sugar canes started growing in my TREES !? Is this fixed now ?
     
  17. Offline

    Greylocke

    Honestly, they really shocked me at first and I quickly shut it down. But now I've grown used to it and I'd considering turning it back on if I could dramatically reduce their rate.

    @Weasel: Nature Overhaul looks great! Should be some 'die-off' logic, though.
     
  18. Offline

    Deikkan

    Same here. Unfortuately, all the players on the server are now using it to get an unlimited amount of sugar cane from the trees, and I can't remove them. Would there be an option to disable to vines from growing, since I am assuming that everyone who doesn't have the client patch can just use it to get lots of sugar cane.
     
  19. Offline

    overlordror

    When I installed this plugin, a second person joining caused some unstoppable spam that made the game unplayable for that person. When I disabled the plugin, it fixed the problem.
     
  20. Offline

    Laurina

    Something is definitely very broken here...
    Absolutely nothing happens on a timer when only one person is logged in. Once another person logs in, vines are spammed like crazy, but nothing else happens. After disabling vines (the spamming caused massive lag), again nothing happens on a timer. Commands work, though.
    This is with v2.21 running on CraftBukkit #617.

    Also tried with v1.5. That was slightly better, in that the grass cycles work, but the plant/moss events die after 2 cycles.
    Grass continued to grow after that.

    It's only v1.21 that seems to work as advertised.

    EDIT: I think I've narrowed the problem down to something in getPlayerList and/or getNextPlayer. It seems to result in a null player in the grass growing routine when just one player is logged in, and the grass growing does not trigger at all when 2 or more players are logged in.
    It seems the 'first' player on a server is not counted, and there's clearly other wonkiness...
     
  21. Offline

    FlawlezZ

    this plugin causes extreme lags
     
  22. Offline

    h0us3cat

    How long does it take to autogrow plants on v2.21 ?
     
  23. Offline

    pixartist

    Damn, I want a working version :(
     
  24. Offline

    AnakiMana

    WildGrass has been updated (currently at 11.5). Is there a way to copy the server files ourselves to update this, or does the Vegetation plugin need to be updated? How soon might we see an update? Thanks!
     
  25. Offline

    atlem

    wy do you reales this using true on everyting . its a ram killer, every tree have bamboo groing, and crashing the server , and the bamboo is still there after removing the pluggin ,, to all of you ppl who want this pluggin be sure to sett all to false and test one by one , having all the trees grenerating bamboo is a nogo , and it wont go away after removing pluggin


    ps this is a laggy pluggin if you dont have a great amount of ram
     
  26. Offline

    Nanoinfinity

    Yeah, we got the sugar reeds growing in trees too. We had to remove the Vegetation plugin and restore to a previous version of the map.

    I'd love to see his fixed, haha. I don't mind the unlimited reed thing, just that reeds in trees is butt-ugly. :p
     
  27. Offline

    Solaris765

    for all those complaining about the reeds in trees those are supposed to have a custom graphic and be vines. the fact that their reeds is so if someone either doesn't have the client side mod or uninstalled it on single player nothing would happen to their save b/c no new blocks were added
     
  28. Offline

    h0us3cat

    help.
    this plugin is not working at all for me...
    i am on cb #617
     
  29. Offline

    Celtic Minstrel

    If you don't want reeds in trees, can't you just disable vine growth in the config?
     
  30. Offline

    ZeroGDarius

    I've been looking for a mod like this that adds atmosphere and like how painterly and this look together but i'm having to grow everything myself by command.

    So I know its going to be a huge ram hit at first but is there a way to have stuff grow without having a player in the world? or alternitavely blanket seed command that seeds the diferent plants over a whole map at once?
     
  31. Offline

    Arcwolf

    could I make a small request.

    if /growfield -1
    Code:
    public static void fieldOfGrass( Player player )
        {
            Integer R = Math.round( Vegetation.growthRange / 2 );
            int height = 0;
            int[] ignoreBlocks = { 17, 18, 0 };
            double pX = player.getLocation().getX();
            double pZ = player.getLocation().getZ();
    
            Block currentBlock = null;
    
            for( double X = (pX-R); X <= (pX+R); X++ )
            {
                for( double Z = (pZ-R); Z <= (pZ+R); Z++ )
                {
                    height = Vegetation.generator.nextInt(8);
                    currentBlock = getTopBlock(player.getWorld(), X, Z, ignoreBlocks );
    
                    if( currentBlock != null )
                    {
                        if( currentBlock.getTypeId() == 2 )
                        {
                            currentBlock.setData( (byte) (height+1) );
                        }
                    }
                }
            }
        }
    It will grow a field of random height grass. Of course I expect you will want to change the code in some way but the request doesnt change much. I'd like a way to grow a field of random height grass. Since you use 1 - 10 I figure -1 would be a good value for switching to random mode.

    Anyway, its just a request... mainly will save me the time of adding it in each version for my self and recompiling :)

    Pretty please :D [cake]
     

Share This Page