My Plugin Broke :(

Discussion in 'Plugin Development' started by dragonhunting, May 23, 2014.

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

    dragonhunting

    Hey all,

    I just updated my plugin to CraftBukkit 1.7.9 R1.0 and now its broke.
    The Imports are broke .-.
    Those are my imports:

    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import java.util.logging.Logger;

    getCommand is broke to!
    Can someone please help me!
    Im a noob coder :p

    Regards,
    dragonhunting
     
  2. Offline

    Bram0101

    What's you're code
     
  3. Offline

    ImPhantom

    Uhm, Are you using the "Bukkit" API build or the "CraftBukkit" build?
     
  4. Offline

    dragonhunting

    CraftBukkit

    Main Code:

    package me.dragonhunting.DragonCore;

    import java.util.logging.Logger;

    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin {

    public Logger Log = Logger.getLogger("Minecraft");

    @Override
    public void onEnable() {
    Log.info("[DragonCore] " + this.getDescription().getVersion() + " Is Enabled");

    getCommand("test").setExecutor(new Commands());
    getCommand("vote").setExecutor(new Commands());
    getCommand("staff").setExecutor(new Commands());
    getCommand("dragoncore").setExecutor(new Commands());
    getCommand("website").setExecutor(new Commands());
    getCommand("shop").setExecutor(new Commands());
    System.out.println("[DragonCore] Plugin Enabled");
    }

    @Override
    public void onDisable() {
    Log.info("[DragonCore] " + this.getDescription().getVersion() + " Is Disabled");

    Sy
    package me.dragonhunting.DragonCore;

    import java.util.logging.Logger;

    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin {

    public Logger Log = Logger.getLogger("Minecraft");

    @Override
    public void onEnable() {
    Log.info("[DragonCore] " + this.getDescription().getVersion() + " Is Enabled");

    getCommand("test").setExecutor(new Commands());
    getCommand("vote").setExecutor(new Commands());
    getCommand("staff").setExecutor(new Commands());
    getCommand("dragoncore").setExecutor(new Commands());
    getCommand("website").setExecutor(new Commands());
    getCommand("shop").setExecutor(new Commands());
    System.out.println("[DragonCore] Plugin Enabled");
    }

    @Override
    public void onDisable() {
    Log.info("[DragonCore] " + this.getDescription().getVersion() + " Is Disabled");

    System.out.println("[DragonCore] Plugin Disabled");
    }

    }

    It says my commands.class and plugin.yml does'nt excist.
    I don't know what's the matter with that.

    Oh, well.

    commands.class:

    package me.dragonhunting.DragonCore;

    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;

    public class Commands implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String arg2,
    String[] args) {
    if (sender instanceof Player)

    {
    if (cmd.getName().equalsIgnoreCase("test"))
    {
    Player p = (Player) sender;

    if (p.hasPermission("dragonhunting.dragoncore.test"))
    {
    p.sendMessage(ChatColor.GOLD + "Test");
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }
    }

    if(cmd.getName().equalsIgnoreCase("vote"))
    {
    Player p = (Player) sender;
    if (p.hasPermission("dragonhunting.dragoncore.vote"))
    {
    p.sendMessage(ChatColor.GRAY + "Vote At <Edit by Moderator: Redacted bit url>
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }
    }

    if(cmd.getName().equalsIgnoreCase("staff"))
    {
    Player p = (Player) sender;
    if ( p.hasPermission("dragonhunting.dragoncore.staff"))
    {
    p.sendMessage(ChatColor.DARK_RED + "Owners: dragonhunting, Rick_R2001");
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }

    }
    if(cmd.getName().equalsIgnoreCase("website"))
    {
    Player p = (Player) sender;
    if ( p.hasPermission("dragonhunting.dragoncore.website"))
    {
    p.sendMessage(ChatColor.DARK_GRAY + "bitly.com/1sczkJA");
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }
    }
    if(cmd.getName().equalsIgnoreCase("dragoncore"))
    {
    Player p = (Player) sender;
    if ( p.hasPermission("dragonhunting.dragoncore.help"))
    {
    p.sendMessage(ChatColor.GOLD + "DragonCore Help Page");
    p.sendMessage(ChatColor.WHITE + "/test - Test For Lag.");
    p.sendMessage(ChatColor.WHITE + "/vote - Vote For SlimyPvP.");
    p.sendMessage(ChatColor.WHITE + "/staff - View All Staff Of This Server.");
    p.sendMessage(ChatColor.WHITE + "/website - Visit Our Website.");
    p.sendMessage(ChatColor.WHITE + "/shop - Buy Anything At Our Online Shop.");
    p.sendMessage(ChatColor.DARK_RED + "DragonCore Plugin By dragonhunting");
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }
    }
    if(cmd.getName().equalsIgnoreCase("shop"))
    {
    Player p = (Player) sender;
    if ( p.hasPermission("dragonhunting.dragoncore.shop"))
    {
    p.sendMessage(ChatColor.GRAY + "bit.ly/1ttd8LJ");
    }
    else
    {
    p.sendMessage(ChatColor.DARK_RED + "You Don't Have Access To This Command!");
    }

    return false;
    }
    return false;
    }
    return false;
    }}

    Plugin.yml:


    name: DragonCore
    main: me.dragonhunting.DragonCore.Main
    version: 1.4
    description: DragonCore Plugin By Dragonhunting
    author: dragonhunting
    commands:
    test:
    description: Test For Lag.
    vote:
    description: Vote Command.
    staff:
    description: List Off All Our Staff.
    dragoncore:
    description: Main DragonCore Command.
    website:
    description: Visit Our Website.
    shop:
    description: View Our Online Shop Page

    Eclipse is saying that everything is wrong, but the plugin still works .-.
    I realy don't know whats wrong???

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 12, 2017
  5. Offline

    Cryices

    You have to re-import a new bukkit build I presume, try that
     
  6. Offline

    dragonhunting

    Worked! Thanks :D

    Topic can be closed.
     
Thread Status:
Not open for further replies.

Share This Page