本文整理汇总了Java中org.bukkit.entity.Monster.remove方法的典型用法代码示例。如果您正苦于以下问题:Java Monster.remove方法的具体用法?Java Monster.remove怎么用?Java Monster.remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.entity.Monster
的用法示例。
在下文中一共展示了Monster.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: playerDies
import org.bukkit.entity.Monster; //导入方法依赖的package包/类
@EventHandler (priority = EventPriority.NORMAL)
public void playerDies(PlayerDeathEvent event) {
Player p = event.getEntity();
boolean playerRemoved = _players.remove(p);
if (playerRemoved && _players.size() == 0 && _started) {
EventActivator activator = new EventActivator(this);
activator.run();
if (_blockRestore != null) {
_blockRestore.run();
}
for (Monster m : _monstersEntity) {
m.remove();
}
_monstersContainer.clear();
_started = false;
}
}
示例2: resetToInitialState
import org.bukkit.entity.Monster; //导入方法依赖的package包/类
public void resetToInitialState() {
for (Monster m : _spawnedMonsters) {
m.remove();
}
org.bukkit.block.Block b = _world.getBlockAt(_locations);
b.setType(Material.AIR);
_blockBroken = true;
}
示例3: clearRemainingMonsters
import org.bukkit.entity.Monster; //导入方法依赖的package包/类
public void clearRemainingMonsters() {
for (Monster m : _monsterSpawned) {
m.remove();
}
_monsterSpawned.clear();
}
示例4: onCleanup
import org.bukkit.entity.Monster; //导入方法依赖的package包/类
@EventHandler
public void onCleanup(ChunkUnloadEvent e) {
for(Entity entity : e.getChunk().getEntities()) {
if(entity instanceof Item) {
Item item = (Item) entity;
item.remove();
} else if(entity instanceof Monster) {
Monster monster = (Monster) entity;
monster.remove();
} else if(entity instanceof ExperienceOrb) {
ExperienceOrb orb = (ExperienceOrb) entity;
orb.remove();
}
}
}