Solved != null check error with config

Discussion in 'Plugin Development' started by plasticono, Oct 7, 2016.

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

    plasticono

    So I am making a Teams plugin. I have done a lot, but I need some help. I am currently testing the basic commands of the teams, but I can't execute more than 0 arguments without getting an error. The error is always the !=null check if the player is in a team or not. For example:

    Code:
    if(args[0].equalsIgnoreCase("info")){
                                if(plugin.getConfig().getString(p.getName() + ".team") != "no-team"){
                                    p.sendMessage("[" +plugin.getConfig().getString(p.getName() + ".team") + "]");
                                    p.sendMessage(ChatColor.DARK_AQUA + ChatColor.BOLD.toString() + "Password: " + ChatColor.GRAY + plugin.getConfig().getString("teams." + plugin.getConfig().getString(p.getName() + ".team") +".password"));
                                    p.sendMessage(ChatColor.DARK_AQUA + ChatColor.BOLD.toString() + "Members");
                                    List members = plugin.getConfig().getList("teams." + plugin.getConfig().getString(p.getName() + ".team") + ".members");
                                        for(int i = 0; i < members.size(); i++) {
                                            p.sendMessage(ChatColor.GRAY + members.get(i).toString());
                                        }
                                }else{
                                    p.sendMessage(Main.prefix + ChatColor.GRAY + "You are not in a team.");
                                }
                               
                            }
    This is where the error is. I tried adding them to a config with "no-team" instead of using null, but when I did that nothing changed. Here is the onJoin code if that helps.
    Code:
    @EventHandler
        public void onJoin(PlayerJoinEvent e){
            Player p = e.getPlayer();
           
            if(plugin.getConfig().get(p.getName() + ".team") == null){
                plugin.getConfig().set(p.getName() + ".team", "no-team");
                plugin.saveConfig();
            }
        }


    Also I my main class code, so you can understand how the whole plugin works without replying with "can you show me this"

    Code:
    package com.plasticono;
    
    import org.bukkit.ChatColor;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin{
       
       
        public static String prefix = ChatColor.DARK_AQUA + "[Teams] ";
       
        public void onEnable(){
            PluginManager pm = this.getServer().getPluginManager();
            pm.registerEvents( new teamCommand(), this);
            getCommand("team").setExecutor(new teamCommand());
            getCommand("t").setExecutor(new teamCommand());
            getConfig().options().copyDefaults(true);
            saveConfig();
            }
    }
    Thanks for taking the time to help me :D
     
  2. Offline

    I Al Istannen

    @plasticono
    What is wrong. You said the != null check, but what is wrong with it? Does it not work? Does it throw any exception?

    And you need to use .equals for objects, not ==.
    Code:
    if(plugin.getConfig().getString(p.getName() + ".team") != "no-team"){
    Change that to equals.

    Have a look here for an explanation and here for another one.
     
  3. Offline

    plasticono

    Here is the error when I use your method. I also noticed my config isn't ever updating. It is always blank.

    Code:
     plasticono lost connection: Disconnected
    [12:36:16 INFO]: plasticono left the game.
    [12:36:18 INFO]: UUID of player plasticono is c8897d7f-17d4-41d7-baf4-035bac06dd11
    [12:36:18 ERROR]: Could not pass event PlayerJoinEvent to pTeams v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:297) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerList.onPlayerJoin(PlayerList.java:282) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerList.a(PlayerList.java:142) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.LoginListener.b(LoginListener.java:115) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.LoginListener.c(LoginListener.java:53) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.NetworkManager.a(NetworkManager.java:222) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.ServerConnection.c(SourceFile:168) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:742) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:336) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:626) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:534) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at com.plasticono.teamCommand.onJoin(teamCommand.java:31) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:295) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            ... 14 more
    [12:36:18 INFO]: plasticono[/127.0.0.1:52747] logged in with entity id 5347 at ([world]322.5334817736706, 72.0, 181.125417993309)
    
    
    
    That is when a player joins the game.

    This is when a player types /team info

    Code:
    plasticono issued server command: /t info
    [12:37:10 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 't' in plugin pTeams v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:625) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:943) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:37) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:9) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
            at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:670) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:336) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:626) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:534) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at com.plasticono.teamCommand.onCommand(teamCommand.java:111) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            ... 15 more
     
  4. Offline

    I Al Istannen

    @plasticono
    You never null check.
    You can either do that or use the fact that equals should return false if you compare against null.
    This means:

    "something".equals(null) ==> False
    null.equals("something") ==> Exception

    1) Follow naming conventions:
    • Classes (including Interfaces and Enums):
      • Start with an upper case letter and then camelCase (called PascalCase, I think)
      • Ex.: AClass, AnotherClass, NbtWrapper, NullPointerException
    • Variables:
      • Start with a lower case letter and then camelCase
      • Ex.: aVariable, anotherOne, aVeryVeryLongOne, playerAge
    • Constants (final variables) and enum entries:
      • All upper case, no spaces but underscores ('_') instead
      • Ex.: GOLDEN_RECORD, LAUNCH_CODE_ONE
    • Packages:
      • All lowercase
      • Should be the domain name backwards. Common practice here is "me.username.project" as many do not have an own domain.
      • Ex.:
        • Bukkit.org, Project "CraftBukkit" ==> 'org.bukkit.craftbukkit'
        • User "I Al Istannen", Project "Warps" ==> 'me.ialistannen.warps'
    You followed most of them, but not all.

    2) Don't make every variable public.
    You should make public getters and the variable private. If you really want to make it public (and static), enusre no modification can be done you don't like.

    This prefix is not nice at this class (maybe an enum for them?), but at least make it final.

    3) Saving the config
    "plugin.saveConfig();"
    This saves it to the file and is expensive. I would save it in onDisable and maybe periodically.

    4) Data storage and Data model
    You are doing everything using the config keys. This is a valid way, but I think there are nicer ones.
    I would make a "Team" object. This contains the UUID of the owner and the UUIDs of the members. Implement ConfigurationSerializable to make it savable to the config. Here is a tutorial for the latter.
    Then you can just use the team object, like team.getPassword, team.getLeader, team.getMembers and so on.


    I haven't seen where you add your members, but the key [p.getName() + ".team"] doesn't exist.
     
    Last edited: Oct 12, 2016
  5. Offline

    plasticono

    @I Al Istannen So I've done some, but I still cant figure out how to create sections in the config that will stay there or even go there at all.
    This is what I have for on Join:
    Code:
    @EventHandler
        public void onJoin(PlayerJoinEvent e){
            Player p = e.getPlayer();
                plugin.getConfig().createSection(p.getName());
                plugin.getConfig().createSection(p.getName() + ".team");
                plugin.getConfig().set(p.getName() + ".team", "no-team");
                plugin.saveConfig();
                p.sendMessage(ChatColor.GREEN + "Your profile has been setup");
        }
    I am going to change it so if it is already setup it won't reset your stats, but it gives me this exception and I don't know what to do about it

    Code:
    [18:23:14 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'team' in plugin pTeams v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:625) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:943) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:37) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:9) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
            at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:670) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:336) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:626) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:534) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at com.plasticono.teamCommand.inTeam(teamCommand.java:54) ~[?:?]
            at com.plasticono.teamCommand.onCommand(teamCommand.java:119) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            ... 15 more
    
    [18:23:19 INFO]: CONSOLE: Please note that this command is not supported and may cause issues when using some plugins.
    [18:23:19 INFO]: CONSOLE: If you encounter any issues please use the /stop command to restart your server.
    [18:23:19 INFO]: [pTeams] Disabling pTeams v1.0
    [18:23:19 INFO]: [pTeams] Loading pTeams v1.0
    [18:23:19 INFO]: [pTeams] Enabling pTeams v1.0
    [18:23:19 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [18:23:19 INFO]: CONSOLE: Reload complete.
    [18:23:21 INFO]: plasticono issued server command: /t leave
    [18:23:21 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 't' in plugin pTeams v1.0
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.craftbukkit.v1_8_R2.CraftServer.dispatchCommand(CraftServer.java:625) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.handleCommand(PlayerConnection.java:1083) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnection.a(PlayerConnection.java:943) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:37) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PacketPlayInChat.a(SourceFile:9) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_101]
            at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_101]
            at net.minecraft.server.v1_8_R2.SystemUtils.a(SourceFile:60) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:670) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:336) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:626) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:534) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at com.plasticono.teamCommand.inTeam(teamCommand.java:54) ~[?:?]
            at com.plasticono.teamCommand.onCommand(teamCommand.java:119) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            ... 15 more
    [18:24:05 INFO]: plasticono lost connection: Disconnected
    [18:24:06 INFO]: plasticono left the game.
    >rl
    [18:24:07 INFO]: CONSOLE: Please note that this command is not supported and may cause issues when using some plugins.
    [18:24:07 INFO]: CONSOLE: If you encounter any issues please use the /stop command to restart your server.
    [18:24:07 INFO]: [pTeams] Disabling pTeams v1.0
    [18:24:07 INFO]: [pTeams] Loading pTeams v1.0
    [18:24:07 INFO]: [pTeams] Enabling pTeams v1.0
    [18:24:07 INFO]: Server permissions file permissions.yml is empty, ignoring it
    [18:24:07 INFO]: CONSOLE: Reload complete.
    [18:24:09 INFO]: UUID of player plasticono is c8897d7f-17d4-41d7-baf4-035bac06dd11
    [18:24:09 ERROR]: Could not pass event PlayerJoinEvent to pTeams v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:297) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit.jar:git-Bukkit-0a645a2]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerList.onPlayerJoin(PlayerList.java:282) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.PlayerList.a(PlayerList.java:142) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.LoginListener.b(LoginListener.java:115) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.LoginListener.c(LoginListener.java:53) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.NetworkManager.a(NetworkManager.java:222) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.ServerConnection.c(SourceFile:168) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.A(MinecraftServer.java:742) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.DedicatedServer.A(DedicatedServer.java:336) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.z(MinecraftServer.java:626) [craftbukkit.jar:git-Bukkit-0a645a2]
            at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:534) [craftbukkit.jar:git-Bukkit-0a645a2]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_101]
    Caused by: java.lang.NullPointerException
            at com.plasticono.teamCommand.onJoin(teamCommand.java:65) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_101]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_101]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_101]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:295) ~[craftbukkit.jar:git-Bukkit-0a645a2]
            ... 14 more
    [18:24:09 INFO]: plasticono[/127.0.0.1:50112] logged in with entity id 28894 at ([world]320.896494980741, 72.0, 166.32502029101317)
     
  6. Offline

    I Al Istannen

    @plasticono
    Does the message even output? How does the generated config.yml look like?
     
  7. Offline

    plasticono

    @I Al Istannen The config is always empty. I've been contacting some other coders and nobody can figure it out.
     
  8. Offline

    I Al Istannen

    @plasticono
    If you would upload the code to github or post a zip with the source, I could take a further look at it.
     
  9. Offline

    plasticono

  10. Offline

    Firestar311

    I copied your code into my own workspace to see if I can get it to work, here are the problems with your code that I have found. I had 18 warnings from Eclipse when I pasted it in
    1. Naming conventions
    2. In the teamCommand class, you have public void teamCommand(Main instance). If this is the constructor, remove the "void" keyword.
    3. Throughout your use of the List interface, you never specify which type. it is List<E>, the E is a generic, If you do not know what that is, look it up, it is basic java.
    4. isManager and getMembers use config.getList, use config.getStringList if you are getting strings
    5. In your onCommand method in your teamCommand class, you reference plugin.prefix, use Main.prefix if it is static. You do this 2 times in the onCommand
    6. You never provide a type with the List<E> interface throughout your onCommand method
    7. You call new teamCommand() 3 times in your onEnable method. and you have two getCommand methods, if you setup your plugin.yml to have an alias with the /team command, you do not need to do that.
    8. Changing the void teamCommand method to have a plugin Main variable, you must change the calls to that in your onEnable.
    9. Register your events in the Listener class in your Constructor
    10. Make the prefix variable final if you are not going to use a getter method.
    11. Formatting, use Control + Shift + F in Eclipse to auto-format
    12. In testing your team create command, you hve it check to see if it is null, you need to check to see if it says "no-team". because you have it set to no-team on join when a player is not
    13. Clean up your argument length checks, you can really shorten up your code if you test for the subcommand and then you test for arguments
    14. return true on the onCommand no matter what, you can control messages if anything goes wrong
    15. Change the leave command to set it to no-team instead of null, that can cause issues even with null checks
    16. Have a message in chat that tells you when you create a team
    17. Ran into this problem in team chat. Excuse the prefix and suffixes, I have a multiprefix plugin that I test on this test server and I removed if and forgot about how the permissions plugin is setup
    That is all I am going to do, most thing work when the fixes that I mentioned above are applied.

    EDIT: Because I had the time and was bored, I decided to completely fix your plugin just to see how long it took me to. I was able to do it in about 30 minutes. I had to fix a lot of things, I would suggest you go over your code in your head and go through it line by line thinking "What does this do?"
    When i had solved all the errors and problems, I do have to say, it is a really neat plugin and very useful.
     
    Last edited: Oct 9, 2016
  11. Offline

    plasticono

    @Firestar311 Thanks you so much for taking the time to help me.
     
  12. Offline

    Firestar311

    You are welcome.
     
Thread Status:
Not open for further replies.

Share This Page