Inactive [MECH] Self Planting v1.4 - self planting plants [1.2.5-R2.0]

Discussion in 'Inactive/Unsupported Plugins' started by CaiusTSM, Jul 17, 2011.

  1. Offline

    CaiusTSM

    Self Planting - self planting plants.
    Version: v1.4

    This plugin allows you to make saplings, cactus, and sugar cane automatically plant themselves after a certain amount of time. You can configure the planting time for each plant in the config file (default 30 seconds). If you set the plant time to zero, that plant will not plant itself.

    Note: Currently sugar cane requires a block of water next to it, not diagonal like normal sugar cane.

    Features:
    • Make saplings plant themselves.
    • Make cactus plant themselves.
    • Make sugar cane plant itself.
    • Make seeds plant themselves.
    • Configurable times for planting.
    • Configure which plant can plant itself.
    • Configurable how many plants can countdown at once. (plant limit)
    Download the jar:
    SelfPlanting.jar

    Movie--------------------------------------------------------------------------------------------------------


    Changelog:
    Version 1.0
    • plugin released!
    Version 1.1
    • added: seeds plant themselves.
    Version 1.2:
    • fixed errors.
    • code is more memory efficient.
    Version 1.3:
    • configurable how many saplings can be counting down at one time. Suggest leaving as default unless you have a great CPU.
    Version: 1.4:
    • re-coded plugin.
    • now supports different kinds of saplings.
    • plants now need a light level >= 9 to plant themselves.
    • bug fixes.
    To Do List:
    • Different types of trees.
    • Sugar cane can plant itself with water diagonal to it.
    • Spread Mode: trees over time die, and spread saplings (other plants too?).
    • Mushrooms plant themselves.
    • Flowers plant themselves.
    If you get any errors please tell me.

    My other plugins:
    Item Scanner:
    http://forums.bukkit.org/threads/me...t-collect-items-and-power-redstone-953.20375/
     
  2. Offline

    Fluffgar

    @pegasus :/ That doesn't sound good.

    Have I stumbled upon a major flaw in Craftbukkit 1000 then? Not the plugins.
     
  3. Offline

    pegasus

    I'm not sure if CB1000 isn't protecting itself properly or if one of your plugins is just misbehaving. In any case, pull out MineBackup and see if it improves.

    Quick and dirty hack, but it works. If you use long planting delays and/or your server is overloaded, the planting might take *slightly* longer than you specified. But it reloads clean.

    http://pegasus.pimpninjas.org/minecraft/SelfPlanting.jar - v1.4.2 tested working on CB1038. Source included.

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

    Fluffgar

    @pegasus Well that's really odd. I took out MineBackup but it didn't seem to have any effect on the problem. Then at 1 fps I managed to get a distance away from where I'd spawned and the problem cleared up. Got closer and it came back. Then stayed away for a bit and returned and now it's fine.. So far. Did something despawn? I have no idea what else it could be or why (or how) that and MineBackup could conspire to create such a problem in the first place.
     
  5. Offline

    pegasus

    A friend of mine pointed out that you can manually plant trees on tilled soil. Added to the plugin. v1.4.3 -- same URL.

    Possibly you had a mess of spawned items laying around on the ground and SelfPlanting 1.3 wasn't letting them despawn? did you upgrade to 1.4+?

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

    Fluffgar

    @pegasus Yes, I'm using your upgrade now and was when the problem fixed itself. I didn't see them but it's possible there were quite a lot of saplings nearby as I was collecting wood earlier on.
     
  7. Offline

    pegasus

    Well hooray for beneficial side-effects. :)

    Sooo... Still playing with the source of this thing... I've just compiled up and posted (same URL) v2.0 (unofficial of course) sporting YAML configs and auto-planting torches, mushrooms (both colors) and flowers (also both colors). Set the planting delay to zero (0) to disable the auto-planting of that particular thing. I'm probably not done messing with this, FYI.

    @CaiusTSM : If you're still alive, we should talk code.

    EDIT: If anyone's wondering, the torches thing was added as a request from a friend of mine, and the mushrooms and flowers just made sense to me, so I threw them in. With the amount of changes I've made to this source, it makes me wonder if I shouldn't just fork it into another project where anything in the configuration file can turn to a solid object after a delay. Imagine throwing glowstone around. Or fly mod with a stack of cobble to build castles.

    Also of interest, I'm pretty sure that throwing down a mushroom in a place where it's too bright to grow will cause it to plant and uproot itself until it randomly wanders into a dark corner. I thought about making it just not plant unless it's in a dark enough place, but I like the idea of wandering mushrooms, so I left it as it is. Feedback on that is welcome.

    EDIT2: I'm currently watching a mushroom on my server and it's not uprooting itself. I'll keep an eye on it and see what happens and edit this post again. :D

    EDIT3: Looks like they only uproot when a block next to them changes. So they won't wander much. Still neat that they just move instead of dropping and vanishing. :)

    EDIT4: Thrown/dropped torches now prefer to stand on the ground, if possible.

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

    CaiusTSM

    I am going to work on this plugin when I get time :), but before this plugin I want to work on my other one.
     
  9. Offline

    Fluffgar

    Um @CaiusTSM and @pegasus got another strange error... It seems to be something to do with this mod. I could be wrong.
     

    Attached Files:

  10. Offline

    CaiusTSM

    yes i have noticed that error and fixed it.
     
  11. Offline

    pegasus

    Yeah, I had that error pop up once, but only once, and never did bother looking into it as I figured it was a fluke one-off. Looks like Caius has it sorted, though, so there's that. Let's just hope he releases an update before it gets too annoying. ;) Should be rare anyway, tag me again if it happens often.
     
  12. Offline

    Fluffgar

    @CaiusTSM and @pegasus Nevermind. I think most of the weirdness wasn't actually the server itself but ShockAhPI r6 in the client having a strange reaction with Bukkit. Reverted to r5 and seems to be okay now. Think the error I posted may have just happened to occur at the same time. Sorry to bother you two.
     
  13. Offline

    Buckethead

    plant limit?
     
  14. Offline

    Dromlius

    I really love your plugin! Please keep working on it! I am looking forewards to the spread-feature! This will be awesome as Nether!
     
  15. Offline

    Buckethead

    i think u have a memory leak or something like tht. and i know its not my other plugins because ive tested them all. i keep getting this msg occasionally

    2011-09-04 07:46:34 [SEVERE] Exception in thread "Thread-5"
    2011-09-04 07:46:35 [SEVERE] java.lang.OutOfMemoryError: unable to create new native thread
    2011-09-04 07:46:35 [SEVERE] at java.lang.Thread.start0(Native Method)
    2011-09-04 07:46:35 [SEVERE] at java.lang.Thread.start(Unknown Source)
    2011-09-04 07:46:35 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.<init>(CraftWorker.java:28)
    2011-09-04 07:46:35 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftThreadManager.executeTask(CraftThreadManager.java:14)
    2011-09-04 07:46:35 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.processTask(CraftScheduler.java:107)
    2011-09-04 07:46:35 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftScheduler.run(CraftScheduler.java:64)
    2011-09-04 07:46:35 [SEVERE] at java.lang.Thread.run(Unknown Source)

    and then a whole bunch of cant keep up
     
  16. Offline

    Fluffgar

    Is this plugin being maintained?
     
  17. Offline

    pegasus

    @Fluffgar: I'm still tinkering with my version of it. It has some issues, but I still bang on it regularly.
     
  18. Offline

    Buckethead

    plz tell me this works in 1337

    this thing iscrashing after a long time and crashes whole server. i think it fills my ram

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

    jespertheend

    hey,

    is it right that you can't break planted blocks?

    yup, works for me. Except for the problem above

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

    Buckethead

    i stil have this problem
     
  21. Offline

    joselitoeu

    Please, update this:
    -Different types of trees.

    The plugin is great! But is making the pine and white wood forests disappear.
     
  22. Offline

    Buckethead

    still have his problem
     
  23. Offline

    joselitoeu

    Can't you make a quick update of this?
     
  24. Offline

    cvxx7q

    i run into a bug where all the saplings plant around the base of the tree (this is normal) then randomly it seems to duplicate the entities up until the server casues clients to f=run at something like 1 FPS (or lower) and the Server CPU is run 100%

    if i go into MCEdit i can delete all these entities then its fine but it is annoying, idk if its an issue with your plugin or minecraft itself

    [​IMG]
     
  25. Offline

    Zenolijo

    This plugin is dangerous...
    I used it for 2 days, it spawned more saplings than it was trees from the beginning.
    After a while it spawned an uncountable ammount of saplings around one tree, and made my server lag very much.
    Opened MCEdit and removed them, the server was working again!

    Please fix this or you should not upload this plugin anymore, took 3 hours for me to find what was lagging the server and lost some members because it's a new server and i got a bad reputation as a admin for not being able to fix it.
    Had been lagging all the time while i was sleeping and woke up with complains...

    EDIT:

    Got the same problem as him
     
  26. Offline

    cvxx7q

    ive seen the same sor tof bug before with a plugin and Signs (they spew out dupes of signs) anyways, i think even a simple thing of if the sappling fails to plant it might delete (configurable i suppose) or have a detection of some sorts if there is too many sapplings in an area some shud be deleted (culled etc)

    just some ideas

    probably the bets idea is to find out why they duplicate when they fail to plant (this happens when a dense group of trees has sapplings trying to plant on the same block as the trees i believe)
     
  27. Offline

    bergerkiller

    @CaiusTSM I got an issue with concurrency:
    Show Spoiler
    Code:
    java.util.ConcurrentModificationException
        at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
        at java.util.ArrayList$Itr.next(Unknown Source)
        at com.bergerkiller.bukkit.nolagg.Util.fillEntities(Util.java:85)
        at com.bergerkiller.bukkit.nolagg.StackFormer.stackNear(StackFormer.java:73)
        at com.bergerkiller.bukkit.nolagg.NLEntityListener.onItemSpawn(NLEntityListener.java:22)
        at org.bukkit.plugin.java.JavaPluginLoader$72.execute(JavaPluginLoader.java:763)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callItemSpawnEvent(CraftEventFactory.java:285)
        at net.minecraft.server.World.addEntity(World.java:887)
        at net.minecraft.server.World.addEntity(World.java:858)
        at net.minecraft.server.Block.a(Block.java:350)
        at net.minecraft.server.Block.dropNaturally(Block.java:334)
        at net.minecraft.server.Block.b(Block.java:321)
        at net.minecraft.server.BlockFlower.h(SourceFile:37)
        at net.minecraft.server.BlockFlower.doPhysics(SourceFile:28)
        at net.minecraft.server.World.k(World.java:520)
        at net.minecraft.server.World.applyPhysics(World.java:495)
        at net.minecraft.server.World.update(World.java:461)
        at net.minecraft.server.World.setTypeId(World.java:433)
        at org.bukkit.craftbukkit.block.CraftBlock.setTypeId(CraftBlock.java:77)
        at org.bukkit.craftbukkit.block.CraftBlock.setType(CraftBlock.java:73)
        at org.CaiusTSM.SelfPlanting.SelfPlanting.plantAction(SelfPlanting.java:200)
        at org.CaiusTSM.SelfPlanting.EntityScanner.run(EntityScanner.java:94)
        at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
        at java.lang.Thread.run(Unknown Source)
    

    I suspect that you are using an async task to place the saplings/flowers. If this is the case, please change this to a synchronized (repeating?) task.
     
  28. Offline

    Fluffgar

    Will there be a Self Planting for the stable dev build of Bukkit (for Minecraft Server 1.0.1) soon?
     
  29. Offline

    cvxx7q

    i dont mean to throw dirt on this plugin (i really like this one) but until its updated i have been using TreeAssist

    http://dev.bukkit.org/server-mods/tree-assist/

    it is better than this one in very small ways (such as correct saplings)

    and it also has the easy woodcutting, cutting the base drops all the wood

    but does lack alot that this plugin offers, like cane, seed replanting automatically

    ill be waiting on this plugin too though
     
  30. Offline

    joselitoeu

    Yeah, im using it to while this one dont update. But i like more of this plugin, its more realistic.
     
  31. Offline

    joselitoeu

    PLEASE, UPDATE! >.<
     

Share This Page