本文整理汇总了Java中org.bukkit.entity.Horse.Color类的典型用法代码示例。如果您正苦于以下问题:Java Color类的具体用法?Java Color怎么用?Java Color使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Color类属于org.bukkit.entity.Horse包,在下文中一共展示了Color类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deserialize
import org.bukkit.entity.Horse.Color; //导入依赖的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.Color; //导入依赖的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: deserialize
import org.bukkit.entity.Horse.Color; //导入依赖的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);
}
示例4: loadData
import org.bukkit.entity.Horse.Color; //导入依赖的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);
}
示例5: setColor
import org.bukkit.entity.Horse.Color; //导入依赖的package包/类
@Override
public void setColor(Color color){
((IEntityHorsePet) getEntityPet()).setColor(color);
this.color = color;
}
示例6: getColor
import org.bukkit.entity.Horse.Color; //导入依赖的package包/类
@Override
public Color getColor(){
return this.color;
}
示例7: getHorseColor
import org.bukkit.entity.Horse.Color; //导入依赖的package包/类
public Color getHorseColor() {
return colour;
}
示例8: getColor
import org.bukkit.entity.Horse.Color; //导入依赖的package包/类
Horse.Color getColor();
示例9: setColor
import org.bukkit.entity.Horse.Color; //导入依赖的package包/类
void setColor(Horse.Color color);