Package pneumaticCraft.common.entity.living

Examples of pneumaticCraft.common.entity.living.EntityDrone


        LaserSource.render(f5);
    }

    @Override
    public void setLivingAnimations(EntityLivingBase entity, float par2, float par3, float partialTicks){
        EntityDrone drone = (EntityDrone)entity;
        float propRotation = drone.oldPropRotation + (drone.propRotation - drone.oldPropRotation) * partialTicks;
        Prop1Part1.rotateAngleY = propRotation;
        Prop1Part2.rotateAngleY = propRotation;
        Prop1Part3.rotateAngleY = propRotation;
        Prop2Part1.rotateAngleY = propRotation;
View Full Code Here


    public void registerIcons(IIconRegister par1IconRegister){}

    @Override
    public boolean onItemUse(ItemStack iStack, EntityPlayer player, World world, int x, int y, int z, int side, float vecX, float vecY, float vecZ){
        if(!world.isRemote) {
            EntityDrone drone = new EntityDrone(world, player);
            ForgeDirection dir = ForgeDirection.getOrientation(side);
            drone.setPosition(x + 0.5 + dir.offsetX, y + 0.5 + dir.offsetY, z + 0.5 + dir.offsetZ);
            world.spawnEntityInWorld(drone);

            NBTTagCompound stackTag = iStack.getTagCompound();
            NBTTagCompound entityTag = new NBTTagCompound();
            drone.writeEntityToNBT(entityTag);
            if(stackTag != null) {
                entityTag.setTag("widgets", stackTag.getTagList("widgets", 10).copy());
                entityTag.setFloat("currentAir", stackTag.getFloat("currentAir"));
                NBTTagCompound invTag = stackTag.getCompoundTag("Inventory");
                if(invTag != null) entityTag.setTag("Inventory", invTag.copy());
            }
            drone.readEntityFromNBT(entityTag);
            if(iStack.hasDisplayName()) drone.setCustomNameTag(iStack.getDisplayName());

            drone.naturallySpawned = false;
            drone.onSpawnWithEgg(null);
            iStack.stackSize--;
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.entity.living.EntityDrone

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.