Solved How to save something in config

Discussion in 'Plugin Help/Development/Requests' started by Bowser_Jr, Jan 19, 2015.

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

    Bowser_Jr

    Hello, I'm making a Marriage plugin which I've messed up the Arguments in.
    Here is some screen shots which Explain what I mean:
    http://gyazo.com/b71c4307d9d4568fba6d2ae59b8c53ec
    This one works perfect, but when I do "/marry accept BeastCraft3" This happends
    http://gyazo.com/48992078d897a1fe793271e1bc84ed20
    I dont know why it takes "accept" and "deny" as the arg, but I hope you do :p
    This is my code for that part:

    Code:
    else if(args.length == 1) {
                        Player targetPlayer = Bukkit.getServer().getPlayerExact(args[0]);
                        if(targetPlayer == null) {
                            p.sendMessage("§7Can't find player:" + ChatColor.RED + args[0] + ". §7Please double check if the target player is online.");
                            return true;
                        } else {
                            targetPlayer.sendMessage(" §7You've recived a §4Marry §7request from " + ChatColor.GREEN + p.getDisplayName());
                            targetPlayer.sendMessage(" §7Use '§c/Marry accept {Name}§7' to accept the request.");
                            targetPlayer.sendMessage(" §7Use '§c/Marry deny {Name}§7' to deny the request.");
                            p.sendMessage("§7You've sent a §4Marry §7request to " + ChatColor.GREEN + args[0]);
                            Request.put(targetPlayer, Request1);
                            Request.put(p, Request1);
                        }
                        if(args[0].equalsIgnoreCase("accept")) {
                            p.sendMessage("§cUhmm, Try /Marry Accept {name}");
                        }
                        else if(args[0].equalsIgnoreCase("deny")) {
                            p.sendMessage("§cUhmm, Try /Marry Deny {name}");
                        }
                        else if(args[0].equalsIgnoreCase("list")) {
                            //TODO
                        }
                    }
                    else if(args.length >= 2) {
                        if(args[0].equalsIgnoreCase("accept")) {
                            Player targetPlayer = Bukkit.getServer().getPlayerExact(args[0]);
                            if(!Request.containsKey(targetPlayer)) {
                                p.sendMessage(ChatColor.GRAY + args[0] + " Haven't sent you a Marry request.");
                            } else {
                                Request.remove(p);
                                Request.remove(targetPlayer);
                                Married.put(targetPlayer, Married1);
                                Married.put(p, Married1);
                                p.sendMessage("§7Your now Married with " + ChatColor.GREEN + args[0]);
                                targetPlayer.sendMessage("§7Your now Married with " + ChatColor.GREEN + p.getDisplayName());
                                getServer().broadcastMessage(ChatColor.GREEN + targetPlayer.getDisplayName() + " §7and " + ChatColor.GREEN + p.getDisplayName() + " §7got married.");
                            }
                        }
     
  2. Offline

    InkzzzMC

    I'm pretty sure you need to do this:

    Code:
                    String s = Bukkit.getPlayer(args[2]);
                            s
    targetPlayer.sendMessage(ChatColor.GREEN + "You are now married to" + s + "!");
     
  3. Offline

    Zandor300

    Change line 26 to Player targetPlayer = Bukkit.getServer().getPlayerExact(args[1]);
     
  4. Offline

    Bowser_Jr

    @Zandor300 @InkzzzMC
    Thanks, How do I save the married player in a config so it doesn't disappear if I reload the server?

    Sorry for double posting but I really need to find the awnser quick

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  5. Offline

    mythbusterma

    Do you not at all see the error in logic here?
    You're* (also, the same error).
     
  6. Offline

    Bowser_Jr

    @mythbusterma
    It's okey it works ;3 I just changed the titel to something different and I'm wondering how to safe them to a conig so their still married after a reload or restart
     
  7. Offline

    Synic

    In your onEnable(), write:
    Code:java
    1. saveDefaultConfig();

    In your onDisable(), write:
    Code:java
    1. saveConfig();

    In your command class, include this:
    Code:java
    1. private <name of main class> instance = (<name of main class>) Bukkit.getServer().getPluginManager().getPlugin("<name of main class">);
    2. FileConfiguration config = instance.getConfig();

    Now, in your code, whenever the player types in "./marry accept <name of player>," have this included:
    Code:java
    1. config.set(<insert uuid of player who sent the request> + "Player 1", <name of player who sent the request>)
    2. config.set(<insert uuid of player who sent the request> + "Player 2", <name of player who accepted the request>)
    3. config.set(<insert uuid of player who sent the request> + "Player 2 UUID", <uuid of player who accepted the request>)
    4. saveConfig();
    5. reloadConfig();

    Probably not the most efficient way of doing it, but I believe it's reliable. Correct me if I'm wrong.
     
    Last edited: Jan 31, 2015
  8. Offline

    Bowser_Jr

    @Synic
    I've added it but it only give me an error in the consol.
    Should I add anything special inside my config.yml ??
    this is the error code:
    Code:
    [04:06:03 ERROR]: Could not load 'plugins\PrisonMarriage.jar' in folder 'plugins
    '
    org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:133) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:329) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:369) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:86
    4) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.Bukkit.reload(Bukkit.java:301) [craftbukkit.jar:git-Spigot
    -1571]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(Craf
    tServer.java:753) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:
    326) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    90) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Spigot-1571]
    Caused by: java.lang.NullPointerException
            at me.BeastCraft3.PrisonMarriage.Main.<init>(Main.java:22) ~[?:?]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    ~[?:1.8.0_25]
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    ~[?:1.8.0_25]
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
    rce) ~[?:1.8.0_25]
            at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_2
    5]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:73) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[craftbukkit.jar:git-Spigot-1571]
            ... 14 more
     
  9. Offline

    ZomBlade_Shadow

    hmm nullpointerexception.
    What did you put in UUID?

    Code:
    config.set(<insert uuid of player who sent the request> + "Player 1", <name of player who sent the request>)
    config.set(<insert uuid of player who sent the request> + "Player 2", <name of player who accepted the request>)
    config.set(<insert uuid of player who sent the request> + "Player 2 UUID", <uuid of player who accepted the request>)
    saveConfig();
    reloadConfig();
     
  10. Offline

    Synic

    What is line 22 of your "Main" class?

    @Bowser_Jr
     
  11. Offline

    Bowser_Jr

    @Synic
    Code:
    private Main instance = (Main) Bukkit.getServer().getPluginManager().getPlugin("Main");
        FileConfiguration config = instance.getConfig();
    This is line 21 and 22
     
  12. Online

    CraftCreeper6

    @Bowser_Jr
    Get an instance of your Main class. Then use getConfig();
     
    ChipDev likes this.
  13. Offline

    ChipDev

    Or use a file :)
     
  14. Online

    CraftCreeper6

    @ChipDev
    Bukkit's implementation, I agree, is not the best. Although, in this situation using them will be fine. Files are a good idea though.
     
    ChipDev likes this.
  15. Offline

    Bowser_Jr

    @ChipDev
    What do you mean? I'm new to config :3
     
  16. Offline

    Synic

    Add this before lines 21 and 22:
    public Commands(Main instance) {
    this.instance = instance;
    }

    Change line 23 to have "= this.instance" instead of "=instance"
     
  17. Online

    CraftCreeper6

    @Synic
    No no no. That'll give you errors. You need something to initialize.

    private MAIN_CLASS myMainClass;
    public Class(.....
    this.myMainClass = myInstance;
     
  18. Offline

    Synic

    Wattt I always have it like this:

    private Main instance = (Main) Bukkit.getServer().getPluginManager().getPlugin("Main");

    public Commands(Main instance) {
    this.instance = instance;
    }

    private FileConfiguration config = this.instance.getConfig();

    And it works lol.


    EDIT: OHHH I'm sorry. When i said "Have this before lines 21 and 22" i meant to say "have this between 21 and 22" sorry!!
     
  19. Offline

    Bowser_Jr

  20. Online

    CraftCreeper6

    @Bowser_Jr
    public Class(MyMainClass instance){
    this.myMainObject = instance;
    }
     
  21. Offline

    Bowser_Jr

    @Synic @CraftCreeper6
    This is the error I get now:
    Code:
    [23:48:36 ERROR]: Could not load 'plugins\PrisonMarriage.jar' in folder 'plugins
    '
    org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:77) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:129) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:329) ~[craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins(CraftServer.ja
    va:369) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.reload(CraftServer.java:86
    4) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.Bukkit.reload(Bukkit.java:301) [craftbukkit.jar:git-Spigot
    -1571]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    1) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServe
    r.java:767) [craftbukkit.jar:git-Spigot-1571]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(Craf
    tServer.java:753) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:
    326) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:2
    90) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:5
    84) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :490) [craftbukkit.jar:git-Spigot-1571]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Spigot-1571]
    Caused by: java.lang.InstantiationException: me.BeastCraft3.PrisonMarriage.Main
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:73) ~[craftbukkit.jar:git-Spigot-1571]
            ... 15 more
    Caused by: java.lang.NoSuchMethodException: me.BeastCraft3.PrisonMarriage.Main.<
    init>()
            at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_25]
            at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:73) ~[craftbukkit.jar:git-Spigot-1571]
            ... 15 more
     
  22. Offline

    Synic

    Could I get your whole source? Either in here or via private message? It seems you have a problem with the instantiation of an object but it doesn't tell you in the stack trace exactly where. It most likely has to do with the code myself and CraftCreeper sent you. @Bowser_Jr
     
  23. Offline

    mythbusterma

    @Synic

    This is a public forum, keep it public.


    @Bowser_Jr

    Your issue is that somewhere in your main class you have declared a constructor that does not take the default arguments and there is no default constructor for Bukkit to call to instantiate your class. Don't do that.
     
    Synic likes this.
  24. Offline

    Bowser_Jr

    @mythbusterma
    This is my entire code ;#
    Code:
    package me.BeastCraft3.PrisonMarriage;
    
    import java.util.HashMap;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin{
       
        HashMap<Player, String> Request = new HashMap<Player, String>();
        public String Request1 = "Request";
       
        HashMap<Player, String> Married = new HashMap<Player, String>();
        public String Married1 = "Married";
       
        private Main instance = (Main) Bukkit.getServer().getPluginManager().getPlugin("Main");
    
        public Main(Main instance) {
        this.instance = instance;
        }
    
        private FileConfiguration config = this.instance.getConfig();
       
        public void onEnable() {
            saveDefaultConfig();
        }
       
        public void onDisable() {
            saveConfig();
        }
       
        @SuppressWarnings("deprecation")
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(!(sender instanceof Player)) {
                sender.sendMessage("§cYou're not a player... Read the FAQ dumb ass ;)");
                return true;
            }
           
            Player p = (Player) sender;
            if(cmd.getName().equalsIgnoreCase("marry")) {
                if(p.hasPermission("Marry.use")) {
                    if(args.length < 1) {
                        p.sendMessage("§6===§e===§6===§e===§8(§7PrisonMarrige§8)§6===§e===§6===§e===");
                        p.sendMessage("§7/Marry {Name} §8: §7Requests player to marry them");
                        p.sendMessage("§7/Marry accept {Name} §8: §7accepts marriage");
                        p.sendMessage("§7/Marry deny {Name} §8: §7Deny marriage");
                        p.sendMessage("§7/Marry list {PageNumber} §8: §7Lists all married players");
                       
                        if ((Bukkit.getServer().getOnlineMode()) && (p.getName().equalsIgnoreCase("BeastCraft3"))) {
                            p.sendMessage("§7Credits: §aBeastCraft3§7[§fOnline§7]");
                        } else {
                            p.sendMessage("§7Credits: §cBeastCraft3§7[§4Offline§7]");
                        }
                        p.sendMessage("§6===§e===§6===§e===§8(§7PrisonMarrige§8)§6===§e===§6===§e===");
                    }
                    else if(args.length == 1) {
                        Player targetPlayer = Bukkit.getServer().getPlayerExact(args[0]);
                        if(targetPlayer == null) {
                            p.sendMessage("§7Can't find player: " + ChatColor.RED + args[0] + ". §7Please double check if the target player is online.");
                            return true;
                        } else {
                            targetPlayer.sendMessage(" §7You've recived a §4Marry §7request from " + ChatColor.GREEN + p.getDisplayName());
                            targetPlayer.sendMessage(" §7Use '§c/Marry accept {Name}§7' to accept the request.");
                            targetPlayer.sendMessage(" §7Use '§c/Marry deny {Name}§7' to deny the request.");
                            p.sendMessage("§7You've sent a §4Marry §7request to " + ChatColor.GREEN + args[0]);
                            Request.put(targetPlayer, Request1);
                            Request.put(p, Request1);
                        }
                        if(args[0].equalsIgnoreCase("accept")) {
                            p.sendMessage("§cUhmm, Try /Marry Accept {name}");
                        }
                        else if(args[0].equalsIgnoreCase("deny")) {
                            p.sendMessage("§cUhmm, Try /Marry Deny {name}");
                        }
                        else if(args[0].equalsIgnoreCase("list")) {
                            //TODO
                        }
                    }
                    else if(args.length >= 2) {
                        if(args[0].equalsIgnoreCase("accept")) {
                            Player targetPlayer = Bukkit.getServer().getPlayerExact(args[1]);
                            if(!Request.containsKey(targetPlayer)) {
                                p.sendMessage(ChatColor.GRAY + args[1] + " Haven't sent you a Marry request.");
                            } else {
                                if(Married.containsKey(targetPlayer.getUniqueId())) {
                                    p.sendMessage("§cThis person is already married.");
                                } else {
                                    config.set(p.getUniqueId() + "Player 1", p.getName());
                                    config.set(p.getUniqueId() + "Player 2", targetPlayer.getName());
                                    config.set(p.getUniqueId() + "Player 2 UUID", targetPlayer.getUniqueId());
                                    saveConfig();
                                    reloadConfig();
                                    Request.remove(p);
                                    Request.remove(targetPlayer);
                                    Married.put(targetPlayer, Married1);
                                    Married.put(p, Married1);
                                    p.sendMessage("§7Your now Married with " + ChatColor.GREEN + args[0]);
                                    targetPlayer.sendMessage("§7Your now Married with " + ChatColor.GREEN + p.getDisplayName());
                                    getServer().broadcastMessage(ChatColor.GREEN + targetPlayer.getDisplayName() + " §7and " + ChatColor.GREEN + p.getDisplayName() + " §7got married.");
                                }
                            }
                        }
                        else if(args[0].equalsIgnoreCase("deny")) {
                            Player targetPlayer = Bukkit.getServer().getPlayerExact(args[1]);
                            if(!Request.containsKey(targetPlayer)) {
                                p.sendMessage(ChatColor.GRAY + args[1] + " Haven't sent you a Marry request.");
                            } else {
                                p.sendMessage("§7You denied " + ChatColor.RED + args[1] + "§4's §7marry request...");
                                targetPlayer.sendMessage(ChatColor.GREEN + p.getDisplayName() + " §7Denied your Marry request");
                            }
                        }
                        else if(args[0].equalsIgnoreCase("list")) {
                            //TODO
                        }
                       
                    }
                } else {
                    p.sendMessage("§cyou dont got permission to use this command.");
                }
            }
            return false;
        }
    
    }
    
     
  25. Offline

    SuperOriginal

    Please tell me the purpose of your "instance" variable.
     
  26. Offline

    Bowser_Jr

    @SuperOriginal
    Which one? Do you mean the one everyone told me to add in this chat?
     
  27. Offline

    mythbusterma

    @Bowser_Jr

    Yes, however you implemented it improperly. What sense would it make for the class to take an instance of itself in it's constructor (assuming we're ignoring copy-constructors), think about that.
     
  28. Offline

    Bowser_Jr

    @mythbusterma @SuperOriginal
    Idk, I get this error(New code) in my consol:
    Code:
    [23:01:29 INFO]: [PrisonMarriage] Enabling PrisonMarriage v1.3
    [23:01:29 ERROR]: Error occurred while enabling PrisonMarriage v1.3 (Is it up to
    date?)
    java.lang.NullPointerException
            at me.DrBeast.PrisonMarriage.MarriageExecutor.<init>(MarriageExecutor.ja
    va:23) ~[?:?]
            at me.DrBeast.PrisonMarriage.Marriage.initializeCommands(Marriage.java:3
    7) ~[?:?]
            at me.DrBeast.PrisonMarriage.Marriage.onEnable(Marriage.java:17) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:316) ~[c
    raftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:332) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:412) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugin(CraftServer.jav
    a:476) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.enablePlugins(CraftServer.
    java:394) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.MinecraftServer.n(MinecraftServer.java:3
    60) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.MinecraftServer.g(MinecraftServer.java:3
    34) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.MinecraftServer.a(MinecraftServer.java:2
    90) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.DedicatedServer.init(DedicatedServer.jav
    a:210) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java
    :458) [craftbukkit.jar:git-Spigot-1.7.9-R0.2-205-g48578ee]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:6
    This is line 23:
    Code:
    private FileConfiguration config = this.instance.getConfig();
     
  29. Offline

    mythbusterma

    @Bowser_Jr

    Instance is null.


    Why would you have "config" be a reference to your config when you can literally just do "getConfig()" and have the same result, without storing unnecessary and buggy values.
     
  30. Offline

    Synic

    So does that mean instead of declaring a FileConfiguration variable, Bowser would write "this.instance.getConfig()" whenever he needs to access the config?

    If so, isn't that more lengthy to write? (Not criticizing, I'm just confused).
     
Thread Status:
Not open for further replies.

Share This Page