[MECH/FUN][INACTIVE] TheBlackPlague v0.2.5 - Start a plague and watch it spread [1185]

Discussion in 'Inactive/Unsupported Plugins' started by Everdras, Jul 23, 2011.

  1. Offline


    The Black Plague:
    1. Start plague
    2. Watch it spread
    3. ???
    4. Profit.

    Version: 0.2.5

    • Simulates a plague
    • Can start/end plague by command (default at load: plague is off).
    • Can infect and cure players by command
    • Can adjust 90% of things you would want to adjust with it. When you see X, Y, Z, etc below, it means YOU can pick the number. Defaults are listed in the "Options" section.
    • Plague is started 'naturally' by a player being within X blocks of a zombie upon its death AND has a chance when simply being damaged by a zombie.
    • Plague is cured by only one means: death. (Or maybe you could give the cure command to a priest class or something, and have them bind the command to a stick... who knows.) Note: death to anything but the plague does not cure the plague. You must die by a plague tick to remove it.
    • Plague does X damage every Y seconds, and every time it does damage it spreads to anyone within Z blocks.
    • Supports Permissions 3, but does not require it. Nodes listed below.
    Download: JAR - Fully updated, thread safe, and imbued with my own blood sweat and tears.
    Source: GoogleCode

    Permission Nodes:
    Show Spoiler

    • BlackPlague.toggle - /bp on & /bp off
    • BlackPlague.infect - /bp infect playername
    • BlackPlague.cure - /bp cure playername
    • BlackPlague.options - all 'options' commands

    Show Spoiler

    • /bp on - turns the plague on
    • /bp off - turns the plague off
    • /bp infect playername - infects the player whose name is playername with the plague.
    • /bp cure playername - cures the player whose name is playername from the plague.
    Note: Commands that require a player's name are case-sensitive and the name must be fully typed out.

    Show Spoiler

    • /bp interval serverticks | sets the time between ticks. 20 server ticks = 1 second. Note: if your logs are outputting the "can't keep up!" message from too many players being on, then it may be less than 20 ticks per second. I can't change anything about that.
    • /bp damage halfhearts | damage done per tick, in half hearts. So if you want the tick to do 8 hearts, set it to 16
    • /bp playerdist blocks | distance at which you will be infected by another player
    • /bp zombiedist blocks | distance at which a zombie will infect you as it 'explodes' (dies)
    • /bp zombiechance percent | % chance a zombie will infect you on attack (45 = 45%)
    • /bp explodechance percent | % chance a zombie will infect you on death (45 = 45%)
    My suggestions:
    • Don't set damage below 0, or to be super huge*.
    • Don't set time to be negative. It can be hours, if you want, but this would make the damage a bit easy to eat through. Just don't pass 9.223 quintillion server ticks.
    • Don't set distances to be negative or to be super-huge**.
    • Don't set percents to be negative or over 100.
    *Over 2.147 billion
    **Over say, 50-100.

    • Rewrite complete- thread safe!
    • Can set interval, damage, % chances to infect on zombie attack and explode, and distances at which zombies and players will infect people.
    • Zombies attacking you will now infect you too.
    v0.1.0-Initial Release

    -Use 'smart' player name matching. I.e. can type out the first part of someone name for a command, and it will 'autocomplete' it for you. I think this is implemented...?
    -flatfile config
    -exposed method to infect

    -Uses non-thread safe API. I'll need to do a rewrite of a lot of the code. Fixed.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 17, 2016
    kahlilnc and Noppoly like this.
  2. Offline


    Thanks, we're on 1000 and I will let you know.

    2011-08-03 15:41:19 [INFO] pherce has infected JorenCombs by command.
    2011-08-03 15:41:33 [SEVERE] Exception in thread "Thread-178"
    2011-08-03 15:41:33 [SEVERE] java.util.ConcurrentModificationException
    2011-08-03 15:41:33 [SEVERE]     at java.util.ArrayList$Itr.checkForComodification(Unknown Source)
    2011-08-03 15:41:33 [SEVERE]     at java.util.ArrayList$Itr.next(Unknown Source)
    2011-08-03 15:41:33 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftEntity.getNearbyEntities(CraftEntity.java:148)
    2011-08-03 15:41:33 [SEVERE]     at me.everdras.blackPlague.PlagueThread.run(PlagueThread.java:68)
    I can't verify if it only occurs on manual infection. I will try to watch to see if the exception comes when a zombie does it. Also, I did tp to him around this time so this would match your troubleshooting.
  3. Offline


    This one is different and more useful. This I can fix.... I think. Lemme look.

    Read the first post next to the JAR download. Since apparently no-one had used this on a very large server before, by sheer luck people weren't seeing concurrent modification exceptions and things of that ilk. I need to do a partial rewrite of some of the code.

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


    Yeah, we noticed the warning but we like to randomly unleash chaos on the server. We will definitely test the new version.
  5. Offline


    From what I can tell, the worst that can happen is that occasionally the spreading mechanism won't work and it may mess up when keeping track of who has the plague from time to time. Stopping and restarting the current plague should fix it.

    I'll look into doing a rewrite tomorrow if my update to my other plugin was successful.
  6. Offline


    It is weird though, it forces everyone to time out on the server and we have to do a save-all and restart. Similar to a massive WorldEdit, except it doesn't respond after a few seconds. Haven't tried to stop the plague, but the plugin is removed until you rewrite the code.
  7. Offline


    I can't replicate the glitch you're experiencing at all and no-one else seems to have the same issue.

    Though if you haven't updated since the hotfix, and you only have a single-core CPU, you may be spending all your cpu time checking to see if it's time to deal a new tick of damage.
  8. Offline


    We updated when you suggested and we have a quad core with SSDs running in Raid 5. Not sure what else I can help you with to troubleshoot.
  9. Offline


    Cool Plugin! Thanks for making it! let me know when you are threadsafe!
  10. Offline


    Making good progress on the rewrite. Though I will admit I was watching Rango the whole time. So I've just got to give it a good once-over and then clean up some code with the commands and then I should be ready to do some testing.
  11. Offline


    Would there be any chance of allowing an admin to set a certain block as a "cure block"?

    Simply right click and you're all better. I have Outlaw and Lawful towns. Would be nice for the Outlaws to be more ravaged with disease by denying them access to temples.
  12. Offline


    I can do that. It's a good idea.

    To everyone, this may take a bit longer to update than I expected, by the by. I'm in the middle of Opening Week at college (freshie!) so I'm swamped. I promise that this will be the next of my plugins that gets an update, though! =)
  13. Offline



    When you get back, could we have an option to have the plague run constantly? It's a great help to the survival aspect, but turns itself off a lot.
  14. Offline


    It shouldn't. Since I'm not sure what data inconsistency errors exactly end up doing in the long term, it may be that whenever a thread hits an uncaught exception, it stops executing. That would make the plague appear 'off' for all intents and purposes.

    Mind you, I'm really not entirely certain how java reacts to uncaught exceptions. I just looked it up, it does indeed terminate the thread that the exception occurs in. So yeah. If you're watching the log, whenever it pops up an error, that'll be when the plague turns off.

    That'll all get fixed in the update. Normally, the plague should only 'turn off' when you do a reload of all plugins or anything that causes that.
  15. Offline


    Alright, I have most of the framework done, just need to clean up commands to make them work and then do some testing to make sure nothing is horribly wrong.

    I'll update to the thread-safe version as soon as it's done, and then I'll hopefully follow up in a day or so with some of the new features. Also, as a result of the rewrite, there WILL be exposed methods for infecting and curing players with the thread-safe update, though I'll not be officially supporting or including them in the changelog until I release the next batch of features.
  16. Offline


    Looks interesting cannot wait until update.
  17. Offline


    Alright, the update is out. Technically. Right now, I'm sitting outside my Philosophy classroom waiting for class to start, and I just managed to get everything to compile and finished all the modifications that I had marked down to fix.

    So, I'll start bug testing in about 4 hours. Feel free to update now though, and please submit any bug reports! =)
  18. Offline


    Could you please help with commands when i type /bp on it come up with /bp start end infect cure interval zombiedist playerdist explodechance zombiechance damage

    Dunno what this is ive tried to change the options but i cant get the plague to start :S
  19. Offline


    You're typing the command incorrectly.

    /bp start
    Is correct. The menu you are describing is the default return message when an incorrect command is typed, listing all possible implemented command branches.
  20. Offline


    ok when i do /bp start it come s up with an internal error has etc
  21. Offline


    Is there an option:
    chance that you will be infected by zombies death? Idk how to explain this. XD and I am in a rush to work nowww.
  22. Offline


    Yes its in teh options spoiler
  23. Offline


    Can you post the stack trace? The log output?

    Bug testing finished. Everything works, as far as I can tell. As usual, please post bug reports if anything goes nuts.

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


    There was no errors in the log

    It just came up with an internal error occurded while attempting to perform this command :S
  25. Offline


    This has been fixed. Update.
  26. Offline

    John McCarthy

    • How does it spread?
    If it only spreads via Zombies it would be nice if it was like Infected-Player touches Non-Infected, Non-Infected player becomes Infected.

    *I just noticed you will be adding it soon, hopefully. :)

    Still, Could somebody please confirm that it is the only way you can get it

    • Cloudy Vision idea and other effects
    Possibility of use with Spoutcraft.
    Could add a lot of features

    • Do you get told when you get the plague?
    If not, a simple "You have just learned you have been infected by the plague!" notification would be nice after a while. haha you would notice it after a while in real life.

    • When infected, always slouching? Bed helps heal? (slow down effects)
    It would be nice if you were always crouching (slouching) when you were infected. It would be easier to do than messing with Spout and stuff. You could also make it so it is harder to do stuff when ill.

    Another feature would be sleeping helps you slow down the dying "process" :p It would be realistic.

    • Disable /kill
    No /kill would be cool. Somebody would have to kill you or you would have to die slowly and painfully.

    If ANYBODY read all of this, thank you :D I just all of a sudden had a bunch of ideas.
  27. Offline


    When you are infected for any reason, you are informed immediately and upon each damage tick.

    I'm not going to begin adding spout features until they're a bit more stable and my own server begins to use it.

    Disabling of other commands is outside of the scope of this plugin, and is easily done with other plugins.

    I want the plague to be something to worry about, but NOT something that creates 'fake difficulty' by messing with visibility/controls. Crouching would be annoying, and fog would be o.k. as long as it didn't interfere with vision.

    So, in short, I'll consider fog, and I'll get around to spout eventually.
  28. Offline

    John McCarthy

    Yah, Spout can be annoying at times, I know that. You also have a good point about the /kill command, the crouching thing and the fog. But it would be nice to simulate a slow, painful death.
  29. Offline


    I'm getting the following error whenever the plague is passed on to someone else. It stops the plague ticks from going off. I'm running Spout and lots of other things, so I don't know if Spout is at fault or whatnot, but here's the error:

  30. Offline


    I'll look into it. I'm not entirely sure if Spout would be causing it. This technically shouldn't be able to happen, as I'm no longer actually using an asynchronous thread anymore, so concurrent modification shouldn't be possible.

    Hotfixed, I hope. Redownload.

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


    It half works half doesn't

    It works to begin with but then:

    at java.util.LinkedList$ListItr.checkForComodification(LinkedList.java:778)
    at java.util.LinkedList$ListItr.next(LinkedList.java:713)
    at me.everdras.blackPlague.PlagueTask.run(PlagueTask.java:33)
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:137)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:428)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:363)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

    And we stop losing health?

Share This Page