本文整理汇总了Java中org.bukkit.entity.Horse.setVariant方法的典型用法代码示例。如果您正苦于以下问题:Java Horse.setVariant方法的具体用法?Java Horse.setVariant怎么用?Java Horse.setVariant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Horse
的用法示例。
在下文中一共展示了Horse.setVariant方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHorse
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
public static Horse createHorse(Player p, PlayerDataRPG pd) {
Horse horse = (Horse) REntities.createLivingEntity(CustomHorse.class, p.getLocation());
horse.setTamed(true);
setHorseSpeed(horse, getSpeed(pd.horseSpeed));
horse.setJumpStrength(getJump(pd.horseJump));
horse.setColor(getColor(pd));
horse.setStyle(getStyle(pd));
horse.setVariant(getVariant(pd));
horse.getInventory().setSaddle(new ItemStack(Material.SADDLE));
if (pd.horseArmor != null)
horse.getInventory().setArmor(new ItemStack(pd.horseArmor));
if (pd.horseBaby) {
horse.setBaby();
horse.setAgeLock(true);
}
horse.setCustomName(p.getName() + "'s Horse");
horse.setCustomNameVisible(true);
pd.riding = true;
horse.setPassenger(p);
horseUUIDs.add(horse.getUniqueId());
return horse;
}
示例2: apply
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public boolean apply(Entity entity) {
PreCon.notNull(entity);
PreCon.isValid(entity instanceof Horse, "org.bukkit.entity.Horse expected.");
Horse horse = (Horse) entity;
horse.setColor(_color);
horse.setVariant(_variant);
horse.setStyle(_style);
horse.setMaxDomestication(_maxDomestication);
horse.setDomestication(_domestication);
horse.setCarryingChest(_hasChest);
horse.setJumpStrength(_jumpStrength);
return true;
}
示例3: applyMountData
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public void applyMountData(Entity npc) {
super.applyMountData(npc);
if (!(npc instanceof Horse)) {
return;
}
Horse horse = (Horse) npc;
if (colour != null) {
horse.setColor(colour);
}
if (style != null) {
horse.setStyle(style);
}
if (variant != null) {
horse.setVariant(variant);
}
}
示例4: set
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public void set(final Horse entity) {
if (variant != null)
entity.setVariant(variant);
if (color != null)
entity.setColor(color);
if (style != null)
entity.setStyle(style);
}
示例5: onSpawn
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public void onSpawn() {
Horse horse = (Horse) getNPC().getEntity();
if (color != null) horse.setColor(color);
if (variant != null) horse.setVariant(variant);
if (style != null) horse.setStyle(style);
if (jumpStrength != null) horse.setJumpStrength(jumpStrength);
if (domestication != null) horse.setDomestication(domestication);
if (maxDomestication != null) horse.setMaxDomestication(maxDomestication);
}
示例6: spawnHorse
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public LivingEntity spawnHorse(Location loc, HorseType type, Color color, Style style, boolean tame, boolean chest)
{
Horse horse = (Horse) loc.getWorld().spawnEntity(loc, EntityType.HORSE);
horse.setVariant(type.getVariant());
horse.setColor(color);
horse.setStyle(style);
horse.setTamed(tame);
horse.setCarryingChest(chest);
return horse;
}
示例7: apply
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
@Override
public void apply(Entity entity) {
if (!(entity instanceof Horse)) return;
Horse horse = (Horse)entity;
horse.setColor(color);
horse.setVariant(variant);
horse.setStyle(style);
horse.getInventory().setSaddle(saddle);
horse.getInventory().setArmor(armor);
horse.setDomestication(domestication);
horse.setMaxDomestication(maxDomestication);
horse.setJumpStrength(jumpStrength);
}
示例8: onCommand
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
/**
* This method handles user commands. Usage: "/deadhorses <reload,summon>"
*/
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
/* "/deadhorses reload" - Reload configuration */
if (args.length == 1 && args[0].equalsIgnoreCase("reload")) {
plugin.reload();
sender.sendMessage("Configuration has been reloaded.");
return true;
}
/* "/deadhorses summon" - Summon DeadHorses for testing */
if (args.length == 1 && args[0].equalsIgnoreCase("summon")) {
if (!(sender instanceof Player)) {
sender.sendMessage("This command does not support console use.");
return true;
}
Player player = (Player) sender;
for (Horse.Variant variant : new Horse.Variant[] {Horse.Variant.SKELETON_HORSE,
Horse.Variant.UNDEAD_HORSE}) {
Horse horse = (Horse) player.getWorld().spawnEntity(player.getLocation(), EntityType.HORSE);
horse.setVariant(variant);
if (plugin.getPluginConfig().isFoodAgingEnabled()) {
horse.setBaby();
} else {
horse.setAdult();
}
}
sender.sendMessage("Dead horses have been summoned.");
return true;
}
/* Return false to trigger display of usage from plugin.yml */
return false;
}
示例9: getHorsePattern
import org.bukkit.entity.Horse; //导入方法依赖的package包/类
public void getHorsePattern(Player p, Horse horse, int res)
{
if (res == 1 && p.hasPermission("equestriandash.horsestyles.black_dots"))
{
horse.setStyle(Horse.Style.BLACK_DOTS);
}
else if (res == 2 && p.hasPermission("equestriandash.horsestyles.none"))
{
horse.setStyle(Horse.Style.NONE);
}
else if (res == 3 && p.hasPermission("equestriandash.horsestyles.white"))
{
horse.setStyle(Horse.Style.WHITE);
}
else if (res == 4 && p.hasPermission("equestriandash.horsestyles.whitefield"))
{
horse.setStyle(Horse.Style.WHITEFIELD);
}
else if (res == 5 && p.hasPermission("equestriandash.horsestyles.white_Dots"))
{
horse.setStyle(Horse.Style.WHITE_DOTS);
}
else if (res == 6 && p.hasPermission("equestriandash.horsestyles.skeleton"))
{
horse.setVariant(Horse.Variant.SKELETON_HORSE);
}
else if (res == 7 && p.hasPermission("equestriandash.horsestyles.zombie"))
{
horse.setVariant(Horse.Variant.UNDEAD_HORSE);
}
else
{
horse.setStyle(Horse.Style.NONE);
}
}