本文整理匯總了Java中org.bukkit.entity.ArmorStand.getNearbyEntities方法的典型用法代碼示例。如果您正苦於以下問題:Java ArmorStand.getNearbyEntities方法的具體用法?Java ArmorStand.getNearbyEntities怎麽用?Java ArmorStand.getNearbyEntities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.entity.ArmorStand
的用法示例。
在下文中一共展示了ArmorStand.getNearbyEntities方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onBlockBreak
import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBreak(BlockBreakEvent event)
{
if(event.isCancelled()) return;
if(Survival.allowedBlocks.contains(event.getBlock().getType()))
{
ArmorStand drop = dropSeat(event.getBlock(), (Stairs)event.getBlock().getState().getData());
for(Entity e : drop.getNearbyEntities(0.5, 0.5, 0.5))
{
if(e != null && e instanceof ArmorStand && e.getCustomName() == "Chair")
e.remove();
}
drop.remove();
}
}
示例2: checkChair
import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
private List<ArmorStand> checkChair(ArmorStand drop)
{
List<ArmorStand> drops = new ArrayList<ArmorStand>();
// Check for already existing chair items.
for(Entity e : drop.getNearbyEntities(0.5, 0.5, 0.5))
{
if(e != null && e instanceof ArmorStand && e.getCustomName() == "Chair")
{
if(e.getPassengers().isEmpty())
e.remove();
else
drops.add(drop);
}
}
if(!drops.isEmpty())
return drops;
return null;
}
示例3: getTextureEntity
import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public ArmorStand getTextureEntity(ArmorStand s) {
for (Entity ent : s.getNearbyEntities(0.5, 0.5, 0.5)) {
if (ent.getCustomName().equals("CustomBlock")) {
return (ArmorStand) ent;
}
}
return null;
}
示例4: getNearbyEntities
import org.bukkit.entity.ArmorStand; //導入方法依賴的package包/類
public static List getNearbyEntities(Block b, double radius)
{
ArmorStand hologram = getArmorStand(b);
return hologram.getNearbyEntities(radius, 1.0D, radius);
}