Inactive [MECH] BurningMobs v0.6 - Spiders and Creepers can now burn in sunlight. [1060]

Discussion in 'Inactive/Unsupported Plugins' started by McSpazzy, Apr 10, 2011.

  1. Offline

    McSpazzy

    BurningMobs - Spiders and Creepers can now burn in sunlight.
    Version: v0.6

    Just put in plugins directory and BAM. Built and tested with Craftbukkit 1060. May work with some earlier versions.

    Features:
    • Allows admins to choose if they want spiders, creepers, skeletons and zombies to burn when the sun comes up.
    • Monitors in a separate thread so there is virtually no impact on performance.
    • In game commands /bm or /burnmob <spider|creeper|skeleton|zombie|info|frequency>
    • Auto creates config file on first load with default set to true.
    Download

    Changelog:

    Version 0.6
    • Cleaned up lots more of the code.
    • Added more in game commands for changing settings.
    • Added ability to change the frequency at which the thread updates the moblist. This is in milliseconds. Default is 1000(1 second).
    • Fixed the bug that may have caused server lag/crashes/problems when reloaded.
    • Removed permissions support (I don't think they were really needed)
    Version 0.3
    • Cleaned up some of the code.
    • Added in game commands for changing settings.
    • Added config file creation on initial launch.
    • Added permissions support.
    • Fixed multiworld crash bug.
    Version 0.2
    • Fixed spider not burning bug.
    • Fixed thread crashing issue due to concurrency error (I think).
    • Made it more thread-safe. No longer pulls data at will from the main thread.
    Version 0.1
    • Initial Release
     
  2. Offline

    nubpro

    Could you make the plugins support with Craftbukkit 617?
     
  3. Offline

    xPaw

    Update to 670, it's latest RB.
     
  4. Offline

    nubpro

    but I dont want to....because it does support some others plugins
     
  5. Offline

    Alex K

    This is something i've been looking for, thanks.
     
  6. Offline

    Steve Cole

    you should nag those plugins about updating then instead of asking someone to downgrade.
     
  7. Offline

    nekosune

    Then they should upgrade, or they no longer become supported plugins, as it says in the rules. faq etc, Bukkit is being updated all the time, plugins can not, and should not be expected to support all the features of older versions, otherwise they would get bloated and slow fast, 617 is open to a MAJOR exploit that means anyone and their dog could crash your server whenever they please, 670 is a security update.
     
  8. Offline

    pokerhermit

    Nice. Is it possible to include zombies and skeletons, so we can set them to not burn? Real zombies don't burn up in daylight.
     
  9. Offline

    jeffdanoob

    17:31:25 [INFO] [BurningMobs] Monitoring thread started successfully!
    17:31:25 [INFO] [BurningMobs] v0.1 loaded successfully!
    For some reason the creepers and spiders don't burn in sunlight for me.
    Code:
    Burn_Creeper=true
    Burn_Spider=true
    Thats whats written inside the config file

    Can anyone help me make this plugin work?

    Just saw this
    Code:
    18:12:26 [SEVERE] Exception in thread "Thread-6"
    18:12:26 [SEVERE] java.util.ConcurrentModificationException
    18:12:26 [SEVERE]       at java.util.AbstractList$Itr.checkForComodification(Unk
    nown Source)
    18:12:26 [SEVERE]       at java.util.AbstractList$Itr.next(Unknown Source)
    18:12:26 [SEVERE]       at org.bukkit.craftbukkit.CraftWorld.getLivingEntities(C
    raftWorld.java:506)
    18:12:26 [SEVERE]       at com.McSpazzy.BurningMobs.BurningMobsWatcher.BurnMobs(
    BurningMobsWatcher.java:50)
    18:12:26 [SEVERE]       at com.McSpazzy.BurningMobs.BurningMobsWatcher.run(Burni
    ngMobsWatcher.java:34)
    18:12:26 [SEVERE]       at java.lang.Thread.run(Unknown Source)
    >
     
  10. Offline

    McSpazzy

    @jeffdanoob are you running a multiworld server? There was a bug I found after release that casues the thread to crash. And it was too late to fix as I needed sleep. I'll try get a fix out asap. If it isn't a multiworld server, can you tell me what you or others were doing when you got the error?

    @pokerhermit Should be able to make the monitoring thread turn off zombie fire. I'll have a look.
     
  11. Offline

    desmin88

    @McSpazzy
    Nice plugin! Useful for my server.
    However, is it a true new thread? If so wouldn't it be non-threadsafe because your calling methods marked non-threadsafe, correct?
     
  12. Offline

    jeffdanoob

    Its a single world server.
    Wasn't doing anything when the error happened, I was the only one logged on and I was idle on a tower
     
  13. Offline

    McSpazzy

    @desmin88 Uh lol...I have no idea. I don't know the technical stuff behind java...It was in fact the first time I've used threading in java. I can give you the source if you want, to check it out and modify to fix any problems you see in my 'wing it' style coding.

    public BurningMobs()
    {
    BurnThread = new Thread(new BurningMobsWatcher());
    }

    public void onEnable()
    {
    BurnThread.start();
    }

    Everything in the runnable is local. It just reads the data out of the main thread. The only thing it does outside itself is setting the fireticks.

    @jeffdanoob Does the error happen often? That error will stop the mobs from burning. May be a plugin conflict also.
     
  14. Offline

    desmin88

    @McSpazzy
    Yes then it's not threadsafe and can cause data corruption and other weird errors.
    The only threadsafe bukkit api is the scheduler methods and world.getblocktypeidat().
    Other than those, all other bukkit api methods are NOT safe to be called in a new thread.

    In your new thread you can call the Scheduler and have the runnable include your code, so it's still in a new thread.
     
  15. Offline

    N3X15

  16. Offline

    ShockBuddy

    I look later until its "Bugfree", the idea is good, i dont want to get ate by a Spider in the Day anymore :'(

    Dumb Spiders [tnt][spider]

    Keep work

    [diamond][diamond][diamond][diamond] (Idea)
     
  17. Offline

    jeffdanoob

    @McSpazzy


    This is very odd, It doesn't happen often (I'm not sure, just installed the plugin yesterday).
    It might be interfering with other plugins, I'm currently using:

    Code:
    Bmobs
    BurningMobs
    LightVote
    MidiBanks
    PaintingSwitch
    SimpleBarter
    SpawnCreature
    SuperPowers
    Bmobs and SpawnCreature might be interfering with it, but today when i started up my server with the same config file.
    Code:
    Burn_Creeper=true
    Burn_Spider=true
    One of my friend said they saw a creeper burn in sunlight, I went online and saw that creepers do burn in sunlight now, but spiders do not.
     
  18. Offline

    McSpazzy

    Currently working on making it (more) thread-safe. Getting rid of the occasional thread exception.

    @jeffdanoob The aforementioned thread exception is my fault. As desmin88 said, its not threadsafe. Its reading from and writing to the main thread, occationally they try and do something to the same thing at the same time. It's unlikely that any of your plugins are to blame.
    As for the spiders not burning, ill double check, I have it set to false on my test server, so I didn't notice =D
     
  19. Offline

    Kayonesoft

    I watched creepers burn in the daylight and spiders did not, both set to true. Then I got that error that jeffdanoob got and now creepers or spiders won't burn.
     
  20. Offline

    McSpazzy

    @Kayonesoft

    Yep, I have located the source of both problems, and am working to fix them both.

    @jeffdanoob @Kayonesoft @ShockBuddy

    Spiders burn now! And I'm pretty sure I've fixed the source of that crash. =D

    I'll be leaving my test server on overnight to see if any other bugs pop up.

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

    manniL

    Nice Work.

    Can't Test ist ATM, cause i've portblock. I'll try it at Weekend

    Is it possible to make it MultiWorld-supported till the WE?
     
  22. Offline

    Infernus

    Can I use a part of this code for an upcoming plugin of mine?
     
  23. Offline

    McSpazzy

    @Infernus What part, and for what plugin? it's not exactly the best code. =D
    @manniL I'll take a look at multiworld support later today or tomorrow.
     
    manniL likes this.
  24. Offline

    Infernus

    The part where it checks wether the mob should burn or not
     
  25. Offline

    iFraank

  26. Offline

    DioZero

    doesn't work for my server :S
     
  27. Offline

    derchris

    I have the same problem some other users had, with Spiders not burning in sunlight.
    Same is for creepers at the moment, even with the 0.2 version.
    Have several plugins running.
    How could we troubleshoot this?
     
  28. Offline

    McSpazzy

    @DioZero @derchris

    Do you get any errors in the console log? Concurrency errors? Or any kind of thread exceptions?
     
  29. Offline

    Infernus

    .. Uhh, so can I? :p
     
  30. Offline

    McSpazzy

    @Infernus are you talking about the sunlight code, or the thread code?

    New shiny and better version 0.3 yay!

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

Share This Page