Java 类org.bukkit.entity.ThrownExpBottle 实例源码

项目:Uranium    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:Uranium    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:ThermosRebased    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:ThermosRebased    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:Thermos-Bukkit    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:Thermos-Bukkit    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:Thermos    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:Thermos    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:KCauldron    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:KCauldron    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:CauldronGit    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:CauldronGit    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:CauldronGit    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:CauldronGit    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:Cauldron-Old    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:Cauldron-Old    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:Cauldron-Reloaded    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:Cauldron-Reloaded    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:FFoKC    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:FFoKC    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:CraftBukkit    文件:CraftEventFactory.java   
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;
}
项目:Craftbukkit    文件:CraftEventFactory.java   
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;
}
项目:Almura-Server    文件:CraftEventFactory.java   
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;
}
项目:Tweakkit-Server    文件:CraftEventFactory.java   
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;
}
项目:Dexoria-Hub    文件:PaintGrenade.java   
@SuppressWarnings("deprecation")
@EventHandler
public void onClick(PlayerInteractEvent e) {
    if(e.getPlayer().getItemInHand().getType() != null){
        if(e.getPlayer().getItemInHand().getType() == Material.EXP_BOTTLE){

            e.setCancelled(true);
            e.getPlayer().updateInventory();
            if(DexCore.getCurrencySystem().hasEnoughGC(e.getPlayer().getUniqueId().toString(), 30)){
                DexCore.getCurrencySystem().removeGC(e.getPlayer().getUniqueId().toString(), 30);
            }else{
                e.getPlayer().sendMessage(ChatColor.BLUE + "Gadget > " + ChatColor.GRAY + "You don't have enough points!");
                return;
            }


            if(!cooldowntask.containsKey(e.getPlayer().getName())){
                final Player p = e.getPlayer();
                p.launchProjectile(ThrownExpBottle.class, 
                        p.getLocation().getDirection().multiply(1));

                timeleft.put(p.getName(), 10.0);
                cooldowntask.put(p.getName(), new BukkitRunnable() {

                    @Override
                    public void run() {
                        if(timeleft.get(p.getName()) == 0.0){
                            cooldowntask.remove(p.getName());
                            timeleft.remove(p.getName());
                            cancel();
                        }else{
                            timeleft.put(p.getName(), timeleft.get(p.getName()) - 0.5);
                        }
                    }
                });

                cooldowntask.get(p.getName()).runTaskTimer(Hub.instance, 10, 10);

            }else{
                e.getPlayer().sendMessage(ChatColor.BLUE + "Gadget > " + ChatColor.GRAY + " You must wait for " + ChatColor.RED + timeleft.get(e.getPlayer().getName()) + ChatColor.GRAY + " seconds.");
            }
        }
    }
}
项目:Cauldron    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:Cauldron    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:Cauldron    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:Cauldron    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:Cauldron    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:Cauldron    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:Cauldron    文件:CraftLivingEntity.java   
@SuppressWarnings("unchecked")
public <T extends Projectile> T launchProjectile(Class<? extends T> projectile, Vector velocity) {
    net.minecraft.world.World world = ((CraftWorld) getWorld()).getHandle();
    net.minecraft.entity.Entity launch = null;

    if (Snowball.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntitySnowball(world, getHandle());
    } else if (Egg.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityEgg(world, getHandle());
    } else if (EnderPearl.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityEnderPearl(world, getHandle());
    } else if (Arrow.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityArrow(world, getHandle(), 1);
    } else if (ThrownPotion.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.projectile.EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
    } else if (ThrownExpBottle.class.isAssignableFrom(projectile)) {
        launch = new net.minecraft.entity.item.EntityExpBottle(world, getHandle());
    } else if (Fish.class.isAssignableFrom(projectile) && getHandle() instanceof net.minecraft.entity.player.EntityPlayer) {
        launch = new net.minecraft.entity.projectile.EntityFishHook(world, (net.minecraft.entity.player.EntityPlayer) getHandle());
    } else if (Fireball.class.isAssignableFrom(projectile)) {
        Location location = getEyeLocation();
        Vector direction = location.getDirection().multiply(10);

        if (SmallFireball.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else if (WitherSkull.class.isAssignableFrom(projectile)) {
            launch = new net.minecraft.entity.projectile.EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        } else {
            launch = new net.minecraft.entity.projectile.EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ());
        }

        ((net.minecraft.entity.projectile.EntityFireball) launch).projectileSource = this;
        launch.setLocationAndAngles(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
    }

    Validate.notNull(launch, "Projectile not supported");

    if (velocity != null) {
        ((T) launch.getBukkitEntity()).setVelocity(velocity);
    }

    world.spawnEntityInWorld(launch);
    return (T) launch.getBukkitEntity();
}
项目:Cauldron    文件:CraftEventFactory.java   
public static ExpBottleEvent callExpBottleEvent(net.minecraft.entity.Entity entity, int exp) {
    ThrownExpBottle bottle = (ThrownExpBottle) entity.getBukkitEntity();
    ExpBottleEvent event = new ExpBottleEvent(bottle, exp);
    Bukkit.getPluginManager().callEvent(event);
    return event;
}
项目:Almura-API    文件:ExpBottleEvent.java   
public ExpBottleEvent(final ThrownExpBottle bottle, final int exp) {
    super(bottle);
    this.exp = exp;
}
项目:Almura-API    文件:ExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) entity;
}
项目:Pore    文件:PoreExpBottleEvent.java   
public PoreExpBottleEvent(EntityEvent handle) {
    super(null, -1);
    this.handle = checkNotNull(handle, "handle");
    checkState(handle.getEntity() instanceof org.spongepowered.api.entity.projectile.ThrownExpBottle,
            "Bad entity type");
}
项目:Pore    文件:PoreExpBottleEvent.java   
@Override
public ThrownExpBottle getEntity() {
    return (ThrownExpBottle) PoreThrownExpBottle.of(this.getHandle().getEntity());
}
项目:BedrockAPI    文件:ExpBottleEvent.java   
public ExpBottleEvent(ThrownExpBottle bottle, int exp) {
       super(bottle);
}
项目:BedrockAPI    文件:ExpBottleEvent.java   
public ThrownExpBottle getEntity() {
    return null;
}
项目:SpigotSource    文件:CraftEventFactory.java   
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;
}