当前位置: 首页>>代码示例>>Java>>正文


Java Entity.getBukkitEntity方法代码示例

本文整理汇总了Java中net.minecraft.server.Entity.getBukkitEntity方法的典型用法代码示例。如果您正苦于以下问题:Java Entity.getBukkitEntity方法的具体用法?Java Entity.getBukkitEntity怎么用?Java Entity.getBukkitEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.server.Entity的用法示例。


在下文中一共展示了Entity.getBukkitEntity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: callEntityDamageEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
private static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, Map<DamageModifier, Double> modifiers, Map<DamageModifier, Function<? super Double, Double>> modifierFunctions) {
    EntityDamageEvent event;
    if (damager != null) {
        event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, modifiers, modifierFunctions);
    } else {
        event = new EntityDamageEvent(damagee.getBukkitEntity(), cause, modifiers, modifierFunctions);
    }

    callEvent(event);

    if (!event.isCancelled()) {
        event.getEntity().setLastDamageCause(event);
    }

    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:17,代码来源:CraftEventFactory.java

示例2: callBlockIgniteEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static BlockIgniteEvent callBlockIgniteEvent(World world, int x, int y, int z, Entity igniter) {
    org.bukkit.World bukkitWorld = world.getWorld();
    org.bukkit.entity.Entity bukkitIgniter = igniter.getBukkitEntity();
    IgniteCause cause;
    switch (bukkitIgniter.getType()) {
    case ENDER_CRYSTAL:
        cause = IgniteCause.ENDER_CRYSTAL;
        break;
    case LIGHTNING:
        cause = IgniteCause.LIGHTNING;
        break;
    case SMALL_FIREBALL:
    case FIREBALL:
        cause = IgniteCause.FIREBALL;
        break;
    default:
        cause = IgniteCause.FLINT_AND_STEEL;
    }

    BlockIgniteEvent event = new BlockIgniteEvent(bukkitWorld.getBlockAt(x, y, z), cause, bukkitIgniter);
    world.getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:24,代码来源:CraftEventFactory.java

示例3: callEntityDamageEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
/**
 * EntityDamage(ByEntityEvent)
 */
public static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, double damage) {
    EntityDamageEvent event;
    if (damager != null) {
        event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, damage);
    } else {
        event = new EntityDamageEvent(damagee.getBukkitEntity(), cause, damage);
    }

    callEvent(event);

    if (!event.isCancelled()) {
        event.getEntity().setLastDamageCause(event);
    }

    return event;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:20,代码来源:CraftEventFactory.java

示例4: callEntityDamageEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
/**
 * EntityDamage(ByEntityEvent)
 */
public static EntityDamageEvent callEntityDamageEvent(Entity damager, Entity damagee, DamageCause cause, int damage) {
    EntityDamageEvent event;
    if (damager != null) {
        event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, damage);
    } else {
        event = new EntityDamageEvent(damagee.getBukkitEntity(), cause, damage);
    }

    callEvent(event);

    if (!event.isCancelled()) {
        event.getEntity().setLastDamageCause(event);
    }

    return event;
}
 
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:20,代码来源:CraftEventFactory.java

示例5: callEntityBreakDoorEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static EntityBreakDoorEvent callEntityBreakDoorEvent(Entity entity, int x, int y, int z) {
    org.bukkit.entity.Entity entity1 = entity.getBukkitEntity();
    Block block = entity1.getWorld().getBlockAt(x, y, z);

    EntityBreakDoorEvent event = new EntityBreakDoorEvent((LivingEntity) entity1, block);
    entity1.getServer().getPluginManager().callEvent(event);

    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:10,代码来源:CraftEventFactory.java

示例6: callSpawnerSpawnEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
/**
 * Mob spawner event
 */
public static SpawnerSpawnEvent callSpawnerSpawnEvent(Entity spawnee, int spawnerX, int spawnerY, int spawnerZ) {
    org.bukkit.craftbukkit.entity.CraftEntity entity = spawnee.getBukkitEntity();
    BlockState state = entity.getWorld().getBlockAt(spawnerX, spawnerY, spawnerZ).getState();

    if (!(state instanceof CreatureSpawner)) {
        state = null;
    }

    SpawnerSpawnEvent event = new SpawnerSpawnEvent(entity, (CreatureSpawner) state);
    entity.getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:16,代码来源:CraftEventFactory.java

示例7: callPigZapEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static PigZapEvent callPigZapEvent(Entity pig, Entity lightning, Entity pigzombie) {
    PigZapEvent event = new PigZapEvent((Pig) pig.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), (PigZombie) pigzombie.getBukkitEntity());
    pig.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例8: callHorseJumpEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static HorseJumpEvent callHorseJumpEvent(Entity horse, float power) {
    HorseJumpEvent event = new HorseJumpEvent((Horse) horse.getBukkitEntity(), power);
    horse.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例9: callCreeperPowerEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static CreeperPowerEvent callCreeperPowerEvent(Entity creeper, Entity lightning, CreeperPowerEvent.PowerCause cause) {
    CreeperPowerEvent event = new CreeperPowerEvent((Creeper) creeper.getBukkitEntity(), (LightningStrike) lightning.getBukkitEntity(), cause);
    creeper.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例10: callEntityTargetEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static EntityTargetEvent callEntityTargetEvent(Entity entity, Entity target, EntityTargetEvent.TargetReason reason) {
    EntityTargetEvent event = new EntityTargetEvent(entity.getBukkitEntity(), target == null ? null : target.getBukkitEntity(), reason);
    entity.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例11: callEntityTargetLivingEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static EntityTargetLivingEntityEvent callEntityTargetLivingEvent(Entity entity, EntityLiving target, EntityTargetEvent.TargetReason reason) {
    EntityTargetLivingEntityEvent event = new EntityTargetLivingEntityEvent(entity.getBukkitEntity(), (LivingEntity) target.getBukkitEntity(), reason);
    entity.getBukkitEntity().getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例12: callProjectileLaunchEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) {
    Projectile bukkitEntity = (Projectile) entity.getBukkitEntity();
    ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:7,代码来源:CraftEventFactory.java

示例13: callProjectileHitEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static ProjectileHitEvent callProjectileHitEvent(Entity entity) {
    ProjectileHitEvent event = new ProjectileHitEvent((Projectile) entity.getBukkitEntity());
    entity.world.getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java

示例14: callExpBottleEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static ExpBottleEvent callExpBottleEvent(Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:7,代码来源:CraftEventFactory.java

示例15: callPlayerLeashEntityEvent

import net.minecraft.server.Entity; //导入方法依赖的package包/类
public static PlayerLeashEntityEvent callPlayerLeashEntityEvent(EntityInsentient entity, Entity leashHolder, EntityHuman player) {
    PlayerLeashEntityEvent event = new PlayerLeashEntityEvent(entity.getBukkitEntity(), leashHolder.getBukkitEntity(), (Player) player.getBukkitEntity());
    entity.world.getServer().getPluginManager().callEvent(event);
    return event;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CraftEventFactory.java


注:本文中的net.minecraft.server.Entity.getBukkitEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。