Solved Default system encoding may have misread config.yml

Discussion in 'Plugin Development' started by w0lves, Oct 25, 2020.

  1. Offline

    w0lves

    Hello, im trying to make on Item and set it a lore, so basic.

    Plugin version: 1.8.8

    Problem: [22:46:17 WARN]: [MyPlugin] Default system encoding may have misread config.yml from plugin jar

    This is where i get the error:
    Code:
    Utils.tellConsole("A");
                                ItemStack sandWand = Utils.createItem(294, 1, plugin.getConfig().getString("sandwand.title"),
                                        plugin.getConfig().getStringList("sandwand.lore"));
                                Utils.tellConsole("B");
    
    Console Outpot:
    Code:
    [22:46:17 INFO]: A
    [22:46:17 WARN]: [MyPlugin] Default system encoding may have misread config.yml from plugin jar
    [22:46:17 INFO]: B
    
    Utils.createItem method:
    Code:
    public static ItemStack createItem(int materialId, int amount, String displayName, List<String> loreString) {
    
            @SuppressWarnings("deprecation")
            ItemStack item = new ItemStack(Material.getMaterial(materialId), amount);
    
            ItemMeta meta = item.getItemMeta();
            meta.setDisplayName(Utils.chat(displayName));
            List<String> lore = new ArrayList<String>();
            for(String s : loreString) {
                lore.add(Utils.chat(s));
            }
            meta.setLore(lore);
            meta.addItemFlags(ItemFlag.values());
            meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
            meta.addEnchant(Enchantment.DURABILITY, 1, true);
            item.setItemMeta(meta);
    
            return item;
        }
    
    Config.yml
    Code:
    sandwand:
       title: "&e&lSand Wand"
       lore:
          - "&7Remove sand pillars!"
          - ""
       remove-message: "&7(&e¡&7) You have removed &e<blocks> &7sand blocks (&e¡&7)"
       deny-messige: "&7[&eSand Wand&7] &cYou can't use sand wands in other fac's claims."
    
    I don't know what's really happening... i've done more items before and i had no problem xd
     
    Last edited by a moderator: Oct 26, 2020
  2. Offline

    timtower Moderator Moderator

    @w0lves Use "code" instead of "quote" for the fancy code blocks ;)
    What is the file encoding of the original config.yml ?
     
  3. Offline

    w0lves

    Sorry about the quote

    The file encoding? I don't understand what u mean :oops:
     
  4. Offline

    timtower Moderator Moderator

    @w0lves If you open it with Notepad++ for example then you see "UTF-8"or something similar in the bottom right corner.
    What does it say?
     
  5. Offline

    w0lves

    @timtower i'm not at home rn so i can't check it buuuut... I did it with Eclipse IDE, i have searched on google and i found that "Eclipse says that Cp1250 is a 'default' encoding".

    ¿So i suppose that i should change it to UTF-8?

    I arrive home in two hours, i'll test it asap :)

    Finally i could solve it just changing the Eclipse encoding to UTF-8.

    If anyone have the same problem and it's reading this post just do:

    Preferences>General>Workspace and select UTF-8 as the Text File Encoding

    As i said on the other post i did, thank u so much for helping :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 26, 2020

Share This Page