Export class files with errors

Discussion in 'Plugin Development' started by Alster551, May 25, 2014.

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

    Alster551

    So i was wondering if in eclipse there is any way to export a plugin ignoring the errors? So if say i want to export something and it comes uo with errors, it exports it with the errors? Ifthat makes any sense, so for example i export this:
    Code:java
    1. package org.bukkit.command.defaults;
    2.  
    3. import java.util.Arrays;
    4. import java.util.Collections;
    5. import java.util.List;
    6. import org.bukkit.Bukkit;
    7. import org.bukkit.ChatColor;
    8. import org.bukkit.command.CommandSender;
    9. import org.bukkit.plugin.Plugin;
    10. import org.bukkit.plugin.PluginDescriptionFile;
    11. import org.bukkit.plugin.PluginManager;
    12.  
    13. public class PluginsCommand extends BukkitCommand
    14. {
    15. public PluginsCommand(String name)
    16. {
    17. super(name);
    18. this.description = "Gets a list of plugins running on the server";
    19. this.usageMessage = "/plugins";
    20. setPermission("bukkit.command.plugins");
    21. setAliases(Arrays.asList(new String[] { "pl" }));
    22. }
    23.  
    24. public boolean execute(CommandSender sender, String currentAlias, String[] args)
    25. {
    26. if (!testPermission(sender)) return true;
    27.  
    28. sender.sendMessage(ChatColor.GOLD +"Plugins " + getPluginList());
    29. return true;
    30. }
    31.  
    32. private String getPluginList() {
    33. StringBuilder pluginList = new StringBuilder();
    34. Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
    35.  
    36. for (Plugin plugin : plugins) {
    37. if (pluginList.length() > 0) {
    38. pluginList.append(ChatColor.GOLD);
    39. pluginList.append(", ");
    40. }
    41.  
    42. pluginList.append(plugin.isEnabled() ? ChatColor.DARK_GREEN : ChatColor.DARK_RED);
    43. pluginList.append(plugin.getDescription().getName());
    44. }
    45.  
    46. return ChatColor.GOLD + "(" + ChatColor.YELLOW + plugins.length + ChatColor.GOLD + "): " + pluginList.toString();
    47. }
    48.  
    49. public List<String> tabComplete(CommandSender sender, String alias, String[] args)
    50. {
    51. return Collections.emptyList();
    52. }
    53. }


    I want it to xport as that, without removing the errors, and it exporting like this:
    Code:java
    1. package PluginsCommand;
    2.  
    3. import java.util.List;
    4. import org.bukkit.command.CommandSender;
    5.  
    6. public class PluginsCommand
    7. {
    8. public PluginsCommand(String paramString)
    9. {
    10. }
    11.  
    12. public boolean execute(CommandSender paramCommandSender, String paramString, String[] paramArrayOfString)
    13. {
    14. throw new Error("Unresolved compilation problem: \n\tThe method testPermission(CommandSender) is undefined for the type PluginsCommand\n");
    15. }
    16.  
    17. private String getPluginList()
    18. {
    19. throw new Error("Unresolved compilation problem: \n");
    20. }
    21.  
    22. public List<String> tabComplete(CommandSender paramCommandSender, String paramString, String[] paramArrayOfString)
    23. {
    24. throw new Error("Unresolved compilation problem: \n");
    25. }
    26. }
     
  2. Offline

    RawCode

    what about fixing errors?
     
    AdamQpzm likes this.
  3. Alster551 Let's say you could make it so it would export a version that just threw errors telling you had compilation errors... Why would that be worth doing?
     
  4. Offline

    Alster551

    Because I'm editing the PluginsCommand.class inside the bukkit.jar and so i want to export just that 1 file which i edited in eclipse but when i export it i know it will work because atm it just cant find the files, which it will find when i export it... AdamQpzm
     
  5. Offline

    mrkirby153

    Alster551

    Why would you want to modify the PluginsCommand class in the bukkit.jar?
     
  6. Offline

    RawCode

    Alster551

    there is no bukkit.jar at runtime, you should read some books about java before trying to play against the rules.
     
  7. Offline

    rsod

    Include bukkit.jar into your build path
     
Thread Status:
Not open for further replies.

Share This Page