当前位置: 首页>>代码示例>>Java>>正文


Java MapGenScatteredFeature类代码示例

本文整理汇总了Java中net.minecraft.world.gen.feature.MapGenScatteredFeature的典型用法代码示例。如果您正苦于以下问题:Java MapGenScatteredFeature类的具体用法?Java MapGenScatteredFeature怎么用?Java MapGenScatteredFeature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MapGenScatteredFeature类属于net.minecraft.world.gen.feature包,在下文中一共展示了MapGenScatteredFeature类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ChunkProviderFlat

import net.minecraft.world.gen.feature.MapGenScatteredFeature; //导入依赖的package包/类
public ChunkProviderFlat(World p_i2004_1_, long p_i2004_2_, boolean p_i2004_4_, String p_i2004_5_) {
   this.field_73163_a = p_i2004_1_;
   this.field_73161_b = new Random(p_i2004_2_);
   this.field_82699_e = FlatGeneratorInfo.func_82651_a(p_i2004_5_);
   if(p_i2004_4_) {
      Map var6 = this.field_82699_e.func_82644_b();
      if(var6.containsKey("village")) {
         Map var7 = (Map)var6.get("village");
         if(!var7.containsKey("size")) {
            var7.put("size", "1");
         }

         this.field_82696_f.add(new MapGenVillage(var7));
      }

      if(var6.containsKey("biome_1")) {
         this.field_82696_f.add(new MapGenScatteredFeature((Map)var6.get("biome_1")));
      }

      if(var6.containsKey("mineshaft")) {
         this.field_82696_f.add(new MapGenMineshaft((Map)var6.get("mineshaft")));
      }

      if(var6.containsKey("stronghold")) {
         this.field_82696_f.add(new MapGenStronghold((Map)var6.get("stronghold")));
      }
   }

   this.field_82697_g = this.field_82699_e.func_82644_b().containsKey("decoration");
   if(this.field_82699_e.func_82644_b().containsKey("lake")) {
      this.field_82703_i = new WorldGenLakes(Block.field_71943_B.field_71990_ca);
   }

   if(this.field_82699_e.func_82644_b().containsKey("lava_lake")) {
      this.field_82701_j = new WorldGenLakes(Block.field_71938_D.field_71990_ca);
   }

   this.field_82702_h = this.field_82699_e.func_82644_b().containsKey("dungeon");
   Iterator var9 = this.field_82699_e.func_82650_c().iterator();

   while(var9.hasNext()) {
      FlatLayerInfo var10 = (FlatLayerInfo)var9.next();

      for(int var8 = var10.func_82656_d(); var8 < var10.func_82656_d() + var10.func_82657_a(); ++var8) {
         this.field_82700_c[var8] = (byte)(var10.func_82659_b() & 255);
         this.field_82698_d[var8] = (byte)var10.func_82658_c();
      }
   }

}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:51,代码来源:ChunkProviderFlat.java

示例2: ChunkProviderFlat

import net.minecraft.world.gen.feature.MapGenScatteredFeature; //导入依赖的package包/类
public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str)
{
    this.worldObj = par1World;
    this.random = new Random(par2);
    this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str);

    if (par4)
    {
        Map map = this.flatWorldGenInfo.getWorldFeatures();

        if (map.containsKey("village"))
        {
            Map map1 = (Map)map.get("village");

            if (!map1.containsKey("size"))
            {
                map1.put("size", "1");
            }

            this.structureGenerators.add(new MapGenVillage(map1));
        }

        if (map.containsKey("biome_1"))
        {
            this.structureGenerators.add(new MapGenScatteredFeature((Map)map.get("biome_1")));
        }

        if (map.containsKey("mineshaft"))
        {
            this.structureGenerators.add(new MapGenMineshaft((Map)map.get("mineshaft")));
        }

        if (map.containsKey("stronghold"))
        {
            this.structureGenerators.add(new MapGenStronghold((Map)map.get("stronghold")));
        }
    }

    this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration");

    if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake"))
    {
        this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID);
    }

    if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake"))
    {
        this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID);
    }

    this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon");
    Iterator iterator = this.flatWorldGenInfo.getFlatLayers().iterator();

    while (iterator.hasNext())
    {
        FlatLayerInfo flatlayerinfo = (FlatLayerInfo)iterator.next();

        for (int j = flatlayerinfo.getMinY(); j < flatlayerinfo.getMinY() + flatlayerinfo.getLayerCount(); ++j)
        {
            this.cachedBlockIDs[j] = (byte)(flatlayerinfo.getFillBlock() & 255);
            this.cachedBlockMetadata[j] = (byte)flatlayerinfo.getFillBlockMeta();
        }
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:65,代码来源:ChunkProviderFlat.java


注:本文中的net.minecraft.world.gen.feature.MapGenScatteredFeature类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。