[API] ClassAPI - Create configurable classes/kits with ease.

Discussion in 'Resources' started by sayaad, Jul 24, 2013.

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

    sayaad

    [​IMG]

    In the past, I've developed a lot of minigame plugins involving classes or kits. However, an API like this was nowhere to be seen. If there were such an API, it would've sped up the process of creating these plugins by quite a bit.

    Recently, I've been given the plugin of ZVH to develop, and it involved classes. Instead of creating a whole other class system, I've decided to make an API for it by the name of ClassAPI for other developers to use as well. It's purpose is simple, it is made to speed up the process of creating minigame plugins and to simplify the process if possible, as it does a very simple task.

    Features:
    • Completely thread safe - Everything down to the singletons are thread safe, allowing multiple plugins to hook into the plugin safely if needed.
    • Fully configurable classes.
    • Fully serialized - Storing classes is as easy as FileConfiguration.set("Classes.className", class); But I have a method for it in the API that supports different files.
    • Classes can be obtained from simply the name of the class, or can be obtained from a Player. (Their inventory. armour and active potion effects are used.)
    • Supports a default value if some objects used to create a class is null. (NullPointerExceptions are a thing of the past.)
    • There is more. :p
    Implementing:

    All you really need to do is check if the plugin exists in the plugins folder of the server, and create an instance of ClassAPI. I have more detailed instructions on the bukkitdev page.​

    Interested? :


    Reserved for updates and stuff.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
    bobacadodl and hawkfalcon like this.
  2. Offline

    bobacadodl

    Why is this now getting more attention? Its awesome! It even includes classes for saving itemstacks to config and stuff! I slightly modified it to be able to save chest contents :D
     
    sayaad likes this.
  3. Offline

    sayaad

    Glad you like it. :3

    I also improved the serialization of it a while ago, didn't write the javadocs yet though.
    It also now supports item lores and coloured leather armour.
    Here's the source.
     
    bobacadodl likes this.
  4. Offline

    bobacadodl

    nice! keep up the awesome work :)
     
  5. Offline

    sayaad


    It's not that popular currently because not much plugins use it and thus not much people knows about it.
    If you made a plugin that uses it as a required plugin I'll gladly add the plugin to the plugin list on my bukkitdev page and hopefully more developers will know about it!
     
  6. Offline

    bobacadodl

    sayaad
    Ive been using this a lot lately, and it would be really awesome if you added in a method to check if a class exists in the config :) (To prevent people from selecting invalid classes and causing errors :p)
     
  7. Offline

    sayaad


    Well, glad you like it!

    I will add this later, but for now the easiest way of doing it is surrounding getClass with a try-catch that catches a ClassNotFoundException. You can also check if the obtained class.equals(new NullAbstractClass(api)).
     
  8. Offline

    bobacadodl

    Oh, thanks!
     
  9. Offline

    sayaad


    No problem!
    Just glad too see someone uses the API.
     
  10. Offline

    bobacadodl

    Lol. Its saved me so much time. I've created around 5 minigames with it already.
     
Thread Status:
Not open for further replies.

Share This Page