Arrays?

Discussion in 'Plugin Development' started by Aephout14, Sep 25, 2014.

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

    Aephout14

    I will just be short with this, Everyone is yellow, Thus i probably need to deprecate it, The last line where new ArrayList(); is yellow

    Code:java
    1. ItemStack diamond_sword = new ItemStack(Material.DIAMOND_SWORD, 1);
    2. ItemMeta istackMeta4 = diamond_sword.getItemMeta();
    3. istackMeta4.setDisplayName("§B§lAwesome Sword");
    4. List<String> ls4 = new ArrayList();
     
  2. Offline

    fireblast709

  3. Offline

    Aephout14

    Code:java
    1. import org.bukkit.inventory.Inventory;
    2. import org.bukkit.inventory.InventoryView;
    3. import org.bukkit.inventory.PlayerInventory;


    These are colored yellow, Mind telling me how to fix that

    http://pastebin.com/E2Prv86Y
     
  4. Offline

    fireblast709

    The_FrosTy_Clan yellow usually is a warning. In the case of imports, they are most likely not used and could be removed.
     
  5. Offline

    Aephout14

    Last edited by a moderator: Jun 10, 2016
  6. Offline

    fireblast709

    The_FrosTy_Clan the main class is the one (and only) class that extends JavaPlugin. Note that 'main' in plugin.yml has to be the full classname, thus "main.InventoryKits".

    [note] It's considered to be a bad package. Generally, if you have a domain, use 'tld.domain.projectname' with the rest being your internal structure. I happen to own the domain darkseraphim.net, and assume a plugin called TestPlugin with Main being in the main package:
    Code:
    net.darkseraphim.testplugin.Main
    If you don't own a domain, use your mail (some people use com.gmail.<their gmail address>) or use me.<username>.<project>.

    [note 2] Packages are in lowercase, so no capitalized letters. Classes are in CamelCase. That's why testplugin is in lowercase and Main starts with a uppercase M. Just some oracle standards that keep your packages readable.
     
  7. Offline

    Aephout14

    Last edited by a moderator: Jun 10, 2016
  8. Offline

    fireblast709

    The_FrosTy_Clan well your current structure doesn't know the package 'me.FrosTy.eZKits' (and please, keep it lowercase). You would have to create the package and create the class Main in there, extend JavaPlugin, and get your plugin to work. The easiest thing right now is to rename your current main class to 'Main' and it's package to your package.
     
  9. Offline

    Aephout14

    I have a main extends javaplugin in one of my clases

    fireblast709 How do you rename stuff?

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

    mythbusterma

  11. Offline

    Aephout14

    God damn, This plugin is being a pain in my ass, the main package i had, It had the main extends javaplugin in it, I made it me.FrosTy.eZKits.Main in the plugin.yml (Yes i have used plugin.yml with capitals and it works perfectly)
     
  12. Offline

    mythbusterma

    coasterman10 and adventuretc like this.
  13. Offline

    Aephout14

    Dude, Just shut up, I know java, You don't gotta come here and start with your gay LEARN JAVA FIRST shit

    I have done this 20+ other times..

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  14. Offline

    fireblast709

    Please, let's try to keep it civil. His remark was towards your lacking understanding of packages. Like I explained before, you need to set 'main' to '<package of main class>.<main class>'. <package of main class> must be the same as the 'package <package of main class>' which should be on the first line of your main class.

    If you indeed have done this 20+ other times, then this should be absolutely no issue for you. Also, the capitals in the package name are not an error, merely a standard which Oracle set and which we attempt to follow to keep it a standard among all Java developers. They aren't set in stone, so the final decision will always be yours :3.
     
  15. Offline

    teej107

    Why do you get so hateful and offensive toward "Learn Java"? Is it because you don't like learning Java? If you read the plugin tutorial thoroughly, you would have read that the name attribute in the plugin yml must have the fully qualified name of your JavaPlugin extended class.
     
  16. Offline

    macboinc

    umadbro? :p
     
  17. Offline

    coasterman10

    This thread is pretty much proof of the contrary. You should know how to initialize a generic type, and you don't appear to know how packages work.
     
Thread Status:
Not open for further replies.

Share This Page