[Completed] MagicEgg

Discussion in 'Plugin Requests' started by ExoNeon, Jan 24, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    timtower Administrator Administrator Moderator

    @Ligachamp Files on dev.bukkit always go through the approval process, ranks / reputation don't count there.
  2. Offline


    @MarinD99 Just a question, what's your editor?
  3. Offline


    My editor? As in IDE, or... ?
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline


    In that case, @WolfMage1 , I normally use IntelliJ Idea.
  6. Offline


    Any problems I need to know about?
  7. Offline


  8. Offline


    Sorry, but I need to proove you wrong ;P I'm getting further thanks to TheMrJezza's code :) When I seriously finish this I won't forget to mention him!
  9. Offline


    @Ligachamp Ohh :D Well thats something possitive :D Keep up the work ^^
  10. Offline


    Sweeeeet! Cant wait to see the finished product!
  11. Offline


    I don't want to be too promising... The plugin basically works, ATM I'm working on needed commands and figuring out what would be the best way to realize the item dropping in a selectable radius around the egg.
    After I've got this working I need to figure out how I can easily implement the choice of which items should drop. (This shouldn't be that complicated, since a lot of plugins need this function either. Anyways, help with this would be appreciating!)

    For the first release I plan to have at least this features ready, which would already provide most of the requested features with the help of a commandblock. ^^"

    I hope for you all I can finish (at least those functions) till the end of this week, since on Wednesday I'll begin at my new job and I don't know yet how time taking that will be.

    Under every circumstances (excepting the www breaks xD) I'll publish the code on github next weekend, so if I wouldn't have time to continue this plugin, somebody else could do it! :)

    EDIT: Solved now the config for the item drops. Remaining problem is the drop probability... I'll look into this tomorrow.

    EDIT2: @ExoNeon You said, you want to schedule the spawn event so that it occurs repeatedly. But did you mean, that when you start the event in area A at, lets say 3:00 PM, and in area B at 3:30 PM, they occur the next time at 4:00 PM (A) and 4:30 PM (B)? Or would it be enough if all occur always at the same time? This is important to know for me, so I can do some design choices, and organize my time ^^" (the second one would be my choice, since it's easier).
    Last edited: Feb 28, 2016
  12. Offline


    @Ligachamp Yes, I would prefer they occur every hour and at the same time. I'm really loving the determination you're putting in this. Keep up the good work and take your time, no rush at all.
  13. Offline


    @Ligachamp I agree with Exo, well done DEV :)

    If i could maybe adjust 1 thing in case if you can still transform the code for this function and if ExoNeon agrees.

    What my idea, which i already did tell The previous DEV - maybe it is possible to make so that the egg has multiple spawn points, that the op can set by a command, so that we can have like at least 10 or so spawn points, from which the plugin randomly picks 1. And so that the spawn point gets picked randomly, so that players cant try and figure out at what time and where will the egg spawn.
  14. Offline


    Has this seriously taken so long to make? I do my homework quicker than this.

    If I understand correctly, the plugin is supposed to:
    • Spawn a Dragon egg within a random safe location in the world. By safe, I mean, not in the air, nor underground, not in water, not in lava, but solid ground.
    • (? Lightening effect on spawn ?)
    • Add a holographical display above this egg
    • Repeat the spawning once every hour
    • Once it's right-clicked: remove holographical display
    • drop a random set of general items within a reasonly close radius where the egg was
    • Shoot fireworks in the air!
    • Items can be picked up by any player
    • Repeat

    Sorry if I Left something out! But honestly, I might be wrong, but this doesn't really look like too much of a work.
    Last edited: Feb 29, 2016
  15. Offline

    timtower Administrator Administrator Moderator

    @DoggyCode™ People might be busy with their homework or more imporant things though.
    Or not that experienced.
    DoggyCode™ likes this.
  16. Offline


    I already thought this is a requested feature anyways xD Means, I'm already working on it ;)

    I know this doesn't sound that much, but after all it's a good piece of code to do. Also I'm not working fulltime on this, since I have a real life too :p

    The only point where you mabye could give me some advise is how I could look for a random safe place in an efficient way?
  17. Offline


  18. Offline

    I Al Istannen

    @Ligachamp I would go for picking a random offset on the x, y? and z axis. Then checking if this is a safe position. You could use World#getHighestBlockAt to get the upmost block, so that the egg spawns on the surface and not in a cave. If you have predefined spawnpoints you can use them though.

    This gets horrible inefficient if you try it in a lake of lava, as it will not find any safe position. You could cancel after X iterations though and give an error message/ log it.

    You could also check every block in the desired radius / cubus if it is safe, and if so either add it to a collection (set?) or roll a dice. If the dice roll is successful, pick it, otherwise go on. If you added it to a collection pick a random out of that in the end. If the collection is empty, you know there is no safepoint inside the desired area.

    Maybe DoggyCode has a better Idea though, this was just what came to my mind.
  19. Offline


    hmm, interesting, maybe setting it so that they can only spawn under open sky which would take away the effect of it spawning in caves.
  20. Offline


    This is basically what I'm doing right now. The complete randomness would be intresting as an extra feature. Means there is time to implement that, after the rest is finished ;) Using those predefined spawnpoints it is up to the player/admin to actually check if the position and the possible item drop radius is safe. But since the most admins won't use the /meggaddloc command with its [x][z] parameters, I don't think that would be a big problem. The only (not really) "downside" using this way is, that the egg always spawns at the same coordinates in those areas, but thats just a matter of coding...

    Since I've implemented only two ways to add possible spawn locations, which depend on the admins decision, the egg will ALWAYS spawn in safe locations ;) ok, maybe there are some admins who want to troll their members and place the egg on a lava field xD But if they do so it's not my fault ;P

    BTW, I have another question to you ^^ Do you mind if the commands are called "meggxyz" and use the alias "mg" instead of "me"? It just sounds better to me this way xD

    EDIT: As soon as the approval process is done, a first release can be downloaded here: http://dev.bukkit.org/bukkit-plugins/magicegg/
    Expect some bugs, I didn't have the time to check everything by myself :/ Also some features like the drop probability and automatic event restart on server restart are missing. Those will be implemented as soon as possible! I hope this became what you wanted it to be ^^" :)
    Last edited: Feb 29, 2016
  21. Offline


    Awesome work @Ligachamp !!! And yes I'm totally fine with mg!!! :p:p:p:p:p:p:p:p:p:p:p:p:p
    finally the wait is over...and the excitement and fun begins!

    @Ligachamp I cant thank you enough for making this possible. You are the man :rolleyes:
    Last edited: Feb 29, 2016
  22. Offline


    Happy to hear you're fine with mg! :'D

    And thanks for the praise (not sure if this word is appropriate ^^") ! :D But don't forget to thank @TheMrJezza too! Without his piece of code I don't know if I would have tried to continue this work ;)

    @TheMrJezza, BTW, you are mentioned as co-author in the plugin.yml ;)

    I'll look into creating a description of the config file now, since those options are not all self explainatory. Then I'll implement the drop probability.

    EDIT: Implemented now the probabilities system, item drops work now as requested :) Also there is no more need to restart the event by hand on a server restart ;)

    If any issues are found, please report them to me :) Also any suggestions are welcome!
    Last edited: Mar 1, 2016
Thread Status:
Not open for further replies.

Share This Page