Suggestion Change in Plugin Development sticky threads

Discussion in 'Forum Feedback' started by teej107, Jan 14, 2015.

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

    teej107

  2. Offline

    AdamQpzm

    @teej107 I agree with this - those threads aren't updated anymore and people who needed to know about them know by now. People don't often get the "ambiguous health" error message anymore, so I need more material for one of my big lists of people who don't read the sticky posts!
     
  3. Offline

    teej107

    @AdamQpzm Yeah, I still think it wouldn't hurt to leave the "ambiguous health" thread up or have something in a thread about it. Like a do's and don'ts for Bukkit. There's even this: http://bukkit.org/threads/common-mistakes.100544/ but I think something that's simple, small, and to the point will be better. Something like this maybe:
    • Don't build with CraftBukkit!
    • Don't access Bukkit methods asynchronously
    • Don't instantiate a JavaPlugin extended class.
    Just something along those lines.
     
    AdamQpzm likes this.
  4. Online

    timtower Moderator Moderator

    @teej107 Feel free to write something up and share it on here. Might make it through.
    We indeed need new ones imo
     
    bwfcwalshy likes this.
  5. Offline

    teej107

    Sounds good but what sticky threads do we think need replacing? I suggested the 2 in the OP. Maybe condensing this http://bukkit.org/threads/common-mistakes.100544/ down a bit.
    @AdamQpzm thinks the "ambiguous health" thread has served it's purpose.
     
  6. Online

    timtower Moderator Moderator

    @teej107 Just make it for the threads that need to be replaced in your opinion.
     
  7. Offline

    AdamQpzm

    @teej107 I'm thinking there should be something like the common mistakes thread (which is where ambiguous method call could go), but more centred around specific errors that are common. Of course, if people read the sticky threads, they'd see the "debug your own stacktrace" has a lot of that kind of thing...
     
  8. Offline

    teej107

    timtower likes this.
  9. Offline

    Skionz

    @teej107 You should write a READ ME FIRST thread as well.
     
    teej107 likes this.
  10. Offline

    teej107

    @Skionz I might have that as the title.
     
  11. Online

    timtower Moderator Moderator

    @teej107 Chances are that you write it yet a moderator or admin posts it though, with a thank you line of course
     
  12. Offline

    teej107

    @timtower Ok. At least have the title give the message to the reader that they should read the thread.
     
  13. Online

    timtower Moderator Moderator

    @teej107 If you put the title in the document ( because I will forget this )
     
  14. Offline

    Skionz

    @teej107 Add something about posting all relevant classes and stack-traces.
     
  15. Offline

    mrCookieSlime Retired Staff

    @Skionz
    To add on that:
    *All relevant files as the issue might even be related to the plugin.yml or the config file. But still, good point.
     
    Experminator and Skionz like this.
  16. Offline

    Experminator

    I agree with this too!
     
  17. Offline

    teej107

    The contents of this to replace/remove these threads: http://bukkit.org/threads/common-mistakes.100544/, http://bukkit.org/threads/oops-i-didnt-break-your-plugins-ambiguous-gethealth.156975/, http://bukkit.org/threads/discussion-oops-i-broke-your-plugins.961/, http://bukkit.org/threads/oops-i-broke-your-plugins.599/.

    Suggested Sticky Thread Title: READ ME: Do's & Don'ts of Bukkit!
    _____________________________________________________________________________
    Before you post your problem: Do research! Search via a search engine and this forum. Chances are your problem has already been solved in a different thread. If you still need help after doing research, then post a thread here. Please do not necro-post a thread. After posting a thread, please follow the forums rules for bumping your thread! Be patient as your problem may not be as easy to solve as others. You can continue to do more research while you are waiting for an answer.

    Posting a thread: When making a thread, be sure to describe the problem, what you are trying to achieve, the question, and all relevant files pertaining to the problem. These may include but aren't limited to: source code, stacktrace, plugin.yml.

    Receiving an answer: Don't get mad or shrug off links posted in an answer. It was posted to help answer your question so please read it thoroughly. Us developers don't like saying the same thing over and over. Like in programming, we like to use the same thing (methods) as many times when possible to achieve an output.

    ___________________________________________________________________​

    A basic Java knowledge is a prerequisite for making plugins
    : Please learn and understand Java before you start making plugins. Java is the language you are using when you develop plugins. Bukkit is just an API. It's a lot easier to learn Java first then learn an API rather than attempting to understand both simultaneously. You should always learn the language you are writing in. You wouldn't write a book in a language you don't know so don't do the same with code

    Be aware of bad tutorials: If you want to learn Java, reading the tutorials by Oracle are among the best tutorials you can use: http://docs.oracle.com/javase/tutorial/. If you want to learn the Bukkit API, the Bukkit wiki has great tutorials as well: http://wiki.bukkit.org/Plugin_Tutorial. When learning the Bukkit API, YouTube is among one of the worst methods to learn. The popular channels for Bukkit teach bad development practices and are outdated. It is advised to stay away from them if you want good quality information. The Plugin Development Resources section on this forum is another way to find other tutorials relating to Bukkit. Some are good and some are not so good. Reading the comments in the thread is a good way to find out!

    Read the official Bukkit tutorials: There is nothing better than learning how to use the Bukkit API than the Bukkit tutorials. Please use them. http://wiki.bukkit.org/Portal:Developers

    Use the code tags: If you are posting code, please put them in the code tags. Code pasted without using the code tags can be difficult to read and people are less likely to read it. Even putting stacktraces in the generic code tag will help greatly as well.

    Build with the lowest Java version you are willing to support: Bukkit is built using Java 6. Plugins compiled with a higher Java version will not work with servers running a lower Java version. Plugins made with a lower Java version will still work with servers running a higher Java version though.

    Do not build against CraftBukkit: CraftBukkit is the server software. Bukkit is the API used for plugins. Even if you are using NMS, still reference Bukkit in your build path. Doing so will avoid compiler issues such as "ambiguous getHealth()" (There has been way too many thread about that issue).

    Learn to read stacktraces and fix runtime errors: http://bukkit.org/threads/how-to-re...ubleshoot-your-own-plugins-by-yourself.32457/ It is so much quicker to solve problems when you know why errors are thrown in the console. It should in my opinion be a part of basic Java knowledge.

    Debug with System.out.print methods: Sometimes code doesn't seem to run and you don't get the expected result. To make sure the code is executing, you can put a simple System.out.println(something) to print to the console to let you know if the code is running or not. If you don't get the result you're expecting, you may have to rethink your logic!

    Do not instantiate a JavaPlugin extended class: It is CraftBukkit's job to do that and not yours. Any attempt to do so will result in an error being thrown.

    Do not access Bukkit's methods asynchronously: Most of the Bukkit API is not thread safe. You must use those methods on the main thread.

    Do not sleep the main thread: Thread.sleep(integer here) is a big no-no on the main thread. This will pause the entire server. Please read this if you need to perform timed tasks: http://wiki.bukkit.org/Scheduler_Programming

    Using SQL: Like above, perform SQL queries on a separate thread as they can also pause the server.

    Be wary of storing Player objects in Collections or Maps: If the Player does not get removed from the Collection or Map when they leave, memory leaks will occur. You can prevent this by removing the player from the Collection/Map when they leave. Other alternatives include using WeakReferences (like WeakHashMap , "WeakSet", etc) or storing UUIDs in place of the player. Using UUIDs doesn't have as big of a memory hit like a Player does.
    _____________________________________________________________________________
    All I can think of for now. Please remind me of any other Bukkit related problem that you think should be addressed.
     
    Last edited: Jan 17, 2015
    nverdier likes this.
  18. Offline

    mrCookieSlime Retired Staff

    Merged into previous Thread.
     
  19. Offline

    teej107

  20. Offline

    mrCookieSlime Retired Staff

    @teej107
    So far so good, some suggestions though:
    - Use qoutes instead of spoilers, most people wont open them
    - Add that you should stay away from YT Tutorials
     
    teej107 likes this.
  21. Offline

    Skionz

    @teej107 Add something about debugging logic errors before posting.
     
    teej107 likes this.
Thread Status:
Not open for further replies.

Share This Page