Resource API for lazy developers

Discussion in 'Spigot Plugin Development' started by Omel, May 1, 2017.

  1. Hello,

    I developed an API for lazy developers! :)

    Functions are explained at the Resource Page! :)

    Checkout the API here > KLICK <
     
    • Funny Funny x 1
  2. A lot of the stuff in this API is redundant and doesn't really help lazy developers at all, because even if you don't need to register things in a different file, you need to do stuff in onEnable(). Let me give a few examples
    "Lazy" commands still need to be instantiated, this can be fully avoided by using proper command frameworks like ACF
    The "Quick" Events do absolutely nothing different from the Bukkit API.
    MySQL can be accomplished just as easily by using HikariCP, and it's probably implemented better
    The inventory and ItemBuilder doesn't have many differences from the Bukkit API, if someone wants a decent inventory API, I would suggest my API: KInventories (plug plug)
    The scheduler is absolutely redundant and serves no purpose at all
     
    • Agree Agree x 3
  3. Mas

    Mas

    [​IMG]
    I was scared about opening that spoiler.
    I was right to be so.
     
    • Funny Funny x 5
    • Winner Winner x 1
  4. You know what static modifier means in Java? o.o
     
    • Funny Funny x 2
  5. You dont know what my Scheduler contains :/
     
    • Optimistic Optimistic x 1
  6. It contains the same stuff as the bukkit scheduler. Hell, it looks like all it's doing is wrapping the Bukkit scheduler and just playing with the TimeUnit it's been provided. That's not useful. All that would do is bloat the final size of the plugin
     
  7. DID U EVEN LOOKED INTO THE CODE?! I hate people who judge before they informated theirselfes...
     
    • Funny Funny x 1
  8. Well what does it mean according to you?
     
  9. I said it seemed like. Quit with the caps. Just because I'm saying that I find this resource utterly pointless and that it provides nothing to developers who use it doesn't mean that you can't use it. Christ
     
    • Agree Agree x 1
  10. That you not have to instantiate classes again when u need them. That means u instantiate them once and then you can access to them when needed
     
    • Funny Funny x 6
  11. Okay, here is my childish response.
    HAHAHAHAHHAHAHAHAHAHA
    I'm done. I am so fucking done. I've lost hope in programmers and humanity. Experienced developers, please restore my hope by roasting the shit out of this crap.
     
    • Agree Agree x 4
    • Funny Funny x 2
  12. And this, ladies and gentlemen, is what happens when you don't put time into learning Java!

    Anyways, let me correct you. First off, that idea of static
    NO
    Static means that something should be held independant of class instances. Using it just because you don't feel like instantiating something is abusive and shouldn't be done
     
    • Agree Agree x 3
  13. I like developer roasts, always entertaining =]
     
    • Agree Agree x 6
    • Like Like x 1
  14. Mas

    Mas

    Yes, I do. That's why I spent 5 minutes making a crappy meme about your misunderstanding of it.
     
    • Like Like x 2
  15. IMO if you put up something that isn't even an API then you're bound to be ripped a new one.
     
    • Agree Agree x 1
  16. Yes, something you seem to abuse a lot. You shouldn't make everything static just so other classes can access it, even less make them both public and static (without final, which would make them constant)
    I did, it's not much better than using the provided BukkitScheduler. In fact, you still need it to get back to the main thread, since everything you use runs asynchronously. (Which seems to be a problem elsewhere as well, f.e. you use an async task for the particles, and decide to access the World object on another thread, while this is known not to be thread safe). To top it off, every scheduler seems to use it's own ExecutorService.

    Moreover, your QuickEvent doesn't work due to type erasure (Bukkit doesn't like event handlers which listen to 'Event' events), and it doesn't even keep state (could attempt to register itself twice)

    TabCompleteAdapter only removes two parameters, while sacrificing extensibility of your class (TabCompleter is an interface, which allows you to still extend a class)

    MySQL code doesn't use try-with-resources, allowing resource leakage

    Command utility doesn't cache reflection.

    NMSReflection should cache the version.

    Hologram utility uses Lists rather than Maps, paths use hardcoded slashes (rather than using the platform specific File.separator constant), each holograms seems to open the file itself, rather than globalised saving (open once, write all), Entities in collections is bound to leak memory since we aren't notified of despawns (use weak referencing)

    Inv is just a wrapper around Inventory.

    Don't create Random instances every time you need them, use ThreadLocalRandom. Besides, why is AutoBroadcaster even abstract?

    You shouldn't keep strong references to Worlds for the same reason you don't keep strong references to Entities, you don't create new Random instances every time you need one, your airdrops code will die if the Y column of the location has no blocks (or at least below the current location), and will take the server with it (or throw an error if you're lucky). Your tasks are also unmanaged, and can be cancelled multiple times (where the second call will already throw an error)

    Don't return concrete types where abstractions suffice (returning HashMap instead of Map). Why are you checking if an event is cancelled before firing it (in fact, you fire the event after you spawn the pet, ignoring the result)

    There's probably more, and this post could probably be formatted better, but doing this all on a phone sucks. I could draw the conclusion that you will probably do yourself good by grabbing a book and practicing a bit more :p
     
    • Winner Winner x 12
    • Like Like x 2
    • Agree Agree x 1
    • Informative Informative x 1
  17. Can I follow people twice.
     
    • Agree Agree x 2
    • Funny Funny x 2
    • Friendly Friendly x 1
  18. Choco

    Moderator

    IMG_2847.JPG

    Seriously... where's that second follow button?
     
    • Like Like x 2
    • Agree Agree x 1
    • Funny Funny x 1
    • Friendly Friendly x 1
  19. I looked at this thread and thought "Well despite all the shit he got, it can't be that bad", then I checked his API, now I'm considering javacide *Ba dum tss*
     
    • Like Like x 1
  20. Serializator

    Supporter

    You know that I love you very much, but after reading your roast, I love you even more babe! *goodnight kiss*
    Just to clarify for the unknowing reader, not gay, sorry, I know you became instantly gay because of me ;-3
     
    #20 Serializator, May 2, 2017
    Last edited: May 2, 2017
    • Friendly Friendly x 2
    • Agree Agree x 1
    • Winner Winner x 1