Package net.minecraft.entity

Examples of net.minecraft.entity.Entity


          int shouldBeMountedId = buffer.readInt();
          if (this.riddenByEntity == null)
          {
             if (shouldBeMountedId > -1)
             {
               Entity e = FMLClientHandler.instance().getWorldClient().getEntityByID(shouldBeMountedId);
               if (e != null)
               {
                 if (e.dimension != this.dimension)
                 {
                   if (e instanceof EntityPlayer)
                   {
                     e = WorldUtil.forceRespawnClient(this.dimension, e.worldObj.difficultySetting.getDifficultyId(), e.worldObj.getWorldInfo().getTerrainType().getWorldTypeName(), ((EntityPlayerMP)e).theItemInWorldManager.getGameType().getID());
                     e.mountEntity(this);
                   }
                 }
                 else
                   e.mountEntity(this);
               }
             }
          }
          else if (this.riddenByEntity.getEntityId() != shouldBeMountedId)
          {
            if (shouldBeMountedId == -1)
            {
              this.riddenByEntity.mountEntity(null);
            }
            else
            {
              Entity e = FMLClientHandler.instance().getWorldClient().getEntityByID(shouldBeMountedId);
                if (e != null)
                {
                  if (e.dimension != this.dimension)
                  {
                    if (e instanceof EntityPlayer)
                    {
                      e = WorldUtil.forceRespawnClient(this.dimension, e.worldObj.difficultySetting.getDifficultyId(), e.worldObj.getWorldInfo().getTerrainType().getWorldTypeName(), ((EntityPlayerMP)e).theItemInWorldManager.getGameType().getID());
                      e.mountEntity(this);
                    }
                  }
                  else
                    e.mountEntity(this);
                }
            }
          }
        }
    }
View Full Code Here


            {
                if (this.ticks >= 40)
                {
                    if (!this.worldObj.isRemote)
                    {
                        Entity e = this.riddenByEntity;
                        e.mountEntity(null);
                        e.mountEntity(this);
                        if (ConfigManagerCore.enableDebug) System.out.println("Remounting player in rocket.");
                    }

                    this.setWaitForPlayer(false);
                    this.motionY = -0.5D;
View Full Code Here

        if (var15 != null && !var15.isEmpty())
        {
            for (int var52 = 0; var52 < var15.size(); ++var52)
            {
                final Entity var17 = (Entity) var15.get(var52);

                if (var17 != this.riddenByEntity)
                {
                    var17.applyEntityCollision(this);
                }
            }
        }

        if (this.timeUntilLaunch == 0 && this.launchPhase == EnumLaunchPhase.IGNITED.ordinal())
View Full Code Here

      String str1 = "";
      String str2 = "";
      String str3 = "";
      String str4 = "";
      Render renderEntity = null;
      Entity entity = null;
      float Xmargin = 0;
     
      if (telemeter != null && telemeter.clientData.length >= 3)
      {
          if (telemeter.clientClass != null)
          {
            if (telemeter.clientClass == screen.telemetryLastClass && (telemeter.clientClass != EntityPlayerMP.class || telemeter.clientName.equals(screen.telemetryLastName)))
            {
              //Used cached data from last time if possible
              entity = screen.telemetryLastEntity;
              renderEntity = screen.telemetryLastRender;
              strName = screen.telemetryLastName;
            }
            else
            {             
              //Create an entity to render, based on class, and get its name
              entity = null;
             
              if (telemeter.clientClass == EntityPlayerMP.class)
              {
                strName = telemeter.clientName;
                entity = new EntityOtherPlayerMP(screen.driver.getWorldObj(), telemeter.clientGameProfile);
                renderEntity = (Render) RenderManager.instance.entityRenderMap.get(EntityPlayer.class);
              }
              else
              {
                try {
                  entity = (Entity) telemeter.clientClass.getConstructor(World.class).newInstance(screen.driver.getWorldObj());
                } catch (Exception ex) { }
                if (entity != null) strName = entity.getCommandSenderName();
                renderEntity = (Render) RenderManager.instance.entityRenderMap.get(telemeter.clientClass);
              }             
            }
          }
         
View Full Code Here

        }
        MovingObjectPosition hitMOP = MusePlayerUtils.raytraceEntities(world, playerClicking, false, 8);

        if (hitMOP != null && hitMOP.entityHit instanceof IShearable) {
            IShearable target = (IShearable) hitMOP.entityHit;
            Entity entity = hitMOP.entityHit;
            if (target.isShearable(stack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
                ArrayList<ItemStack> drops = target.onSheared(stack, entity.worldObj, (int) entity.posX, (int) entity.posY,
                        (int) entity.posZ,
                        EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));

                Random rand = new Random();
                for (ItemStack drop : drops) {
                    EntityItem ent = entity.entityDropItem(drop, 1.0F);
                    ent.motionY += rand.nextFloat() * 0.05F;
                    ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                    ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                }
                ElectricItemUtils.drainPlayerEnergy(playerClicking, ModuleManager.computeModularProperty(stack, SHEARING_ENERGY_CONSUMPTION));
View Full Code Here

                this.kill();
            }
        } else if (hitMOP.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && hitMOP.entityHit != this.shootingEntity) {
            if (hitMOP.entityHit instanceof IShearable) {
                IShearable target = (IShearable) hitMOP.entityHit;
                Entity entity = hitMOP.entityHit;
                if (target.isShearable(this.shootingItem, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
                    ArrayList<ItemStack> drops = target.onSheared(this.shootingItem, entity.worldObj,
                            (int) entity.posX, (int) entity.posY, (int) entity.posZ,
                            EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, this.shootingItem));

                    Random rand = new Random();
                    for (ItemStack drop : drops) {
                        EntityItem ent = entity.entityDropItem(drop, 1.0F);
                        ent.motionY += rand.nextFloat() * 0.05F;
                        ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                        ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                    }
                }
View Full Code Here

    @SideOnly(Side.CLIENT)
    public void handleClient(Side side, EntityPlayer player)
    {
        Minecraft mc = Minecraft.getMinecraft();

        Entity ent = mc.theWorld.getEntityByID(entityID1);
        Entity ent1 = mc.theWorld.getEntityByID(entityID2);

        if(ent instanceof EntityLivingBase && ent1 instanceof EntityLivingBase)
        {
            if(ent instanceof EntityPlayer)
            {
View Full Code Here

    public Entity spawnPlane(World world, double x, double y, double z, ItemStack stack)
    {
      DriveableData data = getPlaneData(stack, world);
      if(data != null)
      {
        Entity entity = new EntityPlane(world, x, y, z, type, data);
        if(!world.isRemote)
          {
        world.spawnEntityInWorld(entity);
          }
        return entity;
View Full Code Here

        List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.getBoundingBox(i, k, i2, j, l1, j2));
        Vec3 vec3 = Vec3.createVectorHelper(explosionX, explosionY, explosionZ);

        for (int k2 = 0; k2 < list.size(); ++k2)
        {
            Entity entity = (Entity)list.get(k2);
            double d7 = entity.getDistance(explosionX, explosionY, explosionZ) / explosionSize;

            if (d7 <= 1.0D)
            {
                d0 = entity.posX - explosionX;
                d1 = entity.posY + entity.getEyeHeight() - explosionY;
                d2 = entity.posZ - explosionZ;
                double d8 = MathHelper.sqrt_double(d0 * d0 + d1 * d1 + d2 * d2);

                if (d8 != 0.0D)
                {
                    d0 /= d8;
                    d1 /= d8;
                    d2 /= d8;
                    double d9 = worldObj.getBlockDensity(vec3, entity.boundingBox);
                    double d10 = (1.0D - d7) * d9;
                    entity.attackEntityFrom(player == null || type == null ? DamageSource.setExplosionSource(this) : new EntityDamageSourceGun(type.shortName, entity, player, type, false), ((int)((d10 * d10 + d10) / 2.0D * 8.0D * explosionSize + 1.0D)));
                    double d11 = EnchantmentProtection.func_92092_a(entity, d10);
                    entity.motionX += d0 * d11;
                    entity.motionY += d1 * d11;
                    entity.motionZ += d2 * d11;

 
View Full Code Here

                  }
                }
              }
              else
              {
                Entity entity = (Entity)obj;
                if(entity != player && !entity.isDead && (entity instanceof EntityLivingBase || entity instanceof EntityAAGun))
                {
                  MovingObjectPosition mop = entity.boundingBox.calculateIntercept(data.lastMeleePositions[k].toVec3(), nextPosInWorldCoords.toVec3());
                  if(mop != null)
                  {
View Full Code Here

TOP

Related Classes of net.minecraft.entity.Entity

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.