Examples of EntityItem


Examples of net.minecraft.entity.item.EntityItem

        if (type == ItemRenderType.INVENTORY) {
            renderItemInInventory(itemstack, aspect, icon);
        } else if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
            renderItemInEquipped(itemstack, aspect, icon);
        } else {
            EntityItem entityItem = (EntityItem) data[1];
            if (entityItem.worldObj == null) {
                float angle = (Minecraft.getSystemTime() % 8000L) / 8000.0F * 360.0F;
                GL11.glPushMatrix();
                GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F);
                GL11.glTranslatef(-0.2F, -0.5F, 0.0F);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

  }

  static int handleNext = 0;

  public void addDrops(LivingDropsEvent event, ItemStack dropStack) {
    EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
    entityitem.delayBeforeCanPickup = 10;
    event.drops.add(entityitem);
  }
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

  @SubscribeEvent
  public void onEntityLivingDrops(LivingDropsEvent event) {
    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
      if (event.entityLiving instanceof EntityEnderman && event.entityLiving.dimension == ConfigHandler.endDimensionID && Math.random() <= 1D / 32D)
        event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7)));

      if (event.entityLiving instanceof EntityPigZombie && event.entityLiving.dimension == ConfigHandler.netherDimensionID && Math.random() <= 1D / 16D)
        event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 6)));
    }
  }
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

        ItemStack itemstack = enchanter.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float) random.nextGaussian() * f3;
            entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float) random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

        ItemStack itemstack = funnel.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float) random.nextGaussian() * f3;
            entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float) random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

        ItemStack itemstack = repairer.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            int dmg;
            if (Loader.isModLoaded("TConstruct")) {
              if (TinkersConstructCompat.isTConstructTool(itemstack)) {
                dmg = TinkersConstructCompat.getDamage(itemstack);
              } else
                dmg = itemstack.getItemDamage();
            } else
              dmg = itemstack.getItemDamage();
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, dmg));
            float f3 = 0.05F;
            entityitem.motionX = (float) random.nextGaussian() * f3;
            entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float) random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

        ItemStack itemstack = analyzer.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float) random.nextGaussian() * f3;
            entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float) random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

      }
    }
        List list=world.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x + xs, y + ys, z + zs, x + xe, y + ye, z + ze));
        for(Object entity:list)
        {
            EntityItem item=(EntityItem)entity;
            item.setPosition(player.posX,player.posY+1,player.posZ);
        }
  }
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

        ItemStack itemstack = mobMagnet.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float) random.nextGaussian() * f3;
            entityitem.motionY = (float) random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float) random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

Examples of net.minecraft.entity.item.EntityItem

            if (event.entityLiving.dimension == -1)
            {
                numberOfDrops = rand.nextInt((int) event.entityLiving.getMaxHealth() / 5 + event.lootingLevel);
                ItemStack leadIS = new ItemStack(ElectricExpansionItems.itemParts, Math.max(2, numberOfDrops), 10);
               
                event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, leadIS.copy()));
               
                if (rare)
                    event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ElectricExpansionItems.itemParts, 1, 7)));
            }
            else if (event.entityLiving.dimension == 1)
            {
                numberOfDrops = rand.nextInt((int) event.entityLiving.getMaxHealth() / 20 + event.lootingLevel);
                ItemStack silverIS = new ItemStack(ElectricExpansionItems.itemParts, Math.max(2, numberOfDrops), 11);
               
                event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, silverIS.copy()));
               
                if (rare)
                    event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ElectricExpansionItems.itemParts, 1, 7)));
            }
           
            if (rand.nextInt(50_000) <= event.entityLiving.getMaxHealth() * (numberOfDrops + (rare ? 9 : 0)))
            {
                event.entityLiving.worldObj.createExplosion(event.entityLiving, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, 3, false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.