Ender Crystal Regeneration

Discussion in 'Archived: Plugin Requests' started by Profan, May 22, 2014.

  1. Offline

    Profan

    Suggested name: Ender Crystal Regeneration

    What I want:
    I want a plugin that when someone break a ender crystal, they will respawn after 5minutes

    Commands: /spawncrystal - Spawn a ender crystal

    Permissions: crystal.spawn - Spawn a ender crystal

     
  2. Offline

    16davidjm6

    essentials has a /spawnentity and /spawnmob command that will allow you to spawn any mob or entity including the ender crystal
     
  3. Offline

    tcvs

    16davidjm6 the only problem is he wants it to be added after 5 mins of being removed.
     
  4. Offline

    Profan

  5. Offline

    Profan

  6. Offline

    RegalMachine

    Profan I'll see what i can do about it. I'll flip through the API a little tonighht before bed and may have a prototype for you tomarrow :D would you like only the endercrystals spawned by players to regenerate, or also those naturally occuring in the end?

    Profan Oh, yeah, this should take at max 15 minutes. I'll see what I can do in class tomarrow... On second thought, mabey a bit more than that because of remembering where the crystals are and where they need to be after 5 minutes, even after the server restarts. Still, I should have it for the most part, a working concept tomarrow.

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

    Profan

    Thanks, they can spawn naturally or with players
     
  8. Offline

    RegalMachine

    Profan that actually simplifies things a bit! Would you also like a command that removes them, so you actually have a way to get rid of them?
     
  9. Offline

    Profan

    If you can make it will be awesome :D
     
  10. Offline

    RegalMachine

    Profan I know i can make it, its just a matter of finding time to do it at this point. I just finished updating NeoChat to v1.7.9 and now I need to Update some of my servers custom plugins. I'll see if i can't get something up within the week. Also, PM me about this from now on. We dont need to keep bumping the thread.
     
  11. Offline

    timtower Administrator Administrator Moderator

    RegalMachine, Profan Keep the conversation on the thread,
     
  12. Offline

    RegalMachine

    timtower i realize this, it just seems silly to continue to bump the thread. Btw Profan i have a long homeroom today, upwards of an hour, so i will have time to code this. I beleive the best way to do it is to keep a list of RegenCrystal objects that each have a Vector and a timer, then make a runnable that itterates through each crystal object (these are created upon a player destroying a crystal) and decrement 1. When that objects value hits Zero, put the crystal back and remove the object from the list. On disable stop the runnable, and then loop through existing crystals and save their info to a config. On enable, load the data from the config and remove the info inside it. Can you confirm this is the best way to do this timtower ?
     
  13. Offline

    timtower Administrator Administrator Moderator

    RegalMachine If it is a 5 minute timer then I suggest that you just restore them onDisable, not really a big issue for such a small time.
     
  14. Offline

    RegalMachine

    timtower the issue i see with that is server crashes. If it crashed it would loose all pending crystals
     
  15. Offline

    timtower Administrator Administrator Moderator

    If you just save it in the onDisable then you will still have that issue. Or save the locations only and restore the block in onEnable.
     
  16. Offline

    RegalMachine

    timtower Good Point

    Profan Finished.

    Commands:
    • /crystal [spawn/remove/info]
    Permissions:
    • crystals.command.spawn Allows for the spawning of Ender Crystals (The way Bukkit spawns them in is a little weird, but that's Bukkit's fault, not mine)
    • crystals.command.remove Allows for the removal of Ender Crystals
    Every time an Ender crystal is destroyed, it keeps track of it, and after 5 minutes, or after a reload, the crystal gets placed back into the world. Keep in mind the fact that the crystal will be floating if the area is not protected from blast damage and the crystal blows up some blocks.
    I will be uploading the plugin tomarrow, as i don't have time to type up a project right now.

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

    timtower Administrator Administrator Moderator

    RegalMachine Dropbox or mediafire link is also allowed, then you don't need to type up a project :p
     
    RegalMachine likes this.
  18. Offline

    RegalMachine

    timtower good to know, but i can't get on my VNC anymore today, i'll have to do it tomarrow morning

    Profan Here you go!

    https://www.dropbox.com/s/1xj0uhnqwtfsuwl/RegenCrystals.jar

    I fixed the way it spawns in the crystal, so now it spawns in the right place (where you are looking) if you have any questions or suggestions i am happy to comply! Tahg me with questions, and enjoy your plugin! Label this filled now :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
    timtower likes this.
  19. Offline

    Profan

    Thanks :D
     
  20. Offline

    RegalMachine

    Profan Hope its everything you wanted!
     

Share This Page