Java (Bukkit) - Neue API / Problem mit Config

  • Hallo, ich melde mich auch mal wieder zu Wort


    Mit einem kleinen Problem in Java mit der Bukkit API (neuste)



    getConfig().addDefault(helmetPath, Material.IRON_HELMET);


    ItemStack helmet = this.plugin.getConfig().getItemStack("Helmet");
    p.getInventory().setHelmet(helmet);


    Habe das so weit von Integer auf ItemStacks umgeschrieben, naja was soll ich sagen die Konsole des Servers spuckt mir nur Errors aus?


    Weiß hier evtl jemand ne Lösung?


    MFG. :)


    Engelsflügel am Astonkühler, als Schutz vor dem Teufel!

  • Kann man die Errors mal sehen?


    Natürlich, hier:



    at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55)
    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:138)
    at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:105)
    at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:175)
    at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:117)
    at <Paket>(<Name>.java:48)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugin(CraftServer.java:284)
    at org.bukkit.craftbukkit.v1_6_R3.CraftServer.enablePlugins(CraftServer.java:266)
    at net.minecraft.server.v1_6_R3.MinecraftServer.l(MinecraftServer.java:315)
    at net.minecraft.server.v1_6_R3.MinecraftServer.f(MinecraftServer.java:292)
    at net.minecraft.server.v1_6_R3.MinecraftServer.a(MinecraftServer.java:252)
    at net.minecraft.server.v1_6_R3.DedicatedServer.init(DedicatedServer.java:152)
    at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:393)
    at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    Caused by: could not determine a constructor for the tag tag:yaml.org,2002:org.bukkit.Material
    in "<string>", line 4, column 13:
    Helmet: !!org.bukkit.Material 'IRON_HELMET'
    ^


    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructUndefined.construct(SafeConstructor.java:475)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:183)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:326)
    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:143)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:307)
    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:459)
    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:183)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:326)
    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:143)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:307)
    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:459)
    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:183)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:326)
    at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:143)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:307)
    at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:459)
    at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:26)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:183)
    at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:142)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:128)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:399)


    EDIT: P.S:


    In der Config siehts so aus:



    Helmet: !!org.bukkit.Material 'IRON_HELMET'
    Chest: !!org.bukkit.Material 'IRON_CHESTPLATE'
    Legs: !!org.bukkit.Material 'IRON_LEGGINGS'
    Boots: !!org.bukkit.Material 'IRON_BOOTS'


    Engelsflügel am Astonkühler, als Schutz vor dem Teufel!