Solved getConfig undefined

Discussion in 'Plugin Development' started by YoloSanta, Aug 20, 2017.

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

    YoloSanta

    How can i make it so when I make it open a gui it lets me choose the msg via config, when I try doing the old getConfig().getString it says "The method getConfig() is undefined for the type InvManager"

    Code:
    Code:
    package me.yolosanta.plugins.freeze.manager;
    
    import org.bukkit.inventory.Inventory;
    import org.bukkit.inventory.InventoryHolder;
    
    import me.yolosanta.plugins.freeze.Main;
    import net.md_5.bungee.api.ChatColor;
    
    public class InvManager
    {
        private Inventory frozenInv;
        private Main plugin;
       
        public InvManager(final Main plugin) {
            this.plugin = plugin;
            this.initiateFrozenInv();
        }
       
        private void initiateFrozenInv() {
            this.frozenInv = this.plugin.getServer().createInventory((InventoryHolder)null, 9, ChatColor.translateAlternateColorCodes('&', getConfig().getString("discord-link")));
        }
       
        public Inventory getFrozenInv() {
            return this.frozenInv;
        }
    }
    
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    Dnyce72799

    this.plugin.getConfig().getString("discord-link")));

    Sent from my LGLS775 using Tapatalk
     
  4. Offline

    YoloSanta

    Dnyce72799 likes this.
Thread Status:
Not open for further replies.

Share This Page