Why isn't my plugin.yml wanting to work?

Discussion in 'Plugin Development' started by DragsZombies, Sep 27, 2012.

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

    DragsZombies

    I'm having trouble getting my plugin.yml to work for my plugin. It keeps spitting out errors, and I know I have my plugin.yml right.

    This is the error I get:
    PHP:
    2012-09-27 23:24:15 [SEVEREjava.lang.ClassCastExceptionjava.lang.String cannot be cast to java.util.Map
    2012
    -09-27 23:24:15 [SEVERE]    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:42)
    2012-09-27 23:24:15 [SEVERE]    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:203)
    2012-09-27 23:24:15 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
    2012-09-27 23:24:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
    2012-09-27 23:24:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
    2012-09-27 23:24:15 [SEVERE]    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
    2012-09-27 23:24:15 [SEVERE]    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    2012-09-27 23:24:15 [SEVERE]    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
    2012-09-27 23:24:15 [SEVERE]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:378)
    2012-09-27 23:24:15 [SEVERE]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    2012-09-27 23:24:15 [SEVEREEncountered an unexpected exception ClassCastException
    java
    .lang.ClassCastExceptionjava.lang.String cannot be cast to java.util.Map
        at org
    .bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:42)
        
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:203)
        
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
        
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
        
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
        
    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
        
    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
        
    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:378)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    Here's my plugin.yml:
    Code:
    name = Toxicity;
            version = 0.1;
            main = com.toxicity;
    And here is my main class:
    PHP:
    package com.toxicity;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;
     
     
    public class 
    Toxicity extends JavaPlugin implements Listener{
    Long tickdelay = (long0;
    public 
    void onEnable(){
    this.saveDefaultConfig();
    this.getConfig().set("delay-between-damage-in-seconds"20);
    tickdelay this.getConfig().getLong("delay-between-damage-in-seconds")*20;
    this.getPluginLoader().createRegisteredListeners(thisthis);
    }
    public 
    void onDisable(){
     
    }
    public 
    boolean isDamageTime(Player player){
    Long curTime player.getWorld().getTime();
    if (
    curTime>=13800&&curTime<=22200){
    Long nighTime 24000-curTime;
    if ((
    nighTime/tickdelay)==Integer.parseInt(Long.toString((nighTime/tickdelay)))){
    return 
    true;
    }
    }else{
    return 
    false;}
    return 
    false;}
    public 
    void onPlayerMove(PlayerMoveEvent evt){
    Player player =evt.getPlayer();
    ItemStack Hat player.getInventory().getHelmet();
    if (
    Hat.getType()!=Material.IRON_HELMET){
    if (
    isDamageTime(player)){
    player.damage(1);}}}}

    I really need to fix this. I'm so close to being finished with my first plugin.

    thank you!

    DragsZombies
     
  2. Offline

    Sagacious_Zed Bukkit Docs

    DragsZombies
    Please refer to the bukkit wiki for the proper format of a plugin.yml file
     
  3. Offline

    Courier

    There should not be indentation before version nor main.

    EDIT: There are other problems too, but that is the one that is giving you the error right now.
     
  4. Offline

    DragsZombies

    Sagacious_Zed

    I did, I still had the problem, I'm still getting this problem, I will try again, and I will edit it once I have done so.

    Courier

    What are those other problems? How am I able to fix them?
     
  5. Offline

    jamietech

  6. Offline

    DragsZombies

    alright, I'd really like some help. If someone could show me an example of how it should look, I'll be able to do this. I'm fairly new to coding. Thanks!

    EDIT:

    OMG! It works! Thank you jamietech for that link! I tried it, changed it to my settings and took of the permissions part since I don't have those yet, and it went on without that error! :D thank you so much!
     
  7. Offline

    Sagacious_Zed Bukkit Docs

    There is an example on the wiki http://wiki.bukkit.org/Plugin.yml
     
  8. Offline

    DragsZombies

    Thanks Sagacious_Zed, jamietech's link helped also. Thanks though!

    EDIT:


    Figured it out. :D Thanks for all the help!
     
  9. Offline

    Officialjake

    DragsZombies

    Also for future reference make sure the plugin.yml is inside the package level in the IDE and NOT in the SRC level.
     
  10. Offline

    DragsZombies

    That's where I have it. My friend who is fixing it up, said to put it in the SRC not anything else.... I'll need to tell him... Thanks for telling me
     
  11. Offline

    Sagacious_Zed Bukkit Docs

    The location where plugin.yml goes in the project depends on how you have the plugin packaged into a jar. What is important is that plugin.yml ends up in the root of the final exported jar.
     
  12. Offline

    DragsZombies

Thread Status:
Not open for further replies.

Share This Page