當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。