Library BukkitCommons - Commons library for Bukkit utils

Discussion in 'Resources' started by xTrollxDudex, Aug 9, 2014.

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

    xTrollxDudex

    Greetings all,

    BukkitCommons is a project I've been working on for several months, and today, I unveil it.

    Source: https://github.com/AgentTroll/BukkitCommons
    Changelogs: https://bukkitcommons.atlassian.net...lendarId=04aa90a1-679d-4e39-8719-f74bdd852bc0
    Public CI + CI builds: https://drone.io/github.com/AgentTroll/BukkitCommons
    Build status: [​IMG]
    Downloads: https://github.com/AgentTroll/BukkitCommonsBuilds (click here to get the latest build)
    Documentation: https://bukkitcommons.atlassian.net/wiki/display/BC/BukkitCommons Home
    Issues: https://bukkitcommons.atlassian.net...ssian.jira.jira-projects-plugin:summary-panel
    Javadocs (updated every successful build): http://agenttroll.github.io/BukkitCommons/

    Amongst the features, of which I am most proud of, is the AbstractHashStruct, (and its accompanying StructBuilder), which set to using the default hashing algorithm, has better performance than the HashMap provided in the Java library.

    There is also my reflection library, which, taking advantage of the sun.* packages, is able to call methods reflectively more efficiently than vanilla reflection. However, due to the volatility of sun.*, I have also included a disabling feature located in the Settings class, you may call
    PHP:
    Settings.setSafeReflection(true);
    to use vanilla (slower) reflection instead.

    Using the reflection framework, I also have a nifty class called ReflectionChain, which I am in the process of documenting. You can see how I used it personally here. It is currently being tested.

    I have also added formatting tables in the c.g.w.c.misc package, and a handful of other utilities in the c.g.w.c.providers package, such as TrigProvider, caching values of sin, cos, and tan trigs up to 36,000.

    Otherwise, this is still in the process of extensive development and testing. Hopefully, I can see this be used in your plugins!

    Note: Do not shade in or include the source files in your plugin. I still have to do more stability tests to determine if it is safe to do so, without disabling a few features.

    (Oh yes, and PS, Troll on :))

    UPDATE August 17 2014: Confluence docs and issues site have been updated to allow access without logging in.
    UPDATE August 19 2014: Changelogs available since the first release.
    UPDATE August 22 2014: Private members are now documented on the Javadocs
     
  2. Offline

    bobacadodl

    Love the TrigProvider :)
     
    xTrollxDudex likes this.
  3. Offline

    PandazNWafflez

    xTrollxDudex Impressive work, particularly on the AbstractHashStruct and it's implementations.
     
  4. Offline

    EnderTroll68

    Woah, I like this***
     
    xTrollxDudex likes this.
  5. Offline

    xTrollxDudex

    Um, wat?
     
  6. Offline

    PandazNWafflez

    How has this got 6 likes lol.
     
    Garris0n and xTrollxDudex like this.
  7. Offline

    xTrollxDudex

    "edited by JaguarJo" whut
     
  8. Offline

    Onlineids

    Time travel ftw
     
  9. Offline

    xTigerRebornx

    Onlineids More along the lines of "Time zones ftw". (Total joke killer)
    xTrollxDudex Any plans for a WeakHashStruct? (similar to WeakHashMap, where the keys are weak)
     
  10. Offline

    Onlineids

  11. Offline

    xTrollxDudex

    I will consider this, next time, open an issue :)

    Onlineids
    I swear, it said 18 on my iPad -_-
     
  12. Offline

    xTrollxDudex

  13. Offline

    xTrollxDudex

    First alpha build has been approved, get it here:
    http://dev.bukkit.org/bukkit-plugins/bukkitcommons/

    Also, the current build is unshippable because I made a late change which I want to improve on while off an IDE/flash drive. Nevertheless, whether or not it compiles is of no concern to me, what does concern me is the code, the content, and the documentation. It's more important to learn from the code than use it. It will be fixed tomorrow.
     
  14. Offline

    PandazNWafflez

    xTrollxDudex

    Considering the reflection utilities you have, some of which use sun reflection, I have some ideas you might want to implement based on sun reflection (these are all possible - I can provide working code for any of them if you want but maybe you want to have a look yourself first)

    - setting static final fields (idk if your unsafe implementation can already do this - if not, you have to 'doctor' the modifiers field in Field with reflection before using a sun FieldAccessor - but it's needed for the next one)

    - creating new instances of an enum (ConstructorAccessor, is needed but then you have to hack your way around the ordinal and $VALUES fields in the enum) - this is difficult but can be useful in testing for bugs in switch statements if you have a case for every enum value (so in theory you never get to default) but there is a bug in default. Maybe you could also use it to do something with CB / MC but idk what.
     
  15. Offline

    xTrollxDudex

    It is not required in the usage of Unsafe.

    The second is an interesting idea, but I don't know why you would want a new instance of an enum, as all fields are final, methods are accessed through the fields themselves.
     
  16. Offline

    PandazNWafflez

    xTrollxDudex yeah, but finding 'hacks' in the language is fun :p. But yeah idk what you could use new enum values for except testing a default statement. Could probably use it to break something which does a switch statement and just assumes that the enum won't change but that wouldn't be particularly useful.
     
  17. Offline

    xTrollxDudex

    You can always use the one by Jogy34 lol
     
  18. Offline

    Jogy34

    Whoo, got mentioned in a post that I had absolutely nothing to do with!!! :cool:

    I use my enum constant addition method mainly for when I create a custom entity so that it has its own EntityType so that it makes it harder for other plugins to mistake it as its base entity. I've also used it for adding to the Sounds enum just so that playing sounds from one of my plugin's resource pack looks nicer. I was already using it to add to EntityType so I thought I may as well use it for the sounds as well. At one point I also tried to help someone add to the GameMode enum but I don't know if they actually got anywhere with that though as I think there were some checks in player or something that may have defaulted it back to survival or something like that. I can't really think of other reasons to add to enums but there's 3.
     
  19. Offline

    PandazNWafflez

    Jogy34 cool, I hadn't seen yours actually, but those seem quite useful.
     
  20. Offline

    xTrollxDudex

    With the DMCA takedown, this will no longer be supported. I will port this over to TridentSDK however.
     
  21. Offline

    teej107

    TridentSDK? Interesting. I haven't heard about it before. How new is it? Is there a website that explains more about it?
     
  22. Offline

    xTrollxDudex

    We started 3 weeks ago.
     
  23. Offline

    teej107

    I would love to see how it turns out. Seeing as we have no knowledge (at least me) of when or if Bukkit will ever get off the ground again.
     
Thread Status:
Not open for further replies.

Share This Page