Package pneumaticCraft.common.entity.item

Examples of pneumaticCraft.common.entity.item.EntityItemSpecial


        if(!event.entity.worldObj.isRemote && !event.entity.isDead) {
            if(event.entity instanceof EntityItem) {
                ItemStack stack = ((EntityItem)event.entity).getEntityItem();
                if(!(event.entity instanceof EntityItemSpecial)) {
                    if(stack.getItem() == net.minecraft.init.Items.iron_ingot || stack.getItem() == Item.getItemFromBlock(net.minecraft.init.Blocks.iron_block)) {
                        EntityItemSpecial seedEntity = new EntityItemSpecial(event.world, stack.copy());
                        seedEntity.delayBeforeCanPickup = ((EntityItem)event.entity).delayBeforeCanPickup;
                        seedEntity.copyDataFrom(event.entity, true);
                        event.setCanceled(true);
                        stack.stackSize = 0; //Tinkers Construct fix, because tinkers invokes EntityItem#onCollideWithPlayer(EntityItem) without checking if the item entity is dead.
                        event.world.spawnEntityInWorld(seedEntity);
                    }
                }
View Full Code Here


    @Override
    public void executeFullGrownEffect(World world, int x, int y, int z, Random rand){
        if(!world.isRemote) {
            ItemStack seed = new ItemStack(Itemss.plasticPlant, 1, ItemPlasticPlants.HELIUM_PLANT_DAMAGE);
            EntityItem plant = new EntityItemSpecial(world, x + 0.5D, y + 0.2D, z + 0.5D, seed);
            plant.motionX = rand.nextFloat() - 0.5F;
            plant.motionY = -1.0F;
            plant.motionZ = rand.nextFloat() - 0.5F;
            plant.lifespan = 300;
            ItemPlasticPlants.markInactive(plant);
            world.spawnEntityInWorld(plant);
            plant.playSound("mob.newsound.chickenplop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);

            world.setBlockMetadataWithNotify(x, y, z, 4, 3);
        }
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.entity.item.EntityItemSpecial

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.