turt2live

Untitled

Jan 17th, 2013
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.27 KB | None | 0 0
  1. package some.real.path.utils;
  2.  
  3. import java.util.ArrayList;
  4. import org.bukkit.Bukkit;
  5. import org.bukkit.command.CommandSender;
  6.  
  7. // turt2live - Added temp. JD
  8. /**
  9.  * You should document what this actually is
  10.  */
  11. // turt2live - STATIC -> StaticUtilities
  12. public class StaticUtilties {
  13.    
  14.     public static Main plugin = null; // turt2live - Rename this class, unless your plugin name is "Main"
  15.     public static boolean isCraftbukkitWorking = true; // turt2live - ?
  16.     public static final String COLOR_ERROR = "§c";
  17.     public static final String COLOR_SERVERLOG = "§6";
  18.     public static final String COLOR_INTERNAL = "§d";
  19.     public static final String COLOR_ADMINCHAT = "§a";
  20.     public static final String COLOR_LUMENCHAT = "§9"; // turt2live - C_... -> COLOR_...
  21.     public static final String HEADER = "§5=============== §6§nLumenTech §5===============";
  22.     public static final String DIVIDER_BAR = "===================================="; // turt2live - DIVIDERBAR -> DIVIDER_BAR
  23.     public static final String PLUGIN_NAME = "LumenTech";
  24.  
  25.     // turt2live - Fix JD
  26.     /**
  27.      * Prints X amount of spaces.
  28.      * Example: numSpacesToPrint=15, value="10mb" returns "10mb           "
  29.      *
  30.      * @param numSpacesToPrint the number of spaces
  31.      * @param value placeholder string
  32.      * @return the new string, with appended spaces
  33.      */
  34.     // turt2live - PRINT_X_SPACES_MINUS_LEFT -> appendSpaces
  35.     public static String appendSpaces(int numSpacesToPrint, String value){
  36.         String ret = "";
  37.         ret += value;
  38.         for(int i = 0; i < numSpacesToPrint - value.length(); i++){
  39.             ret += " ";
  40.         }
  41.         return ret;
  42.     }
  43.  
  44.     public static final String SUCCESS = "§aSuccess!";
  45.     public static final String FAILURE = "§cFAILURE.";
  46.     /** for telling users a feature is not ready, or has not been added in yet. **/
  47.     public static final String NOT_YET_IMPLEMENTED = "§cThis feature isn't ready yet.";
  48.     public static final String ERROR_P_NOT_FOUND = "§cThat player is not available.";
  49.     public static final String ERROR_FUKKITRAGE = "§cThis might work normally, but because of an update to craftfukkit it is currently broken. You'll have to hunt down a new version of this plugin if you want to use this feature again. Sorry, blame the fukkitdevs. :(";
  50.     public static final String ERROR_DIRECTORY_NOT_FOUND = "Directory not found.";
  51.  
  52.     public static String TELL_USER_PERMISSION_THEY_LACK(String node){
  53.         return "§cOh teh noes! D: It appears you lack the '" + node + "' permission node that is required to perform this operation.";
  54.     }
  55.  
  56.     // turt2live - Fix JD
  57.     /**
  58.      * Determines if a CommandSender has a permission node
  59.      *
  60.      * @param cs the command sender
  61.      * @param node the permission node
  62.      * @return true if found applicable
  63.      */
  64.     // turt2live - USER_HAS_PERMISSION -> hasPermission
  65.     public static boolean hasPermission(CommandSender cs, String node){
  66.         // turt2live - What is Fm? Be descriptive in your method names
  67.         return (cs.isOp() && plugin.getFm().isAllowOpOverride()) || cs.hasPermission(node) || cs.hasPermission(PERMISSION_ALL));
  68.         }
  69.     }
  70.  
  71.     public static final String PERMISSION_DEBUG = "LumenTech.debug";
  72.     public static final String PERMISSION_ALL = "LumenTech.*";
  73.     public static final String PERMISSION_TROLL = "LumenTech.troll";
  74.     public static final String PERMISSION_SLOG = "LumenTech.slog";
  75.     public static final String PERMISSION_PLAYERINFO = "LumenTech.pi";
  76.     public static final String PERMISSION_RATIO = "LumenTech.ratio";
  77.     public static final String PERMISSION_IGNORE_RATIO_BAN = "LumenTech.ignoreratioban";
  78.     public static final String PERMISSION_BACKUP = "LumenTech.backup";
  79.     public static final String PERMISSION_ADMINCHAT = "LumenTech.adminchat";
  80.     public static final String PERMISSION_LUMENCHAT = "LumenTech.lumenchat";
  81.  
  82.     // turt2live - Added temp. JD
  83.     /**
  84.      * You should document what this actually is
  85.      */
  86.     public static enum SLOG_STATE{
  87.         OFF, COMMANDS_ONLY, ALL;
  88.     };
  89.  
  90.     //  public static enum SLOG_STATE{EVERYTHING,COMMANDS_ONLY,ITEMS,OFF}
  91.  
  92.     public static String[] CHANGELOG = {
  93.             "- changed name of plugin to LumenTech.",
  94.             "- Added backup system for use with worldedit snapshots.",
  95.             "- added some new command routes. /lt debug is an examaple.",
  96.             "- added /lt perms", "- added /ac and /lc",
  97.             "removed /lc and /ac chat. This will be a part of a more specific \"extension\" plugin known as LumenPlus. "
  98.     };
  99.  
  100. }
Advertisement
Add Comment
Please, Sign In to add comment