Search in sources :

Example 71 with EntityItem

use of net.minecraft.entity.item.EntityItem in project ArsMagica2 by Mithion.

the class AMGuiHelper method tick.

public void tick() {
    if (dummyItem == null) {
        dummyItem = new EntityItem(Minecraft.getMinecraft().theWorld);
    } else {
        dummyItem.age++;
    //dummyItem.rotationYaw += 0.1f;
    }
    for (int i = 0; i < this.flashTimers.length; ++i) {
        if (this.flashTimers[i] > 0)
            this.flashTimers[i]--;
    }
    for (int i = 0; i < this.blackoutTimers.length; ++i) {
        if (this.blackoutTimers[i] > 0) {
            this.blackoutTimers[i]--;
            if (this.blackoutTimers[i] == 0) {
                flashArmorPiece(i);
            }
        } else {
            this.blackoutTimersMax[i] = 0;
        }
    }
    flashCounter++;
    if (flashCounter > 20)
        flashCounter = 0;
    if (magicXPBarShowTimer > 0) {
        magicXPBarShowTimer--;
        if (magicXPBarShowTimer < 20)
            magicXPBarAlpha -= 0.05f;
    }
    if (runCompendiumTicker) {
        fastUITicker++;
        if (fastUITicker > 40) {
            fastUITicker = 0;
            slowUITicker++;
        }
    }
    slowFlashAlpha = Math.abs((flashCounter / 20f) - 0.5f) * 2;
    fastFlashAlpha = Math.abs((flashCounter % 5 / 5f) - 0.5f) * 2;
    lastmillis = millis;
    millis = System.currentTimeMillis();
}
Also used : EntityItem(net.minecraft.entity.item.EntityItem)

Example 72 with EntityItem

use of net.minecraft.entity.item.EntityItem in project ArsMagica2 by Mithion.

the class SpellHelper method dropHead_do.

private void dropHead_do(World world, double x, double y, double z, int type) {
    EntityItem item = new EntityItem(world);
    ItemStack stack = new ItemStack(Items.skull, 1, type);
    item.setEntityItemStack(stack);
    item.setPosition(x, y, z);
    world.spawnEntityInWorld(item);
}
Also used : ItemStack(net.minecraft.item.ItemStack) EntityItem(net.minecraft.entity.item.EntityItem)

Example 73 with EntityItem

use of net.minecraft.entity.item.EntityItem in project ConvenientAdditions by Necr0.

the class EntityMobCatcher method dropItem.

public void dropItem(Vec3d where) {
    world.spawnEntity(new EntityItem(world, where.xCoord, where.yCoord, where.zCoord, mobCatcherItem));
    setDead();
}
Also used : EntityItem(net.minecraft.entity.item.EntityItem)

Example 74 with EntityItem

use of net.minecraft.entity.item.EntityItem in project OpenModularTurrets by OpenModularTurretsTeam.

the class DisposableTurretProjectile method onUpdate.

@Override
public void onUpdate() {
    super.onUpdate();
    if (!spawned && !this.getEntityWorld().isRemote) {
        itemBound = new EntityItem(this.getEntityWorld(), posX, posY - 0.2F, posZ, ammo);
        itemBound.motionX = this.motionX;
        itemBound.motionY = this.motionY + this.gravity;
        itemBound.motionZ = this.motionZ;
        itemBound.setPickupDelay(10000);
        spawnEntity(this.getEntityWorld(), itemBound);
        spawned = true;
    }
}
Also used : EntityItem(net.minecraft.entity.item.EntityItem)

Example 75 with EntityItem

use of net.minecraft.entity.item.EntityItem in project ArsMagica2 by Mithion.

the class TileEntityCraftingAltar method deactivate.

public void deactivate() {
    if (!worldObj.isRemote) {
        this.setCrafting(false);
        for (ItemStack stack : allAddedItems) {
            if (stack.getItem() == ItemsCommonProxy.essence && stack.getItemDamage() > ItemsCommonProxy.essence.META_MAX)
                continue;
            EntityItem eItem = new EntityItem(worldObj);
            eItem.setPosition(xCoord, yCoord - 1, zCoord);
            eItem.setEntityItemStack(stack);
            worldObj.spawnEntityInWorld(eItem);
        }
        allAddedItems.clear();
    }
}
Also used : ItemStack(net.minecraft.item.ItemStack) EntityItem(net.minecraft.entity.item.EntityItem)

Aggregations

EntityItem (net.minecraft.entity.item.EntityItem)284 ItemStack (net.minecraft.item.ItemStack)178 TileEntity (net.minecraft.tileentity.TileEntity)45 EntityPlayer (net.minecraft.entity.player.EntityPlayer)36 Entity (net.minecraft.entity.Entity)26 ArrayList (java.util.ArrayList)19 BlockPos (net.minecraft.util.math.BlockPos)19 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)18 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)16 World (net.minecraft.world.World)16 Random (java.util.Random)15 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)14 Item (net.minecraft.item.Item)13 IInventory (net.minecraft.inventory.IInventory)12 AxisAlignedBB (net.minecraft.util.AxisAlignedBB)12 List (java.util.List)11 Block (net.minecraft.block.Block)11 EntityLivingBase (net.minecraft.entity.EntityLivingBase)11 IBlockState (net.minecraft.block.state.IBlockState)10 SubscribeEvent (cpw.mods.fml.common.eventhandler.SubscribeEvent)6