Java 类net.minecraft.entity.player.EnumStatus 实例源码

项目:CliffiesDecor    文件:EntityDecorCanopBoat.java   
/**
 * First layer of player interaction
 */
public boolean interactFirst(EntityPlayer par1EntityPlayer)
{
    if(par1EntityPlayer.isSneaking()==false)
    {
    if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
    {
        return true;
    }
    else
    {
        if (!this.worldObj.isRemote)
        {
            par1EntityPlayer.mountEntity(this);
        }

        return true;
    }
    }
    else
    {
        if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
        {
            return true;
        }
        else
        {
            //if (!this.worldObj.isRemote)
            {
                EnumStatus enumstatus = par1EntityPlayer.sleepInBedAt((int) this.posX, (int) this.posY+1, (int) this.posZ);
                this.sleepingTimer=50000;
                this.setSleepTime(50000);
                this.ridingPlayer=par1EntityPlayer;
            }

            return true;
        }
    }
}
项目:RuneCraftery    文件:EntityPlayerMP.java   
public EnumStatus func_71018_a(int p_71018_1_, int p_71018_2_, int p_71018_3_) {
   EnumStatus var4 = super.func_71018_a(p_71018_1_, p_71018_2_, p_71018_3_);
   if(var4 == EnumStatus.OK) {
      Packet17Sleep var5 = new Packet17Sleep(this, 0, p_71018_1_, p_71018_2_, p_71018_3_);
      this.func_71121_q().func_73039_n().func_72784_a(this, var5);
      this.field_71135_a.func_72569_a(this.field_70165_t, this.field_70163_u, this.field_70161_v, this.field_70177_z, this.field_70125_A);
      this.field_71135_a.func_72567_b(var5);
   }

   return var4;
}
项目:RuneCraftery    文件:EntityPlayer.java   
public EnumStatus func_71018_a(int p_71018_1_, int p_71018_2_, int p_71018_3_) {
   if(!this.field_70170_p.field_72995_K) {
      if(this.func_70608_bn() || !this.func_70089_S()) {
         return EnumStatus.OTHER_PROBLEM;
      }

      if(!this.field_70170_p.field_73011_w.func_76569_d()) {
         return EnumStatus.NOT_POSSIBLE_HERE;
      }

      if(this.field_70170_p.func_72935_r()) {
         return EnumStatus.NOT_POSSIBLE_NOW;
      }

      if(Math.abs(this.field_70165_t - (double)p_71018_1_) > 3.0D || Math.abs(this.field_70163_u - (double)p_71018_2_) > 2.0D || Math.abs(this.field_70161_v - (double)p_71018_3_) > 3.0D) {
         return EnumStatus.TOO_FAR_AWAY;
      }

      double var4 = 8.0D;
      double var6 = 5.0D;
      List var8 = this.field_70170_p.func_72872_a(EntityMob.class, AxisAlignedBB.func_72332_a().func_72299_a((double)p_71018_1_ - var4, (double)p_71018_2_ - var6, (double)p_71018_3_ - var4, (double)p_71018_1_ + var4, (double)p_71018_2_ + var6, (double)p_71018_3_ + var4));
      if(!var8.isEmpty()) {
         return EnumStatus.NOT_SAFE;
      }
   }

   if(this.func_70115_ae()) {
      this.func_70078_a((Entity)null);
   }

   this.func_70105_a(0.2F, 0.2F);
   this.field_70129_M = 0.2F;
   if(this.field_70170_p.func_72899_e(p_71018_1_, p_71018_2_, p_71018_3_)) {
      int var9 = this.field_70170_p.func_72805_g(p_71018_1_, p_71018_2_, p_71018_3_);
      int var5 = BlockBed.func_72217_d(var9);
      float var10 = 0.5F;
      float var7 = 0.5F;
      switch(var5) {
      case 0:
         var7 = 0.9F;
         break;
      case 1:
         var10 = 0.1F;
         break;
      case 2:
         var7 = 0.1F;
         break;
      case 3:
         var10 = 0.9F;
      }

      this.func_71013_b(var5);
      this.func_70107_b((double)((float)p_71018_1_ + var10), (double)((float)p_71018_2_ + 0.9375F), (double)((float)p_71018_3_ + var7));
   } else {
      this.func_70107_b((double)((float)p_71018_1_ + 0.5F), (double)((float)p_71018_2_ + 0.9375F), (double)((float)p_71018_3_ + 0.5F));
   }

   this.field_71083_bS = true;
   this.field_71076_b = 0;
   this.field_71081_bT = new ChunkCoordinates(p_71018_1_, p_71018_2_, p_71018_3_);
   this.field_70159_w = this.field_70179_y = this.field_70181_x = 0.0D;
   if(!this.field_70170_p.field_72995_K) {
      this.field_70170_p.func_72854_c();
   }

   return EnumStatus.OK;
}
项目:RuneCraftery    文件:BlockBed.java   
public boolean func_71903_a(World p_71903_1_, int p_71903_2_, int p_71903_3_, int p_71903_4_, EntityPlayer p_71903_5_, int p_71903_6_, float p_71903_7_, float p_71903_8_, float p_71903_9_) {
   if(p_71903_1_.field_72995_K) {
      return true;
   } else {
      int var10 = p_71903_1_.func_72805_g(p_71903_2_, p_71903_3_, p_71903_4_);
      if(!func_72229_a_(var10)) {
         int var11 = func_72217_d(var10);
         p_71903_2_ += field_72230_a[var11][0];
         p_71903_4_ += field_72230_a[var11][1];
         if(p_71903_1_.func_72798_a(p_71903_2_, p_71903_3_, p_71903_4_) != this.field_71990_ca) {
            return true;
         }

         var10 = p_71903_1_.func_72805_g(p_71903_2_, p_71903_3_, p_71903_4_);
      }

      if(p_71903_1_.field_73011_w.func_76567_e() && p_71903_1_.func_72807_a(p_71903_2_, p_71903_4_) != BiomeGenBase.field_76778_j) {
         if(func_72225_b_(var10)) {
            EntityPlayer var20 = null;
            Iterator var12 = p_71903_1_.field_73010_i.iterator();

            while(var12.hasNext()) {
               EntityPlayer var21 = (EntityPlayer)var12.next();
               if(var21.func_70608_bn()) {
                  ChunkCoordinates var14 = var21.field_71081_bT;
                  if(var14.field_71574_a == p_71903_2_ && var14.field_71572_b == p_71903_3_ && var14.field_71573_c == p_71903_4_) {
                     var20 = var21;
                  }
               }
            }

            if(var20 != null) {
               p_71903_5_.func_71035_c("tile.bed.occupied");
               return true;
            }

            func_72228_a(p_71903_1_, p_71903_2_, p_71903_3_, p_71903_4_, false);
         }

         EnumStatus var19 = p_71903_5_.func_71018_a(p_71903_2_, p_71903_3_, p_71903_4_);
         if(var19 == EnumStatus.OK) {
            func_72228_a(p_71903_1_, p_71903_2_, p_71903_3_, p_71903_4_, true);
            return true;
         } else {
            if(var19 == EnumStatus.NOT_POSSIBLE_NOW) {
               p_71903_5_.func_71035_c("tile.bed.noSleep");
            } else if(var19 == EnumStatus.NOT_SAFE) {
               p_71903_5_.func_71035_c("tile.bed.notSafe");
            }

            return true;
         }
      } else {
         double var18 = (double)p_71903_2_ + 0.5D;
         double var13 = (double)p_71903_3_ + 0.5D;
         double var15 = (double)p_71903_4_ + 0.5D;
         p_71903_1_.func_94571_i(p_71903_2_, p_71903_3_, p_71903_4_);
         int var17 = func_72217_d(var10);
         p_71903_2_ += field_72230_a[var17][0];
         p_71903_4_ += field_72230_a[var17][1];
         if(p_71903_1_.func_72798_a(p_71903_2_, p_71903_3_, p_71903_4_) == this.field_71990_ca) {
            p_71903_1_.func_94571_i(p_71903_2_, p_71903_3_, p_71903_4_);
            var18 = (var18 + (double)p_71903_2_ + 0.5D) / 2.0D;
            var13 = (var13 + (double)p_71903_3_ + 0.5D) / 2.0D;
            var15 = (var15 + (double)p_71903_4_ + 0.5D) / 2.0D;
         }

         p_71903_1_.func_72885_a((Entity)null, (double)((float)p_71903_2_ + 0.5F), (double)((float)p_71903_3_ + 0.5F), (double)((float)p_71903_4_ + 0.5F), 5.0F, true, true);
         return true;
      }
   }
}
项目:RuneCraftery    文件:EnumHelper.java   
public static EnumStatus addStatus(String name)
{
    return addEnum(EnumStatus.class, name);
}
项目:RuneCraftery    文件:EnumHelper.java   
public static EnumStatus addStatus(String name)
{
    return addEnum(EnumStatus.class, name);
}
项目:BetterNutritionMod    文件:EnumHelper.java   
public static EnumStatus addStatus(String name)
{
    return addEnum(EnumStatus.class, name);
}