Package net.minecraft.util

Examples of net.minecraft.util.EnumFacing


{

    @Override
    public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved)
    {
        EnumFacing facing = getFacing(par1World, par2, par3, par4);

        for (int i = 0; i < par5ItemStack.stackSize; i++)
        {
            // TODO entity registration and stuffs
            EntityLandmineFirework entityfireworkrocket = new EntityLandmineFirework(par1World, (double) par2, (double) par3, (double) par4, par5ItemStack, facing.ordinal()).setRider(i == 0 ? triggerer : null);
            par1World.spawnEntityInWorld(entityfireworkrocket);

            boolean shouldRun = true;
            if (triggerer instanceof EntityPlayer)
            {
View Full Code Here


    @Override
    public void executeLogic (World par1World, int par2, int par3, int par4, ItemStack par5ItemStack, Entity triggerer, boolean willBlockBeRemoved)
    {
        IProjectile entity = null;

        EnumFacing enumfacing = getFacing(par1World, par2, par3, par4);

        if (par5ItemStack.getItem() == Items.arrow)
        {
            entity = new EntityArrow(par1World, par2, par3, par4);
            ((EntityArrow) entity).canBePickedUp = 1;
        }
        else if (par5ItemStack.getItem() == Items.snowball)
        {
            entity = new EntitySnowball(par1World, par2, par3, par4);
        }
        else if (par5ItemStack.getItem() == Items.ender_pearl)
        {
            if (triggerer instanceof EntityLivingBase)
            {
                entity = new EntityEnderPearl(par1World, (EntityLivingBase) triggerer);
                ((EntityEnderPearl) entity).setPosition(par2, par3, par4);
            }
            else
            {
                entity = new EntityEnderPearl(par1World, par2, par3, par4);
            }
        }

        if (entity == null)
        {
            return;
        }

        entity.setThrowableHeading((double) enumfacing.getFrontOffsetX(), (double) ((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ(), 1.1F, 6.0F);
        par1World.spawnEntityInWorld((Entity) entity);
        par1World.playAuxSFX(1002, par2, par3, par4, 0);
    }
View Full Code Here

        if (this.arrayContainsEqualStack(stacks, new ItemStack(Items.fireworks)) && this.arrayContainsEqualStack(stacks, new ItemStack(Items.fire_charge)))
        {
            int index0 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fireworks));
            int index1 = this.arrayIndexOfStack(stacks, new ItemStack(Items.fire_charge));
            EnumFacing face = getFacing(par1World, par2, par3, par4);

            while (stacks.get(index0).stackSize > 0 && stacks.get(index1).stackSize > 0)
            {
                double d0 = par2 + (double) ((float) face.getFrontOffsetX() * 0.3F);
                double d1 = par3 + (double) ((float) face.getFrontOffsetX() * 0.3F);
                double d2 = par4 + (double) ((float) face.getFrontOffsetZ() * 0.3F);
                Random random = par1World.rand;
                double d3 = random.nextGaussian() * 0.05D + (double) face.getFrontOffsetX();
                double d4 = random.nextGaussian() * 0.05D + (double) face.getFrontOffsetY();
                double d5 = random.nextGaussian() * 0.05D + (double) face.getFrontOffsetZ();
                EntityFireball fireball = new EntityLargeFireball(par1World, d0, d1, d2, d3, d4, d5);
                par1World.spawnEntityInWorld(fireball);

                if (triggerer instanceof EntityLivingBase)
                {
View Full Code Here

     * particles.
     */
    @Override
    public ItemStack dispenseStack (IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    {
        EnumFacing enumfacing = BlockDispenser.func_149937_b(par1IBlockSource.getBlockMetadata());
        double d0 = par1IBlockSource.getX() + (double) enumfacing.getFrontOffsetX();
        double d1 = (double) ((float) par1IBlockSource.getYInt() + 0.2F);
        double d2 = par1IBlockSource.getZ() + (double) enumfacing.getFrontOffsetZ();
        EntityLiving entity = TitleIcon.activateSpawnEgg(par2ItemStack, par1IBlockSource.getWorld(), d0, d1, d2, 0);

        if (par2ItemStack.hasDisplayName())
        {
            ((EntityLiving) entity).setCustomNameTag(par2ItemStack.getDisplayName());
View Full Code Here

    {
        World world = dispenser.getWorld();
        // TODO getIPositionFromBlockSource
        IPosition iposition = BlockDispenser.func_149939_a(dispenser);
        // TODO getFacing
        EnumFacing enumfacing = BlockDispenser.func_149937_b(dispenser.getBlockMetadata());

        ItemStack arrowItem = stack.splitStack(1);

        ArrowEntity projectile = new ArrowEntity(world, iposition.getX(), iposition.getY(), iposition.getZ(), arrowItem);
        projectile.canBePickedUp = 1;
        projectile.setThrowableHeading((double) enumfacing.getFrontOffsetX(), (double) ((float) enumfacing.getFrontOffsetY() + 0.1F), (double) enumfacing.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a());
        world.spawnEntityInWorld(projectile);

        return stack;
    }
View Full Code Here

TOP

Related Classes of net.minecraft.util.EnumFacing

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.