Best way to learn Java.

Discussion in 'Plugin Development' started by calebbfmv, Jul 26, 2012.

?

What is the best way to learn programing?

  1. Videos, and reading?

    29.2%
  2. Diving and learning as you do it?

    58.3%
  3. Something else? Post it!

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

    Firefly

    Who are we checking isOp() on? Figure that out and get an object of that type.

    Show Spoiler

    Player
     
  2. Offline

    calebbfmv

    I did, but I still is error?
    What are you thinking that the code is?
    Maybe I am misunderstanding it?
     
  3. Offline

    Firefly

    for (Player p : getServer().getOnlinePlayers()) {
    if (p.isOp()) {
    sender.sendMessage("Hey, this guy is an admin! " + p.getName());
    }
    }
     
  4. Offline

    calebbfmv

    :O I was way off.... I suck

    That seems to work, I am going to edit this and try and make it work with permission plugins, because not all admins have OP
    EDIT Just tried it, but it just echoes the command :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  5. Offline

    Firefly

    Alright. That's your choice.
     
  6. Offline

    SnRolls

    Here its 1000€ :S!
     
  7. Offline

    raGan.

    I think the best way to learn things is to actually try to figure out how to do them. A week ago, I did not know java at all. I looked through java tutorial and then plugin tutorial, then I browsed this forum a bit and put together my first plugin. Code might not be the best, but it works. (at least I think it does)
     
    russjr08 likes this.
  8. Offline

    Sagacious_Zed Bukkit Docs

    You don't need to depend on another plugin to check if someone has permission. In fact if you are not using sub commands, and you should not for your first plugin, you don't even need to check if someone has permission. If you declare in plugin.yml that a command a permission bukkit will automatically check them at no extra work to you.
     
  9. Offline

    calebbfmv

    You see, thats too easy, I want not so easy
     
  10. Offline

    Sagacious_Zed Bukkit Docs

    It seems that at this point you have picked up the syntax of Java. What you lack is the architecture skills behind it to make it work. You really do need to understand instances, objects, pointers, etc.

    The hard part about programming was never describing to the computer how to solve a problem. It has always been figuring out a way to get the computer to solve the problem.
     
    Icyene likes this.
  11. Offline

    Icyene

    And that children, is why plugins that should take a day to make take a week.
     
    russjr08 likes this.
  12. Offline

    calebbfmv

    Or a month, or a year, or never get made because of the endless raging. :'(
     
  13. Offline

    russjr08

    That happens when you don't return correctly.
     
  14. Offline

    calebbfmv

    I did, fml :'(
     
  15. Offline

    Icyene

    Well after your first plugin everything else comes much easier. Programmers are lazy. If there is a plugin that can share even 1 byte of code with another plugin you made, you will do so. My plugin CrimsonStone and my indev plugin Storm already use basically the same code for 4 classes, and alot of Storm's classes are the same but with slight modifications. Once you a base of code that you know how to use, alot of your programming will be copy + pasting and changing variable names.
     
  16. Offline

    russjr08

    Use return true; after you finish your command :)
     
  17. Offline

    calebbfmv

    Icyene
    OK I do, and I get spammed with errors. I mean I know there has to be a way, I just don't know it.
    Here is my idea, not in code, but how it would work:
    using pex (for now) find a user in a group, if the user is in the group and online, when you do /<groupname> He will appear. That wasn't the best let me try again: /Admin lists all online admins by finding anyone within the group Admin, online. Better?
     
  18. Offline

    Sagacious_Zed Bukkit Docs

    IF you get spammed with errors, read the errors, most of the time they tell you what exactly is wrong. Also Fix one error at a time, normally the one that happens first.
     
  19. Offline

    calebbfmv

    I get spammed with errors in eclipse, they dont say anything but can't do it basically.
     
  20. Offline

    Sagacious_Zed Bukkit Docs

    did you read the problems/markers tab?
     
  21. Offline

    calebbfmv

    Yep! I can't get it, I can't get any useful help, so I am done with it! I suck at Java, and I can't even make a simple freaking plugin, so why should I continue?
     
  22. Offline

    Sagacious_Zed Bukkit Docs

    You have it backwards, learn java first, then make plugins. Making plugins while learning java only makes life more difficult. As for the errors, the Internet will translate the technical description to something you can understand, but unless you post your problems, no one but you knows what they are (don't lose theory of mind).
     
  23. Offline

    calebbfmv

    I deleted it in a rage. I took java for a month, then started bukkit, still can't do it. I guess this just isn't my thing.
     
  24. Offline

    Sagacious_Zed Bukkit Docs

    A month is an incredibly short amount of time if you have only just began learning how to program.
     
  25. Offline

    calebbfmv

    Nah I didn't just learn how to. I moved it to PlugReqs because I am still not sure what to do. OK now one more thing before I completely give up, could you help me make it? If not, then someone else can make it or not, but I cannot seem to.
     
  26. Offline

    russjr08

    If you post what's wrong and provide code/stacktraces (Errors basically), I'm sure lots of people will love to help, including me :) (I'll try at least :p)
     
  27. Offline

    Taien

    Same here. Messing around with existing stuff really helps too. The more you do it, the more you understand. My problem right now is understanding Vectors -.-
     
  28. Offline

    russjr08

    ^^Same here! For example, I didn't even know constructors existed until I wanted to use config options from another class.... lol
     
  29. Offline

    calebbfmv

    OK code: http://pastebin.com/hN8binEC <--- new link old one was out of date
    So when I create the the perms.playerInGroup() thing, nothing is wrong right? But when I save it, everything with Permissions is errored, and so is playerInGroup, what am I doing wrong
     
  30. Offline

    Jnorr44

    I jumped into it head first with a fairly large plugin... The harder it seems the faster you will learn. If you get stuck, feel free to ask a ton of questions here, we actually love to answer questions. Also, just reading other code and trying to understand it line by line helps greatly, and can teach you new ways to do things!

    EDIT - permissions... if (player.hasPermission("example.permission")){
    do something...
    }
     
Thread Status:
Not open for further replies.

Share This Page