本文整理汇总了Java中org.bukkit.material.FlowerPot类的典型用法代码示例。如果您正苦于以下问题:Java FlowerPot类的具体用法?Java FlowerPot怎么用?Java FlowerPot使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FlowerPot类属于org.bukkit.material包,在下文中一共展示了FlowerPot类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: serializeState
import org.bukkit.material.FlowerPot; //导入依赖的package包/类
@SuppressWarnings("deprecation")
public static Optional<String> serializeState(BlockState state) {
YamlConfiguration yaml = new YamlConfiguration();
// http://minecraft.gamepedia.com/Block_entity was used as a reference for this method
if (state instanceof InventoryHolder) {
yaml.set(INVENTORY_KEY, InventoryHelper.serializeInventory(((InventoryHolder) state).getInventory()));
}
if (state instanceof Sign) {
yaml.set(SIGN_LINES_KEY, Arrays.asList(((Sign) state).getLines()));
} else if (Support.BANNER && state instanceof Banner) {
yaml.set(BANNER_BASE_COLOR_KEY, ((Banner) state).getBaseColor().name());
ConfigurationSection patternSection = yaml.createSection(BANNER_PATTERNS_KEY);
List<Pattern> patterns = ((Banner) state).getPatterns();
for (int i = 0; i < patterns.size(); i++) {
ConfigurationSection subSection = patternSection.createSection("" + i);
subSection.set(BANNER_PATTERN_COLOR_KEY, patterns.get(i).getColor().name());
subSection.set(BANNER_PATTERN_TYPE_KEY, patterns.get(i).getPattern().name());
}
} else if (state instanceof CreatureSpawner) {
yaml.set(SPAWNER_TYPE_KEY, ((CreatureSpawner) state).getSpawnedType().name());
yaml.set(SPAWNER_DELAY_KEY, ((CreatureSpawner) state).getDelay());
} else if (state instanceof NoteBlock) {
yaml.set(NOTE_OCTAVE_KEY, ((NoteBlock) state).getNote().getOctave());
yaml.set(NOTE_TONE_KEY, ((NoteBlock) state).getNote().getTone().name());
} else if (state instanceof Jukebox) {
if (((Jukebox) state).isPlaying()) {
yaml.set(JUKEBOX_DISC_KEY, ((Jukebox) state).getPlaying());
}
} else if (state instanceof Skull) {
yaml.set(SKULL_OWNER_KEY, ((Skull) state).getOwner());
yaml.set(SKULL_ROTATION_KEY, ((Skull) state).getRotation().name());
} else if (state instanceof CommandBlock) {
yaml.set(COMMAND_NAME_KEY, ((CommandBlock) state).getName());
yaml.set(COMMAND_CMD_KEY, ((CommandBlock) state).getCommand());
} else if (state instanceof FlowerPot) {
yaml.set(FLOWER_TYPE_KEY, ((FlowerPot) state).getContents().getItemType().name());
yaml.set(FLOWER_DATA_KEY, ((FlowerPot) state).getContents().getData());
}
if (yaml.getKeys(false).size() > 0) {
return Optional.of(yaml.saveToString());
}
return Optional.absent();
}
开发者ID:caseif,项目名称:Steel,代码行数:48,代码来源:BlockStateSerializer.java
示例2: FlowerPot
import org.bukkit.material.FlowerPot; //导入依赖的package包/类
public FlowerPot() {
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:3,代码来源:FlowerPot.java
示例3: clone
import org.bukkit.material.FlowerPot; //导入依赖的package包/类
public FlowerPot clone() {
return null;
}
开发者ID:deathcap,项目名称:BedrockAPI,代码行数:4,代码来源:FlowerPot.java
注:本文中的org.bukkit.material.FlowerPot类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论