Bukkit wiki Plugin Tutorial

Discussion in 'Plugin Development' started by sharqman, Jun 5, 2014.

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

    sharqman

    So I'm trying to get into making plugins. I was looking at the wiki and I know that a lot of it is probably outdated. I'm having one problem when it talks about reloads it says to use this code
    Code:java
    1. for (Player player : Bukkit.getServer().getOnlinePlayers()) {
    2. playerList.put(player.getName(), playerData(player));
    3. }

    I put it in the onEnable() method. playerList looks like an Object variable and playerData looks like a method, they are both not recognized and eclipse isn't tell me to import anything for them.
    I'm using 1.7.9 r0.2 API

    Oh yeah and what would be the method for getting uuids?
     
  2. Offline

    AoH_Ruthless

    sharqman
    That's just an example that you don't need anywhere in your code. The Wiki Plugin tutorial is more updated than any other tutorial you'd find I would bet.
     
    es359 likes this.
  3. Offline

    fireblast709

    sharqman It is an example, it is not ment to be copy-pasted :p. And Player#getUniqueId()
     
  4. Offline

    sharqman

    Ok thanks!

    So about this hashmap thing, I've never worked with them before. What would be best way to create one for players? Just Hashmap playerList = new Hashmap(); ?
     
  5. Offline

    Adriani6

    sharqman

    This is how you define (create) a new hashmap.
    Code:java
    1. HashMap<String, String> map = new HashMap<String, String>();
     
  6. Offline

    AoH_Ruthless

    sharqman
    Depends what you want to do with players. You could also be wanting the use of sets or lists.

    You really should look into actually learning Java before proceeding with this. This is a Java question and as such, you are really expected to know the fundamentals. I strongly encourage you learn Java then Bukkit, not the other way around. From personal experience, I can tell you that you do not wish to go down that path.
     
  7. Offline

    sharqman

    I know Java, I just have never dealt with hashmaps before.
     
Thread Status:
Not open for further replies.

Share This Page