本文整理了Java中org.bukkit.entity.Entity.remove()
方法的一些代码示例,展示了Entity.remove()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.remove()
方法的具体详情如下:
包路径:org.bukkit.entity.Entity
类名称:Entity
方法名:remove
[英]Mark the entity's removal.
[中]标记实体的删除。
代码示例来源:origin: EngineHub/WorldEdit
@Override
public boolean remove() {
org.bukkit.entity.Entity entity = entityRef.get();
if (entity != null) {
entity.remove();
return entity.isDead();
} else {
return true;
}
}
代码示例来源:origin: elBukkit/MagicPlugin
@Override
public void finishEffects() {
super.finishEffects();
if (entity != null) {
if (plugin != null) {
entity.removeMetadata("notarget", plugin);
}
entity.remove();
entity = null;
}
}
}
代码示例来源:origin: GlowstoneMC/Glowstone
.send(sender, CommandUtils.getName(entity));
} else {
entity.remove();
new LocalizedStringImpl("kill.done", commandMessages.getResourceBundle())
.send(sender, CommandUtils.getName(entity));
living.damage(Double.MAX_VALUE, EntityDamageEvent.DamageCause.VOID);
} else {
entity.remove();
代码示例来源:origin: GlowstoneMC/Glowstone
((GlowItem) entity).getItemStack().getAmount()
+ clone.getAmount());
entity.remove();
setItemStack(clone);
代码示例来源:origin: bergerkiller/BKCommonLib
@Override
public void remove() {
base.remove();
}
代码示例来源:origin: bergerkiller/BKCommonLib
public void remove() {
entity.remove();
}
代码示例来源:origin: EngineHub/CommandHelper
@Override
public void remove() {
e.remove();
}
代码示例来源:origin: elBukkit/MagicPlugin
public void onShutdown() {
for (Mage mobMage : mobMages.values()) {
Entity entity = mobMage.getEntity();
if (entity != null) {
entity.remove();
}
}
mobMages.clear();
}
代码示例来源:origin: elBukkit/MagicPlugin
@Override
public void reset(CastContext context)
{
Entity mount = this.mount;
super.reset(context);
item = null;
if (mount != null && !mountTarget) {
mount.remove();
}
}
代码示例来源:origin: bitquest/bitquest
public void removeAllEntities() {
World w = Bukkit.getWorld("world");
List<Entity> entities = w.getEntities();
int entitiesremoved = 0;
for (Entity entity : entities) {
entity.remove();
entitiesremoved = entitiesremoved + 1;
}
System.out.println("Killed " + entitiesremoved + " entities");
}
public int killAllVillagersInWorld(World w) {
代码示例来源:origin: garbagemule/MobArena
private void unmount(Player p) {
Entity v = p.getVehicle();
if (v != null) {
monsterManager.removeMount(v);
v.eject();
v.remove();
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
private List<Entity> getJunkTravellers() {
// spawn an entity
Entity orb = junkLoc.getWorld().spawnEntity(junkLoc, EntityType.EXPERIENCE_ORB);
List<Entity> ents = orb.getNearbyEntities(4.0, 4.0, 4.0);
orb.remove();
return ents;
}
代码示例来源:origin: elBukkit/MagicPlugin
@Override
public SpellResult perform(CastContext context)
{
Entity entity = context.getTargetEntity();
if (ignoreInvalid && !entity.isValid()) {
return SpellResult.NO_TARGET;
}
context.registerModified(entity);
entity.remove();
return SpellResult.CAST;
}
代码示例来源:origin: eccentricdevotion/TARDIS
private List<Entity> getJunkTravellers() {
// spawn an entity
Entity orb = vortexJunkLoc.getWorld().spawnEntity(vortexJunkLoc, EntityType.EXPERIENCE_ORB);
List<Entity> ents = orb.getNearbyEntities(4.0d, 4.0d, 4.0d);
orb.remove();
return ents;
}
代码示例来源:origin: eccentricdevotion/TARDIS
public List<Entity> getJunkTravellers(Location loc) {
// spawn an entity
Entity orb = loc.getWorld().spawnEntity(loc, EntityType.EXPERIENCE_ORB);
List<Entity> ents = orb.getNearbyEntities(16.0d, 16.0d, 16.0d);
orb.remove();
return ents;
}
代码示例来源:origin: garbagemule/MobArena
private void removeDeadMonsters() {
List<Entity> tmp = new ArrayList<Entity>(monsterManager.getMonsters());
for (Entity e : tmp) {
if (e == null) {
continue;
}
if (e.isDead() || !region.contains(e.getLocation())) {
monsterManager.remove(e);
e.remove();
}
}
}
代码示例来源:origin: SkyWars/SkyWars
protected void clearEntities(World arenaWorld, SkyBlockLocation clearingMin, SkyBlockLocation clearingMax) {
SkyBlockLocation halfDistance = new SkyBlockLocation((clearingMax.x - clearingMin.x) / 2, (clearingMax.y - clearingMin.y) / 2, (clearingMax.z - clearingMin.z) / 2, null);
Location center = clearingMin.add(halfDistance).toLocationWithWorldObj(arenaWorld);
for (Entity entity : CrossVersion.getNearbyEntities(center, halfDistance.x, halfDistance.y, halfDistance.z)) {
entity.remove();
}
}
代码示例来源:origin: SkyWars/SkyWars
/**
* Supports Bukkit earlier than Spigot Bukkit-1.8.4
*/
public static Collection<Entity> getNearbyEntities(Location location, double x, double y, double z) {
World world = location.getWorld();
try {
return world.getNearbyEntities(location, x, y, z);
} catch (NoSuchMethodError ignored) {
Entity entity = world.spawnEntity(location, EntityType.EXPERIENCE_ORB);
Collection<Entity> result = entity.getNearbyEntities(x, y, z);
entity.remove();
return result;
}
}
代码示例来源:origin: eccentricdevotion/TARDIS
private List<Entity> getJunkTravellers() {
// spawn an entity
Entity orb = dd.getLocation().getWorld().spawnEntity(dd.getLocation(), EntityType.EXPERIENCE_ORB);
List<Entity> ents = orb.getNearbyEntities(1.0, 1.0, 1.0);
orb.remove();
return ents;
}
代码示例来源:origin: gvlfm78/BukkitOldCombatMechanics
/**
* This is to cancel dragging the player closer when you reel in
*/
@EventHandler(priority = EventPriority.HIGHEST)
private void onReelIn(PlayerFishEvent e){
if(!isSettingEnabled("cancelDraggingIn") || e.getState() != PlayerFishEvent.State.CAUGHT_ENTITY) return;
hookEntityFeature.apply(e).remove(); //Nuke the bobber and don't do anything else
e.setCancelled(true);
}
内容来源于网络,如有侵权,请联系作者删除!