本文整理匯總了Java中org.spongepowered.api.text.Text.EMPTY屬性的典型用法代碼示例。如果您正苦於以下問題:Java Text.EMPTY屬性的具體用法?Java Text.EMPTY怎麽用?Java Text.EMPTY使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.spongepowered.api.text.Text
的用法示例。
在下文中一共展示了Text.EMPTY屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSpacesString
private Text getSpacesString(double numberOfSpaces) {
Text.Builder spaces = Text.builder();
if (Math.floor(numberOfSpaces) == 0) {
return Text.EMPTY;
}
double x = numberOfSpaces - Math.floor(numberOfSpaces);
int numberOfSpecialSpaces = (int) (x / 0.25);
int numberOfNormalSpaces = (int) (Math.floor(numberOfSpaces) - numberOfSpecialSpaces);
if (numberOfNormalSpaces < 0) {
if (numberOfSpecialSpaces == 3) {
numberOfSpecialSpaces = 0;
numberOfNormalSpaces = (int) Math.ceil(numberOfSpaces);
} else {
numberOfSpecialSpaces += numberOfNormalSpaces;
numberOfNormalSpaces = 0;
}
}
for (int k = 0; k < numberOfNormalSpaces; k++) {
spaces.append(Text.of(" "));
}
for (int l = 0; l < numberOfSpecialSpaces; l++) {
spaces.append(Text.builder().style(TextStyles.BOLD).append(Text.of(" ")).build());
}
return spaces.toText();
}
示例2: getSpacesString
private Text getSpacesString(double numberOfSpaces) {
Text.Builder spaces = Text.builder();
if (Math.floor(numberOfSpaces) == 0) {
return Text.EMPTY;
}
double x = numberOfSpaces - Math.floor(numberOfSpaces);
int numberOfSpecialSpaces = (int) (x / 0.25);
int numberOfNormalSpaces = (int) (Math.floor(numberOfSpaces) - numberOfSpecialSpaces);
if (numberOfNormalSpaces < 0) {
if (numberOfSpecialSpaces == 3) {
numberOfSpecialSpaces = 0;
numberOfNormalSpaces = (int) Math.ceil(numberOfSpaces);
} else {
numberOfSpecialSpaces += numberOfNormalSpaces;
numberOfNormalSpaces = 0;
}
}
for (int k = 0; k < numberOfNormalSpaces; k++) {
spaces.append(Text.of(" "));
}
for (int l = 0; l < numberOfSpecialSpaces; l++) {
spaces.append(Text.builder().style(TextStyles.BOLD).append(Text.of(" ")).build());
}
return spaces.build();
}
示例3: getName
public Text getName() {
if(name == null){
return Text.EMPTY;
}
return name;
}
示例4: getValue
protected Text getValue(String key) {
if (columns.containsKey(key)) {
return columns.get(key);
}
return Text.EMPTY;
}
示例5: getUsage
@Override public Text getUsage(CommandSource source) {
return Text.EMPTY;
}