Solved Code buged?

Discussion in 'Plugin Development' started by MaTaMoR_, Mar 14, 2015.

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

    MaTaMoR_

    Hi everyone, i think my code is bugged, ¿why? When i try to compile i get this error : Error
    But when i go to see the error, there's no errors ...

    Photo

    Code :
    Code:java
    1.  
    2. package com.gmail.santiagoelheroe.commands;
    3.  
    4. import com.gmail.santiagoelheroe.Main;
    5. import com.gmail.santiagoelheroe.Messages;
    6. import java.util.logging.Level;
    7. import org.bukkit.Bukkit;
    8. import org.bukkit.ChatColor;
    9. import org.bukkit.command.Command;
    10. import org.bukkit.command.CommandSender;
    11. import org.bukkit.entity.Player;
    12.  
    13. public class ItemCommandCreate implements ItemCommand { //Error
    14.  
    15. private final Main plugin;
    16. public ItemCommandCreate(Main i) {
    17. plugin = i;
    18. }
    19.  
    20. public String c(String text) {
    21. return ChatColor.translateAlternateColorCodes('&', text);
    22. }
    23.  
    24. public String getName(String[] args) {
    25. StringBuilder sb = new StringBuilder();
    26. for(int i = 1; i < args.length; i++){
    27. sb.append(args[I]).append(" ");
    28. }
    29. return sb.toString();
    30. }
    31.  
    32. public boolean checkColor(String text) {[/I]
    33. return (text.equals(ChatColor.translateAlternateColorCodes('&', text)));
    34. [I]}
    35.  
    36. @Override//Error
    37. public void onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    38. if(sender instanceof Player) {
    39. Player player = (Player) sender;
    40. if(sender.hasPermission("item.command.admin.create")) {
    41. if(args.length > 1) {
    42. String name = getName(args);
    43. if(!plugin.manager().checkItemName(name)) {
    44. if(checkColor(name)) {
    45.  
    46. plugin.manager().createItem(player.getUniqueId(), name);
    47. sender.sendMessage(c("&aHas creado un item llamado : &e" + name));
    48. Bukkit.getLogger().log(Level.INFO, "El jugador {0} ha creado un Item llamado {1}", new Object[]{sender.getName(), name});
    49. [/I]
    50. } else sender.sendMessage(c(Messages.HAS_COLOR));
    51. } else sender.sendMessage(c(Messages.NAME_ALREADY_IN_USE));
    52. } else sender.sendMessage(c(Messages.WRONG_USAGE));
    53. } else sender.sendMessage(c(Messages.NO_PERMISSIONS));
    54. } else sender.sendMessage(c(Messages.CONSOLE_SENDER));
    55. [I] }
    56. }
    57. [/I]
     
    Last edited: Mar 14, 2015
  2. Offline

    Skionz

    @MaTaMoR_ You have to override methods in your interface.
     
  3. Offline

    MaTaMoR_

    That's not the error, i'll explain it better, i'm getting that error since i changed the name of my package

    I fixed it removing the class ItemCommand and creating it again... This is so stupid .

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
Thread Status:
Not open for further replies.

Share This Page