本文整理汇总了Java中org.bukkit.entity.Horse.Style类的典型用法代码示例。如果您正苦于以下问题:Java Style类的具体用法?Java Style怎么用?Java Style使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Style类属于org.bukkit.entity.Horse包,在下文中一共展示了Style类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
protected boolean deserialize(final String s) {
final String[] split = s.split(",");
if (split.length != 3)
return false;
try {
variant = split[0].isEmpty() ? null : Variant.valueOf(split[0]);
color = split[1].isEmpty() ? null : Color.valueOf(split[1]);
style = split[2].isEmpty() ? null : Style.valueOf(split[2]);
} catch (final IllegalArgumentException e) {
return false;
}
return true;
}
示例2: spawnHorse
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
public LivingEntity spawnHorse(Location loc, HorseType type, Color color, Style style, boolean tame, boolean chest)
{
Horse horse = (Horse) loc.getWorld().spawnEntity(loc, type.getEntity());
horse.setColor(color);
horse.setStyle(style);
horse.setTamed(tame);
if (chest && horse instanceof ChestedHorse)
((ChestedHorse) horse).setCarryingChest(true);
return horse;
}
示例3: StoredEntityType
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
StoredEntityType(final int id, final String name) {
this.id = id;
this.name = Check.notNull(name, "The name cannot be null!");
if (name.startsWith("HORSE_")) {
this.type = EntityType.HORSE;
this.style = Optional.of(Style.valueOf(name.replaceFirst("HORSE_", "")));
}
else {
this.type = EntityType.valueOf(name);
this.style = Optional.empty();
}
}
示例4: deserialize
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
public void deserialize(IDataNode dataNode) throws DeserializeException {
_color = dataNode.getEnum("color", Color.WHITE, Color.class);
_variant = dataNode.getEnum("variant", Variant.HORSE, Variant.class);
_style = dataNode.getEnum("style", Style.NONE, Style.class);
_domestication = dataNode.getInteger("dom");
_maxDomestication = dataNode.getInteger("max-dom");
_hasChest = dataNode.getBoolean("chest");
_jumpStrength = dataNode.getDouble("jump", 1.0D);
}
示例5: loadData
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
public void loadData(ConfigurationSection section) {
this.colour = Color.valueOf(section.getString("color", Color.BLACK.name()));
this.style = Style.valueOf(section.getString("style", Style.NONE.name()));
this.variant = Variant.valueOf(section.getString("variant", Variant.HORSE.name()));
super.loadData(section);
}
示例6: setStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
public void setStyle(Style style){
((IEntityHorsePet) getEntityPet()).setStyle(style);
this.style = style;
}
示例7: getStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
@Override
public Style getStyle(){
return this.style;
}
示例8: getStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
/** TODO: Documentation */
public Optional<Style> getStyle() { return this.style; }
示例9: getHorseStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
public Style getHorseStyle() {
return style;
}
示例10: getStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
Horse.Style getStyle();
示例11: setStyle
import org.bukkit.entity.Horse.Style; //导入依赖的package包/类
void setStyle(Horse.Style style);