本文整理汇总了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();
}
示例2: FlowerPot
import org.bukkit.material.FlowerPot; //导入依赖的package包/类
public FlowerPot() {
}
示例3: clone
import org.bukkit.material.FlowerPot; //导入依赖的package包/类
public FlowerPot clone() {
return null;
}