當前位置: 首頁>>代碼示例>>Java>>正文


Java ArmorStand.setSmall方法代碼示例

本文整理匯總了Java中org.bukkit.entity.ArmorStand.setSmall方法的典型用法代碼示例。如果您正苦於以下問題:Java ArmorStand.setSmall方法的具體用法?Java ArmorStand.setSmall怎麽用?Java ArmorStand.setSmall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.entity.ArmorStand的用法示例。


在下文中一共展示了ArmorStand.setSmall方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: play

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
@Override
public void play(PAUser u) {
    if (isInCooldown(u, getName())) return;

    final ArmorStand as = (ArmorStand) spawnEntity(u.getLoc(), EntityType.ARMOR_STAND);
    as.setGravity(false);
    as.setSmall(true);
    as.setVisible(false);
    as.setHelmet(new ItemStack(Material.SEA_LANTERN));
    as.setPassenger(u.getPlayer());

    as.teleport(as.getLocation().add(0, 5, 0));

    bt = plugin.getServer().getScheduler().runTaskTimer(plugin, ()-> {
        as.teleport(as.getLocation().add(0, 0.2, 0));

        if (count <= 0) {
            remove(u, as);
            bt.cancel();
            return;
        }
        count--;
    }, 0, 20);
}
 
開發者ID:cadox8,項目名稱:PA,代碼行數:25,代碼來源:AntiGravity.java

示例2: makeFloatingText

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public static ArmorStand makeFloatingText(String name, Location loc, double xzOffset, double yMin, double yMax, double durationSec) {
    loc.add(-xzOffset / 2 + (Math.random() * (xzOffset)), (Math.random() * (yMax - yMin)) + yMin, -xzOffset / 2 + (Math.random() * (xzOffset)));
    final ArmorStand as = (ArmorStand) REntities.createLivingEntity(CustomArmorStand.class, loc);
    as.setVisible(false);
    as.setSmall(true);
    as.setMarker(true);
    as.setGravity(false);
    as.setArms(false);
    as.setBasePlate(false);
    as.setCanPickupItems(false);
    as.setCustomName(name);
    as.setCustomNameVisible(true);
    as.setRemoveWhenFarAway(false);
    RScheduler.schedule(SakiCore.plugin, new Runnable() {
        public void run() {
            if (as != null && as.isValid())
                as.remove();
        }
    }, RTicks.seconds(durationSec));
    return as;
}
 
開發者ID:edasaki,項目名稱:ZentrelaCore,代碼行數:22,代碼來源:RTags.java

示例3: makeStand

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public static ArmorStand makeStand(String name, Location loc, boolean marker) {
    ArmorStand as = (ArmorStand) REntities.createLivingEntity(CustomArmorStand.class, loc);
    as.setVisible(false);
    as.setSmall(true);
    if (marker)
        as.setMarker(true);
    as.setGravity(false);
    as.setArms(false);
    as.setBasePlate(false);
    as.setCanPickupItems(false);
    as.setCustomName(name);
    as.setCustomNameVisible(true);
    as.setRemoveWhenFarAway(false);
    return as;
}
 
開發者ID:edasaki,項目名稱:ZentrelaCore,代碼行數:16,代碼來源:RTags.java

示例4: placeBlock

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public ArmorStand placeBlock(Location l) {
	ArmorStand block = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
	block.setSmall(true);
	block.setGravity(false);
	block.setCustomName("CustomBlock");
	block.setCustomNameVisible(false);
	block.setInvulnerable(true);
	block.setVisible(false);
	block.setMarker(true);
	block.setSilent(true);
	
	ItemStack a = new ItemStack(Material.LEATHER_BOOTS);
	a.setDurability((short) primary.getTexture());
	LeatherArmorMeta am = (LeatherArmorMeta) a.getItemMeta();
	am.setColor(primary.getColor());
	am.setUnbreakable(true);
	if (primary.isGlowing()) {
		am.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
	}
	a.setItemMeta(am);
	block.setHelmet(a);
	
	if (secondary != null) {
		ItemStack b = new ItemStack(Material.LEATHER_BOOTS);
		b.setDurability((short) secondary.getTexture());
		LeatherArmorMeta bm = (LeatherArmorMeta) b.getItemMeta();
		bm.setColor(secondary.getColor());
		bm.setUnbreakable(true);
		if (secondary.isGlowing()) {
			System.out.println("H");
			bm.addEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, 3, true);
		}
		b.setItemMeta(bm);
		block.getEquipment().setItemInMainHand(b);
	}
	
	return block;
}
 
開發者ID:GigaGamma,項目名稱:SuperiorCraft,代碼行數:39,代碼來源:CustomBlockTexture.java

示例5: onArmorSpawn

import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
@EventHandler
public void onArmorSpawn(CreatureSpawnEvent evt) {
    if (evt.getEntityType() != EntityType.ARMOR_STAND || placing == null)
        return;

    ArmorStand as = (ArmorStand) evt.getEntity();
    as.setArms(placing.isArms());
    as.setSmall(placing.isSmall());
    placing = null;
}
 
開發者ID:Kneesnap,項目名稱:Kineticraft,代碼行數:11,代碼來源:ItemArmorStand.java


注:本文中的org.bukkit.entity.ArmorStand.setSmall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。