I'm Freaking out !!!

Discussion in 'Plugin Development' started by Sammy, Mar 16, 2011.

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

    Sammy

    Two weeks later, 2 threads, many many posts and a PM to DinnerBone and I'm still frustrated as sh** please please Help me or I'm going to start screaming to the pour pour monitor.

    I'm getting a strange error on the chat

    [​IMG]

    Then I return false on a command the usage written on the yml doesn't appear red and gets all this weird line breaks.
    I have tried so many things that I don't know if I can tell you all:
    1) Updated bukkit and craftbukkit constantly
    2) Simplified the code so the cmd would return false quickly:

    Code:
    public class sdC extends JavaPlugin {
    
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
             String[] Nargs = args;
            String cmd = command.getName().toLowerCase();
            if (cmd.equals("bank")) {
                return false;
            }else if(cmd.equals("money")){
                return false;
            }
            return true;
        }
         .....

    3) Tried other plugins on the same server (They worked fine)
    4) Messed with the build.xml
    5) Messed with the Manifest
    6) Prayed to many gods and goddess
    7) Called ugly names to the bukkit.jar
    8) Used other peoples yml's files
    ....

    Here is some of my Simplified code:

    Code:
    package com.SySammy.SdCurrency;
    
    import com.SySammy.SdCurrency.Handlers.CurrencyHandler;
    import com.SySammy.SdCurrency.Prop.CurrencyProperties;
    import java.io.File;
    import java.io.IOException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.event.Event;
    import org.bukkit.event.Event.Priority;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    /**
     *
     * @author Sammy
     */
    public class sdC extends JavaPlugin {
    
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
             String[] Nargs = args;
            String cmd = command.getName().toLowerCase();
            if (cmd.equals("bank")) {
                return false;
            }else if(cmd.equals("money")){
                return false;
            }
            return true;
        }
     
        public static void main(String[] args) {
            // TODO Debug
        }
        private static final Logger log = Logger.getLogger("Minecraft");
        private sdPlayerListener PL = new sdPlayerListener();
        private CurrencyHandler CH = new CurrencyHandler();
        //Files & dirs
        private static final String currencyDIR = "plugins/RPGmod/currency/";
        private static final File accounts = new File(currencyDIR + "accounts.txt");
        private static final File loans = new File(currencyDIR + "loans.txt");
    
        @Override
        public void onDisable() {
            System.out.println("disabled, goodbye wold");
        }
    
        @Override
        public void onEnable() {
            PluginDescriptionFile pdfFile = this.getDescription();
            PluginManager pm = getServer().getPluginManager();
            new File(currencyDIR).mkdirs();
            if (!accounts.exists()) {
                try {
                    accounts.createNewFile();
                } catch (IOException ex) {
                    log.log(Level.INFO, ex.getMessage(), pdfFile.getName());
                }
            }
            if (!loans.exists()) {
                try {
                    loans.createNewFile();
                } catch (IOException ex) {
                    log.log(Level.INFO, ex.getMessage(), pdfFile.getName());
                }
            }
            pm.registerEvent(Event.Type.PLAYER_JOIN, this.PL, Priority.Normal, this);
            CurrencyProperties.loadCurrencyProps();
            //getCommand("money").setExecutor(new sdCMoneyCmds(this));
            //getCommand("bank").setExecutor(new sdCBankCmds(this));
            System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
        }
      
        @Override
        public void onLoad() {
        }
    }
    
    And the Yml file:

    Code:
    name: SdCurrency
    main: com.SySammy.SdCurrency.sdC
    version: 1.1
    author: Deck & Sammy
    description: >
                 SyDeckRPGmod Currency module.
    commands:
      money:
        description: Money command
        usage: |
               /<command> - Shows your current money.
               /<command> pay [Player] [amount] - Send money to someone.
               /<command> help - Shows this menu.
               /<command> check [Player] - Shows a players balance [Ops Only].
      bank:
        description: Money command
        usage: |
               /<command> - Get your account balance.
               /<command> loan [amount] [time] - Borrow money, with interest.
               Example: /<command> loan 100 2 - 100 loan with a 2 days deadline.
               /<command> repay [amount] - Partial repayments.
               /<command> help - Shows this menu.
    Please don't overlook my thread, I always try to help ppl...

    PS: @Plague thank you for trying to help me on the other thread[​IMG]
     

    Attached Files:

  2. Offline

    Plague

    Could you build that plugin and post a Link I'll try it on my test server.
     
  3. Offline

    Sammy

    Here you have it, hope its helps helping me ^^
     

    Attached Files:

  4. Offline

    Plague

    Okay so the red color I got sime time ago is gone, tha maybe was me.
    I see exactly the same thing as you do for your plugin, BUT for my /time the lines do not break that soon.
    I edited my plugin.yml like so:
    Code:
    usage: /<command> day|night|dusk|dawn|<raw> - blah blah blah
    And the line is printed as a whole with no breaking!

    try using "usage: something" without the multiline if that helps.
     
  5. Offline

    Sammy

    One thing there I found is that if you don't use a | after the usage lines will never break not even them the line ends
    But if I do use the | I get the error.

    Do you know were can I find the documentation about this Escape Charters ?
    Code:
    usage: |
    Code:
    description: >
    The way you say does work but limits very much the info I can put on the usage [​IMG]

    Oh I just used the compiled version of Scrapbukkit and the error occurs to, so its a bukkit bug, here can I post this bug so it gets fixed eventually ?

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

    Plague

  7. Offline

    Sammy

    Thanks for all the help you're a great guy man [​IMG]
    I'm going to stop using the usage as a help menu... at least until they fix this bug
     
Thread Status:
Not open for further replies.

Share This Page