Fidus Böses Böses Blümchen |
 |
|
|
|
|
|
|
|
|
 |
26.11.2012 - 22:02 Uhr |
|
|
|
Hiho,
ich hoffe es gibt einige ich sich mit JavaSE1.6 auskennen bzw der API von Bukkit.
Also ich möchte einen Befehl einbinden der eine config.yml reloaden tut. Angefangen habe ich mit:
| PHP-Quelltext if (cmd.getName().equalsIgnoreCase("vreload")) {
if (p.hasPermission("bnvote.admin")) {
getServer().getPluginManager().enablePlugin(this);
p.sendMessage(ChatColor.RED + "[BNVote] v0.2 by Aulus79");
p.sendMessage(ChatColor.GREEN + "[BNVote] Config reloaded!");
System.out.println("[BNVote] Config reloaded!");
return true;
}
} | |
Die Config wird auch angelegt per:
| PHP-Quelltext //Config anlegen
public void loadConfig(){
FileConfiguration cfg = this.getConfig();
cfg.options().copyDefaults(true);
this.saveConfig();
} | |
Nur der API Ref fürs die void bereit bei mir Fehlermeldungen:
| PHP-Quelltext public void reloadCustomConfig() {
if (customConfigFile == null) {
customConfigFile = new File(getDataFolder(), "customConfig.yml");
}
customConfig = YamlConfiguration.loadConfiguration(customConfigFile);
// Look for defaults in the jar
InputStream defConfigStream = this.getResource("customConfig.yml");
if (defConfigStream != null) {
YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream);
customConfig.setDefaults(defConfig);
}
} | |
Fehlermeldungen:
customConfigFile cannot be resolved to a variable
YamlConfiguration cannot be resolved
Kann mir da einer weiterhelfen was ich da tun muss, um per inGame Befehl die Config auf der Platte zu reloaden?
Infos zum ganzen gibt es da: http://bn-minecraft.de/Thread-BNVote--179
LG
Aulus
P.S. okay hat sich erledigt ich dummerchen hatte den Befehl vergessen zu setzten der dem sagt "So, reloade dich nun"
| PHP-Quelltext this.reloadConfig(); | |
|
|
|
|
|
|