I need help with something very simple :P

Discussion in 'Plugin Development' started by porrinialex, Nov 3, 2013.

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

    Coelho

    http://docs.oracle.com/javase/7/docs/

    If you truly wish to learn Java, I recommend you do so. Otherwise, you will continue to struggle in your attempt to even remotely understand Bukkit, and I feel sorry for you in that respect.
     
  2. Not sure what you are trying to say, whether he should be begging for code on the forums or just learn how to read documentation and understand what each BASIC thing does before he uses it.
     
  3. Offline

    porrinialex

    SupaHam when did i ever beg for code? I was here to ask for help because i didnt know what to do. If you dont want to see this get off this forum section
     
  4. Offline

    1Rogue


    return statements designate the end of a method body when reached. You should really only use them if you are completely done:

    Code:java
    1. public void onCommand(/* args */) {
    2. if ("foo".equalsIgnoreCase(cmd.getName()) && sender.hasPermission("plugin.foo")) {
    3. sender.sendMessage("Foo detected!");
    4. } else if ("bar".equalsIgnoreCase(cmd.getName()) && sender.hasPermission("plugin.bar")) {
    5. sender.sendMessage("Bar detected!");
    6. }
    7. return true;
    8. }
    9. // Another way:
    10. public void onCommand(/* args */) {
    11. if ("foo".equalsIgnoreCase(cmd.getName()) && sender.hasPermission("plugin.foo")) {
    12. sender.sendMessage("Foo detected!");
    13. return true;
    14. }
    15. if ("bar".equalsIgnoreCase(cmd.getName()) && sender.hasPermission("plugin.bar")) {
    16. sender.sendMessage("Bar detected!");
    17. return true;
    18. }
    19. return false;
    20. }


    People telling you to learn Java first are not wrong, knowing the language that you are writing with is only going to make things easier, not harder.

    As far as a starting point, I recommend starting with the link below, and not skipping any of the material even if you think you know it.

    http://docs.oracle.com/javase/tutorial/getStarted/
     
Thread Status:
Not open for further replies.

Share This Page