Always return plugin.yml usage

Discussion in 'Plugin Development' started by Pixes, Mar 15, 2015.

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

    Pixes

    Hello, i've made a plugin and i tested in my pc(Windows 8) and it worked. But when I passed the plugin to my vps(Debian 7) it doesn't work. Always send the usage in the plugin.yml.
    i've tried a lot of things to fix it. i compile the plugin with java 6 and java 7 (my vps has Java 7), i used difertens IDEs, I've made a simple plugin to see if its works but it doesn't. I need help please

    This is the code:

    onCommand:

    Code:
    package me.plugins.cuentas;
    import java.sql.SQLException;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    public class Comandoregistera implements CommandExecutor {
       Databases cuentas;
       public Comandoregistera(Databases resultado) {
         this.cuentas = resultado;
       }
       public boolean onCommand(CommandSender sender, Command cmd, String label,
           String[] args) {
         if (sender instanceof Player)
         {
           if (args.length==2 && args[0].equals(args[1]))
           {
        Player jugador = (Player) sender;
         String ipj = jugador.getAddress().getAddress().toString();
         String uuid = jugador.getUniqueId().toString();
             if (!(cuentas.getCuentas().containsKey(uuid)))
             {
             try {
                 if(Databases.Obteneripa(jugador.getName())== null)
                   {
                     if (Databases.Obtenerip(ipj).equals(ipj)&&(!jugador.hasPermission("fastlogin.register.multi")))
                     {
                       jugador.sendMessage(ChatColor.RED + "Ya Tienes una Cuenta, No se permite la Multicuenta");
                       //jugador.kickPlayer("No se permite la multicuenta");
                       return true;
                       }
                     else
                     {
                     Databases.ActDatabase(uuid, ipj, jugador.getName(), args[1]);
                     cuentas.Actmap(uuid, args[1]);//LLama meto en Databases
                     jugador.sendMessage(ChatColor.AQUA + "Contraseña guardada, Gracias, porfavor avisar a otros jugadores");
                     return true;
                     }
                     }
                 else
                 jugador.sendMessage(ChatColor.AQUA + "Ya existe un usuario con ese nombre, lo sentimos");
                 return true;
               }
               catch(SQLException ex)
               {
                 jugador.sendMessage(ChatColor.RED + "SQL EXCEPTION, Contactar Administrador");
                 return true;
               }
               catch(ClassNotFoundException ex)
               {
                 jugador.sendMessage(ChatColor.RED + "ClassNotFoundException, Contactar Administrador");
                 return true;
               }
             }
             else
             {
             jugador.sendMessage(ChatColor.RED +  "Usted ya esta registrado.");
             return true;
             }
           }
           else if(args.length!=2)
           {
           jugador.sendMessage(ChatColor.RED  + "Por favor Ingrese dos contraseñas iguales, Gracias");
           return true;
           }
           else if(!(args[0].equals(args[1])))
           {
           jugador.sendMessage(ChatColor.RED+"Las contraseñas no coinciden");
           return true;
           }
           else{
           jugador.sendMessage(ChatColor.RED + "Probando");
           return false;
           }
         }
         else
         {
         jugador.sendMessage(ChatColor.RED + "Probando1");
         return false;
         }
       }
    Main class

    Code:
    package me.plugins.cuentas;
    import org.bukkit.plugin.java.JavaPlugin;
    public class cuentas extends JavaPlugin {
       @Override
       public void onEnable(){
         try
         {
         Databases cuentas = new Databases();
         this.getCommand("password").setExecutor(new Comandoregistera(cuentas));
         }
         catch(Exception ex){
         }
       }
       @Override
       public void onDisable(){
       }
    }
    Plugin.yml
    Code:
    name: cuentas
    main: me.plugins.cuentas.cuentas
    version: 0.1
    commands:
      password:
      description: /password password password
      usage: /<command>}
     
    Last edited: Mar 15, 2015
  2. 1)
    Code:java
    1.  
    2. name: cuentas
    3. main: me.plugins.cuentas.cuentas
    4. version: 0.1
    5. commands:
    6. password:
    7. description: /password password password
    8. usage: /<command>
    9.  

    2)
    Try changing "return false" at the end for "return true"
     
  3. Offline

    Pixes

    Still doesn't work.:(
    Still send me the plugin.yml usage and every return is true in the onCommand.
     
  4. Offline

    timtower Administrator Administrator Moderator

  5. Offline

    Pixes

    @timtower
    Loads Fine
    Code:
    [14:45:28] [Server thread/INFO]: [cuentas] Loading cuentas v0.1//this is the plugin
    [14:45:28] [Server thread/INFO]: [iConomy] Loading iConomy v7.0
    [14:45:28] [Server thread/INFO]: [SurvivalGames] Loading SurvivalGames v0.5.8.54
    [14:45:28] [Server thread/INFO]: [ClearLag] Loading ClearLag v2.6.2
    Enable fine
    Code:
    [14:45:34] [Server thread/INFO]: [cuentas] Enabling cuentas v0.1
    [14:45:34] [Server thread/INFO]: [iConomy] Enabling iConomy v7.0
    [14:45:34] [Server thread/INFO]: [iConomy - April Fools] Enabled (34 ms)
    When Execute
    Code:
    14:46:46] [Server thread/INFO]: Ezequiel issued server command: /password 123456//not even the error send
    [14:46:50] [Server thread/INFO]: Ezequiel issued server command: /password 123456 123456
    Disabling fine
    Code:
    [15:32:04] [Server thread/INFO]: [iConomy] Disabled. (0 ms)
    [15:32:04] [Server thread/INFO]: [cuentas] Disabling cuentas v0.1
    [15:32:04] [Server thread/INFO]: [AutoMessage] Disabling AutoMessage v2.5.2
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Pixes Then what isn't working?
     
  7. Offline

    Pixes

    @timtower
    That the command return the plugin.yml usage and do nothing. And i don't know where is not working. In my pc works fine but in my vps it doesn't.
     
  8. Offline

    Zombie_Striker

    did you Debug? At what line does it get up to before it doesn't work?
     
  9. Offline

    Pixes

    @Zombie_Striker Yes and everything went fine. It's just in my vps that is not working every plugin works in my vps excepte the ones that i compiled. In my pc works fine.
     
  10. Offline

    Zombie_Striker

    What I mean is, at what line does your plugin stop working for your VPS. Does your plugin ever get Enabled by your VPS, or does it leave any stacktraces? If so, can you post them? And one last thought, are your two bukkit versions compatible (e.g. one is 1.7.5 and the other 1.8)?
     
  11. Offline

    Pixes

    @Zombie_Striker I tried the plugin in my pc on a backup that i have of my server and works. But in the VPS loads fine but for example: suposse that a command of my plugin is /hola xxx when y put /hola xxx it returns /hola just like the part usage of plugym.yml, nothing is done and in the console i don't see any errors. Is like the command return false always
     
  12. Offline

    Zombie_Striker

    Does it work if you make a new command? Would something like /test 1 2 work if you put that into your plugin? This would determine if it an external problem or if its with your command.

    Also, why would you need two args that are exactly the same to work (args[0] and args[1])?
     
  13. Offline

    Pixes

    @Zombie_Striker Yes it happen to every plugin(and if i changed the command too) that i compile, i've made a simple plugin to test and still happens. (i've checked the java version of the vps and the one that i'm compiling and seems right) i don't understand why every plugin works and mine not in the vps, and in my pc works, i can't figure it out jaja.
     
Thread Status:
Not open for further replies.

Share This Page