本文整理汇总了Java中org.bukkit.block.banner.Pattern.getColor方法的典型用法代码示例。如果您正苦于以下问题:Java Pattern.getColor方法的具体用法?Java Pattern.getColor怎么用?Java Pattern.getColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.block.banner.Pattern
的用法示例。
在下文中一共展示了Pattern.getColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: serializeBanner
import org.bukkit.block.banner.Pattern; //导入方法依赖的package包/类
private static Map<String, Object> serializeBanner(Banner banner) {
Map<String, Object> serializedBanner = new LinkedHashMap<>();
if (banner != null) {
DyeColor baseDyeColor = banner.getBaseColor();
if (baseDyeColor != null) {
serializedBanner.put("Base", Utilities.serializeColor(baseDyeColor.getColor()));
}
List<Pattern> bannerPatterns = banner.getPatterns();
if (bannerPatterns != null && !bannerPatterns.isEmpty()) {
Map<String, Map<String, Object>> serializedPatterns = new LinkedHashMap<>();
for (int patternIndex = 0; patternIndex < bannerPatterns.size(); patternIndex++) {
Pattern bannerPattern = bannerPatterns.get(patternIndex);
Map<String, Object> serializedPattern = new LinkedHashMap<>();
if (bannerPattern.getColor() != null) {
serializedPattern.put("Color", Utilities.serializeColor(bannerPattern.getColor().getColor()));
}
serializedPattern.put("Pattern", StringUtilities.capitalizeFully(bannerPattern.getPattern().name().replace('_', ' ')));
serializedPatterns.put("Pattern " + (patternIndex + 1), serializedPattern);
}
serializedBanner.put("Patterns", serializedPatterns);
}
}
return serializedBanner;
}
示例2: FlagLayer
import org.bukkit.block.banner.Pattern; //导入方法依赖的package包/类
/**
* Create a flag layer
*
* @param pattern
* the bukkit banner pattern
*/
public FlagLayer(Pattern pattern)
{
this.color = pattern.getColor();
this.shape = FlagPattern.fromPattern(pattern.getPattern());
}