本文整理匯總了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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}