com.github.ucchyocean.lc
クラス Utility

java.lang.Object
  上位を拡張 com.github.ucchyocean.lc.Utility

public class Utility
extends Object

ユーティリティクラス

作成者:
ucchy

コンストラクタの概要
Utility()
           
 
メソッドの概要
static org.bukkit.ChatColor changeToChatColor(String color)
          カラー表記の文字列を、ChatColorクラスに変換する
static String changeToColorCode(String color)
          カラー表記の文字列を、カラーコードに変換する
static void copyFileFromJar(File jarFile, File targetFile, String sourceFilePath, boolean isBinary)
          jarファイルの中に格納されているファイルを、jarファイルの外にコピーするメソッド
static String getAstariskString(int length)
          指定された文字数のアスタリスクの文字列を返す
static org.bukkit.OfflinePlayer getOfflinePlayer(String name)
          指定された名前のオフラインプレイヤーを取得する
static ArrayList<org.bukkit.entity.Player> getOnlinePlayers()
          現在接続中のプレイヤーを全て取得する
static int getOnlinePlayersCount()
          現在のサーバー接続人数を返します。
static org.bukkit.entity.Player getPlayerExact(String name)
          指定された名前のプレイヤーを取得する
static boolean isCB178orLater()
          現在動作中のCraftBukkitが、v1.7.8 以上かどうかを確認する
static boolean isCB19orLater()
          現在動作中のCraftBukkitが、v1.9 以上かどうかを確認する
static boolean isUpperVersion(String version, String border)
          指定されたバージョンが、基準より新しいバージョンかどうかを確認する
static boolean isValidColor(String color)
          ChatColorで指定可能な色かどうかを判断する
static boolean isValidColorCode(String code)
          カラーコードかどうかを判断する
static String replaceColorCode(String source)
          文字列内のカラーコード候補(&a)を、カラーコード(§a)に置き換えする
static String stripColor(String source)
          文字列に含まれているカラーコード(§a)を除去して返す
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

Utility

public Utility()
メソッドの詳細

copyFileFromJar

public static void copyFileFromJar(File jarFile,
                                   File targetFile,
                                   String sourceFilePath,
                                   boolean isBinary)
jarファイルの中に格納されているファイルを、jarファイルの外にコピーするメソッド

パラメータ:
jarFile - jarファイル
targetFile - コピー先
sourceFilePath - コピー元
isBinary - バイナリファイルかどうか

replaceColorCode

public static String replaceColorCode(String source)
文字列内のカラーコード候補(&a)を、カラーコード(§a)に置き換えする

パラメータ:
source - 置き換え元の文字列
戻り値:
置き換え後の文字列

stripColor

public static String stripColor(String source)
文字列に含まれているカラーコード(§a)を除去して返す

パラメータ:
source - 置き換え元の文字列
戻り値:
置き換え後の文字列

getAstariskString

public static String getAstariskString(int length)
指定された文字数のアスタリスクの文字列を返す

パラメータ:
length - アスタリスクの個数
戻り値:
指定された文字数のアスタリスク

changeToChatColor

public static org.bukkit.ChatColor changeToChatColor(String color)
カラー表記の文字列を、ChatColorクラスに変換する

パラメータ:
color - カラー表記の文字列
戻り値:
ChatColorクラス

changeToColorCode

public static String changeToColorCode(String color)
カラー表記の文字列を、カラーコードに変換する

パラメータ:
color - カラー表記の文字列
戻り値:
カラーコード

isValidColor

public static boolean isValidColor(String color)
ChatColorで指定可能な色かどうかを判断する

パラメータ:
color - カラー表記の文字列
戻り値:
指定可能かどうか

isValidColorCode

public static boolean isValidColorCode(String code)
カラーコードかどうかを判断する

パラメータ:
color - カラー表記の文字列
戻り値:
指定可能かどうか

isCB178orLater

public static boolean isCB178orLater()
現在動作中のCraftBukkitが、v1.7.8 以上かどうかを確認する

戻り値:
v1.7.8以上ならtrue、そうでないならfalse

isCB19orLater

public static boolean isCB19orLater()
現在動作中のCraftBukkitが、v1.9 以上かどうかを確認する

戻り値:
v1.9以上ならtrue、そうでないならfalse

isUpperVersion

public static boolean isUpperVersion(String version,
                                     String border)
指定されたバージョンが、基準より新しいバージョンかどうかを確認する

パラメータ:
version - 確認するバージョン
border - 基準のバージョン
戻り値:
基準より確認対象の方が新しいバージョンかどうか
ただし、無効なバージョン番号(数値でないなど)が指定された場合はfalseに、 2つのバージョンが完全一致した場合はtrueになる。

getOnlinePlayers

public static ArrayList<org.bukkit.entity.Player> getOnlinePlayers()
現在接続中のプレイヤーを全て取得する

戻り値:
接続中の全てのプレイヤー

getOnlinePlayersCount

public static int getOnlinePlayersCount()
現在のサーバー接続人数を返します。

戻り値:
サーバー接続人数

getOfflinePlayer

public static org.bukkit.OfflinePlayer getOfflinePlayer(String name)
指定された名前のオフラインプレイヤーを取得する

パラメータ:
name - プレイヤー名
戻り値:
オフラインプレイヤー

getPlayerExact

public static org.bukkit.entity.Player getPlayerExact(String name)
指定された名前のプレイヤーを取得する

パラメータ:
name - プレイヤー名
戻り値:
プレイヤー


Copyright © 2016. All rights reserved.