本文整理汇总了Java中org.bukkit.entity.LivingEntity.remove方法的典型用法代码示例。如果您正苦于以下问题:Java LivingEntity.remove方法的具体用法?Java LivingEntity.remove怎么用?Java LivingEntity.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.LivingEntity
的用法示例。
在下文中一共展示了LivingEntity.remove方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: remove
import org.bukkit.entity.LivingEntity; //导入方法依赖的package包/类
public void remove(Player player)
{
BukkitTask bukkitTask = this.destroyTasks.get(player.getUniqueId());
if (bukkitTask != null)
bukkitTask.cancel();
LivingEntity[] livingEntities = this.balloons.get(player.getUniqueId());
if (livingEntities == null)
return;
this.balloons.remove(player.getUniqueId());
for (LivingEntity livingEntity : livingEntities)
livingEntity.remove();
}
示例2: despawnPet
import org.bukkit.entity.LivingEntity; //导入方法依赖的package包/类
public static void despawnPet(OfflinePlayer player) {
if (!InventoryManager.playerIsLoaded(player) || !PetManager.isEnabled()) {
return;
}
PlayerWrapper playerWrapper = InventoryManager.get(player);
Inventory inventory = playerWrapper.getInventory();
LivingEntity pet = playerWrapper.getPet();
ItemStack petItem = inventory.getItem(SLOT_PET);
if (pet == null) {
return;
}
if (petItem != null) {
PetManager.saveHealth(petItem, pet.getHealth());
inventory.setItem(SLOT_PET, petItem);
}
EffectUtils.playDespawnEffect(pet);
pet.remove();
playerWrapper.setPet(null);
}
示例3: clear
import org.bukkit.entity.LivingEntity; //导入方法依赖的package包/类
public void clear(@Nonnull World world) {
Preconditions.checkNotNull(world, "world");
// clear information about owned mobs in that world
for (Entry<LivingEntity, Player> livingEntityPlayerEntry : this.ownedMobs.entrySet()) {
LivingEntity entity = livingEntityPlayerEntry.getKey();
if (entity.getWorld().equals(world)) {
entity.remove();
}
}
}