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();
}
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);
}
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();
}
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;
}
}
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();
}
}
Aggregations