Java 类net.minecraft.world.gen.structure.ComponentVillage 实例源码

项目:RuneCraftery    文件:StructureVillagePieces.java   
private static ComponentVillage func_75083_a(ComponentVillageStartPiece p_75083_0_, StructureVillagePieceWeight p_75083_1_, List p_75083_2_, Random p_75083_3_, int p_75083_4_, int p_75083_5_, int p_75083_6_, int p_75083_7_, int p_75083_8_) {
   Class var9 = p_75083_1_.field_75090_a;
   Object var10 = null;
   if(var9 == ComponentVillageHouse4_Garden.class) {
      var10 = ComponentVillageHouse4_Garden.func_74912_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageChurch.class) {
      var10 = ComponentVillageChurch.func_74919_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageHouse1.class) {
      var10 = ComponentVillageHouse1.func_74898_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageWoodHut.class) {
      var10 = ComponentVillageWoodHut.func_74908_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageHall.class) {
      var10 = ComponentVillageHall.func_74906_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageField.class) {
      var10 = ComponentVillageField.func_74900_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageField2.class) {
      var10 = ComponentVillageField2.func_74902_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageHouse2.class) {
      var10 = ComponentVillageHouse2.func_74915_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   } else if(var9 == ComponentVillageHouse3.class) {
      var10 = ComponentVillageHouse3.func_74921_a(p_75083_0_, p_75083_2_, p_75083_3_, p_75083_4_, p_75083_5_, p_75083_6_, p_75083_7_, p_75083_8_);
   }

   return (ComponentVillage)var10;
}
项目:RuneCraftery    文件:StructureVillagePieces.java   
private static StructureComponent func_75077_d(ComponentVillageStartPiece p_75077_0_, List p_75077_1_, Random p_75077_2_, int p_75077_3_, int p_75077_4_, int p_75077_5_, int p_75077_6_, int p_75077_7_) {
   if(p_75077_7_ > 50) {
      return null;
   } else if(Math.abs(p_75077_3_ - p_75077_0_.func_74874_b().field_78897_a) <= 112 && Math.abs(p_75077_5_ - p_75077_0_.func_74874_b().field_78896_c) <= 112) {
      ComponentVillage var8 = func_75081_c(p_75077_0_, p_75077_1_, p_75077_2_, p_75077_3_, p_75077_4_, p_75077_5_, p_75077_6_, p_75077_7_ + 1);
      if(var8 != null) {
         int var9 = (var8.field_74887_e.field_78897_a + var8.field_74887_e.field_78893_d) / 2;
         int var10 = (var8.field_74887_e.field_78896_c + var8.field_74887_e.field_78892_f) / 2;
         int var11 = var8.field_74887_e.field_78893_d - var8.field_74887_e.field_78897_a;
         int var12 = var8.field_74887_e.field_78892_f - var8.field_74887_e.field_78896_c;
         int var13 = var11 > var12?var11:var12;
         if(p_75077_0_.func_74925_d().func_76940_a(var9, var10, var13 / 2 + 4, MapGenVillage.field_75055_e)) {
            p_75077_1_.add(var8);
            p_75077_0_.field_74932_i.add(var8);
            return var8;
         }
      }

      return null;
   } else {
      return null;
   }
}
项目:RuneCraftery    文件:StructureVillagePieces.java   
private static ComponentVillage func_75081_c(ComponentVillageStartPiece p_75081_0_, List p_75081_1_, Random p_75081_2_, int p_75081_3_, int p_75081_4_, int p_75081_5_, int p_75081_6_, int p_75081_7_) {
   int var8 = func_75079_a(p_75081_0_.field_74931_h);
   if(var8 <= 0) {
      return null;
   } else {
      int var9 = 0;

      while(var9 < 5) {
         ++var9;
         int var10 = p_75081_2_.nextInt(var8);
         Iterator var11 = p_75081_0_.field_74931_h.iterator();

         while(var11.hasNext()) {
            StructureVillagePieceWeight var12 = (StructureVillagePieceWeight)var11.next();
            var10 -= var12.field_75088_b;
            if(var10 < 0) {
               if(!var12.func_75085_a(p_75081_7_) || var12 == p_75081_0_.field_74926_d && p_75081_0_.field_74931_h.size() > 1) {
                  break;
               }

               ComponentVillage var13 = func_75083_a(p_75081_0_, var12, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_, p_75081_7_);
               if(var13 != null) {
                  ++var12.field_75089_c;
                  p_75081_0_.field_74926_d = var12;
                  if(!var12.func_75086_a()) {
                     p_75081_0_.field_74931_h.remove(var12);
                  }

                  return var13;
               }
            }
         }
      }

      StructureBoundingBox var14 = ComponentVillageTorch.func_74904_a(p_75081_0_, p_75081_1_, p_75081_2_, p_75081_3_, p_75081_4_, p_75081_5_, p_75081_6_);
      if(var14 != null) {
         return new ComponentVillageTorch(p_75081_0_, p_75081_7_, p_75081_2_, var14, p_75081_6_);
      } else {
         return null;
      }
   }
}