[HELP] Error with the sourcecode from SQL Tutorial from Alta!!

Discussion in 'Plugin Development' started by fregaPT, May 18, 2011.

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

    fregaPT I steal plugins as my own

    I am getting this error in console
    And the only thing I changed were the name of packages etc ...
    I didn't change anything that changes the plugin itself
    Here:

    PHP:
    [Lnet.minecraft.server.Statistic;@1e152c5
    146 recipes
    [Lnet.minecraft.server.Statistic;@1e152c5
    16 achievements
    16
    :15:17 [INFOStarting minecraft server version Beta 1.5_02
    16
    :15:17 [INFOLoading properties
    16
    :15:17 [INFOStarting Minecraft server on 192.168.0.11:25565
    16
    :15:17 [WARNING] **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    16:15:17 [WARNINGThe server will make no attempt to authenticate usernamesBe
    ware
    .
    16:15:17 [WARNING] While this makes the game possible to play without internet a
    ccess
    it also opens up the ability for hackers to connect with any username the
    y choose
    .
    16:15:17 [WARNINGTo change thisset "online-mode" to "true" in the server.set
    tings file
    .
    16:15:17 [INFOThis server is running Craftbukkit version git-Bukkit-0.0.0-729-
    g5ee3f0f-b766jnks (MC1.5_02)
    16:15:17 [INFOPreparing level "fregaPT"
    16:15:17 [INFOPreparing start region
    16
    :15:18 [INFO] [xMailv1.0 is being enabled ....
    16:15:18 [INFO] [xMailv1.0 is enabled!
    16:15:18 [INFODone (0,135s)! For helptype "help" or "?"
    >mm send fregaPT Hello!
    16:15:34 [WARNINGUnexpected exception while parsing console command
    org
    .bukkit.command.CommandExceptionUnhandled exception executing command 'mm'
    in plugin xMail v1.0
            at org
    .bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:85
    )
            
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    70
    )
            
    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:396)
            
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:381)
            
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:287)
            
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Caused byjava.lang.ClassCastExceptionorg.bukkit.craftbukkit.command.Coloured
    ConsoleSender cannot be cast to org
    .bukkit.entity.Player
            at me
    .fregaPT.xMail.xMail.onCommand(xMail.java:56)
            
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 
    6 more
    >
    When I type in /mm send fregaPT Hello! It gets me this error!
     
  2. Offline

    alta189

    We need to see your onCommand
     
  3. Offline

    fregaPT I steal plugins as my own

    Ok,
    I'll post it here now!

    My onCommand (I didn't change it at all!):

    PHP:
    public boolean onCommand(CommandSender senderCommand cmdString commandLabelString[] args){

            
    Player player = (Player)sender;
            if(
    commandLabel.equalsIgnoreCase("mm")){
                if (
    args.length >= 1) {
                        if (
    args[0].equalsIgnoreCase("read") && player != null) {
                            try {

                                if (
    mmServer.getUnreadCount(player.getName()) >= 1) {
                                    
    mmServer.getMail(player);
                                } else {
                                    
    player.sendMessage(ChatColor.GREEN this.logPrefix "You have 0 messages");
                                }
                            } catch (
    SQLException e) {

                                
    e.printStackTrace();
                            }
                        } else if (
    args[0].equalsIgnoreCase("write") && player != null) {
                            if ((
    args.length >= 3)) {
                                
    String receiver args[1];
                                
    String message "";
                                
    Integer count 3;

                                while (
    count <=  args.length) {
                                    if (
    count == 3) {
                                        
    message args[count 1];
                                    } else {
                                        
    message message " " args[count 1];
                                    }
                                    
    count count 1;
                                }

                                try {
                                    
    mmServer.sendMail(player.getName(), receivermessage);
                                    
    player.sendMessage(ChatColor.GREEN "Message send");
                                } catch (
    SQLException e) {

                                    
    e.printStackTrace();
                                }

                            } else {
                                
    player.sendMessage(ChatColor.RED "/mm write <player name> <message>");

                            }
                        }

                }

                return 
    true;
            }
            return 
    false;

        }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  4. Offline

    alta189

    Did you create the table and everything in the onEnable?
     
  5. Offline

    fregaPT I steal plugins as my own

    Yes
     
  6. Offline

    kman2010

    frega come on the irc #kmanschat i need to give a status report
     
  7. Offline

    fregaPT I steal plugins as my own

    I don't have time
    SAY WHAT YOU WANNA SAY TO ME IN THE THREAD WITH THE GOLDENCHANT INFO~!
     
  8. Offline

    kman2010

  9. Offline

    fregaPT I steal plugins as my own

    H
    Why aren't you a plugin developer anymore ?
     
  10. Offline

    kman2010

    i guess i got it taken away
     
Thread Status:
Not open for further replies.

Share This Page