当前位置: 首页>>代码示例>>Java>>正文


Java Horse.setVariant方法代码示例

本文整理汇总了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;
}
 
开发者ID:edasaki,项目名称:ZentrelaRPG,代码行数:23,代码来源:HorseManager.java

示例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;
}
 
开发者ID:JCThePants,项目名称:NucleusFramework,代码行数:17,代码来源:HorseAnimal.java

示例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);
	}
}
 
开发者ID:CodingBadgers,项目名称:MineKart,代码行数:23,代码来源:HorseMountData.java

示例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);
}
 
开发者ID:nfell2009,项目名称:Skript,代码行数:10,代码来源:HorseData.java

示例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);
}
 
开发者ID:leMaik,项目名称:RpgPlus,代码行数:11,代码来源:HorseTrait.java

示例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;
}
 
开发者ID:dmulloy2,项目名称:SwornAPI,代码行数:12,代码来源:SpecialEntities.java

示例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);
}
 
开发者ID:elBukkit,项目名称:MagicLib,代码行数:15,代码来源:EntityHorseData.java

示例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;
}
 
开发者ID:EasyMFnE,项目名称:DeadHorses,代码行数:37,代码来源:DeadHorsesCommand.java

示例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);
    }
}
 
开发者ID:ColonelHedgehog,项目名称:Equestrian-Dash,代码行数:36,代码来源:PropertyHandler.java


注:本文中的org.bukkit.entity.Horse.setVariant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。