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

项目:4Space-5    文件:PitMapGenStructure.java   
public boolean generateStructuresInChunk(World par1World, Random par2Random, int par3, int par4) {
    final int var5 = (par3 << 4) + 8;
    final int var6 = (par4 << 4) + 8;
    boolean var7 = false;
    final Iterator<?> var8 = this.structureMap.values().iterator();

    while (var8.hasNext()) {
        final StructureStart var9 = (StructureStart) var8.next();

        if (var9 != null && var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) {
            var9.generateStructure(par1World, par2Random, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15));
            var7 = true;
        }
    }
    return var7;
}
项目:NeptuneMod    文件:MixinMapGenStructure_Performance.java   
/**
 * @author jamierocks - 25th October 2016
 * @reason Prevent CME
 */
@Overwrite
public boolean generateStructure(World worldIn, Random randomIn, ChunkCoordIntPair chunkCoord) {
    this.initializeStructureData(worldIn);
    int i = (chunkCoord.chunkXPos << 4) + 8;
    int j = (chunkCoord.chunkZPos << 4) + 8;
    boolean flag = false;

    synchronized (this.structureMap) { // Neptune - prevent CME
        for (StructureStart structurestart : this.structureMap.values()) {
            if (structurestart.isSizeableStructure() && structurestart.func_175788_a(chunkCoord) && structurestart.getBoundingBox()
                    .intersectsWith(i, j, i + 15, j + 15)) {
                structurestart.generateStructure(worldIn, randomIn, new StructureBoundingBox(i, j, i + 15, j + 15));
                structurestart.func_175787_b(chunkCoord);
                flag = true;
                this.setStructureStart(structurestart.getChunkPosX(), structurestart.getChunkPosZ(), structurestart);
            }
        }
    }

    return flag;
}
项目:4Space-1.7    文件:MapGenBlazePitStructure.java   
public boolean generateStructuresInChunk(World par1World, Random par2Random, int par3, int par4) {
    final int var5 = (par3 << 4) + 8;
    final int var6 = (par4 << 4) + 8;
    boolean var7 = false;
    final Iterator<?> var8 = this.structureMap.values().iterator();

    while (var8.hasNext()) {
        final StructureStart var9 = (StructureStart) var8.next();

        if (var9 != null && var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) {
            var9.generateStructure(par1World, par2Random, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15));
            var7 = true;
        }
    }
    return var7;
}
项目:RuneCraftery    文件:MapGenStructure.java   
protected final void func_75037_a(World p_75037_1_, int p_75037_2_, int p_75037_3_, int p_75037_4_, int p_75037_5_, byte[] p_75037_6_) {
   this.func_143027_a(p_75037_1_);
   if(!this.field_75053_d.containsKey(Long.valueOf(ChunkCoordIntPair.func_77272_a(p_75037_2_, p_75037_3_)))) {
      this.field_75038_b.nextInt();

      try {
         if(this.func_75047_a(p_75037_2_, p_75037_3_)) {
            StructureStart var7 = this.func_75049_b(p_75037_2_, p_75037_3_);
            this.field_75053_d.put(Long.valueOf(ChunkCoordIntPair.func_77272_a(p_75037_2_, p_75037_3_)), var7);
            this.func_143026_a(p_75037_2_, p_75037_3_, var7);
         }

      } catch (Throwable var10) {
         CrashReport var8 = CrashReport.func_85055_a(var10, "Exception preparing structure feature");
         CrashReportCategory var9 = var8.func_85058_a("Feature being prepared");
         var9.func_71500_a("Is feature chunk", new CallableIsFeatureChunk(this, p_75037_2_, p_75037_3_));
         var9.func_71507_a("Chunk location", String.format("%d,%d", new Object[]{Integer.valueOf(p_75037_2_), Integer.valueOf(p_75037_3_)}));
         var9.func_71500_a("Chunk pos hash", new CallableChunkPosHash(this, p_75037_2_, p_75037_3_));
         var9.func_71500_a("Structure type", new CallableStructureType(this));
         throw new ReportedException(var8);
      }
   }
}
项目:RuneCraftery    文件:MapGenStructure.java   
public boolean func_75051_a(World p_75051_1_, Random p_75051_2_, int p_75051_3_, int p_75051_4_) {
   this.func_143027_a(p_75051_1_);
   int var5 = (p_75051_3_ << 4) + 8;
   int var6 = (p_75051_4_ << 4) + 8;
   boolean var7 = false;
   Iterator var8 = this.field_75053_d.values().iterator();

   while(var8.hasNext()) {
      StructureStart var9 = (StructureStart)var8.next();
      if(var9.func_75069_d() && var9.func_75071_a().func_78885_a(var5, var6, var5 + 15, var6 + 15)) {
         var9.func_75068_a(p_75051_1_, p_75051_2_, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15));
         var7 = true;
         this.func_143026_a(var9.func_143019_e(), var9.func_143018_f(), var9);
      }
   }

   return var7;
}
项目:RuneCraftery    文件:MapGenStructure.java   
protected StructureStart func_143028_c(int p_143028_1_, int p_143028_2_, int p_143028_3_) {
   Iterator var4 = this.field_75053_d.values().iterator();

   while(var4.hasNext()) {
      StructureStart var5 = (StructureStart)var4.next();
      if(var5.func_75069_d() && var5.func_75071_a().func_78885_a(p_143028_1_, p_143028_3_, p_143028_1_, p_143028_3_)) {
         Iterator var6 = var5.func_75073_b().iterator();

         while(var6.hasNext()) {
            StructureComponent var7 = (StructureComponent)var6.next();
            if(var7.func_74874_b().func_78890_b(p_143028_1_, p_143028_2_, p_143028_3_)) {
               return var5;
            }
         }
      }
   }

   return null;
}
项目:RuneCraftery    文件:MapGenStructure.java   
private void func_143027_a(World p_143027_1_) {
   if(this.field_143029_e == null) {
      this.field_143029_e = (MapGenStructureData)p_143027_1_.func_72943_a(MapGenStructureData.class, this.func_143025_a());
      if(this.field_143029_e == null) {
         this.field_143029_e = new MapGenStructureData(this.func_143025_a());
         p_143027_1_.func_72823_a(this.func_143025_a(), this.field_143029_e);
      } else {
         NBTTagCompound var2 = this.field_143029_e.func_143041_a();
         Iterator var3 = var2.func_74758_c().iterator();

         while(var3.hasNext()) {
            NBTBase var4 = (NBTBase)var3.next();
            if(var4.func_74732_a() == 10) {
               NBTTagCompound var5 = (NBTTagCompound)var4;
               if(var5.func_74764_b("ChunkX") && var5.func_74764_b("ChunkZ")) {
                  int var6 = var5.func_74762_e("ChunkX");
                  int var7 = var5.func_74762_e("ChunkZ");
                  StructureStart var8 = MapGenStructureIO.func_143035_a(var5, p_143027_1_);
                  this.field_75053_d.put(Long.valueOf(ChunkCoordIntPair.func_77272_a(var6, var7)), var8);
               }
            }
         }
      }
   }

}
项目:CustomOreGen    文件:MapGenOreDistribution.java   
protected StructureStart getStructureStart(int chunkX, int chunkZ)
{
    int blockX = chunkX << 4;
    int blockZ = chunkZ << 4;
    int count = this.frequency.getMax(this.world, blockX, blockZ) >= 1.0F ? 
            this.frequency.getIntValue(super.rand, this.world, blockX, blockZ) : 1;
    StructureGroup group = new StructureGroup(chunkX, chunkZ, count);
    group.newerGroup = null;
    group.olderGroup = this.newestGroup;

    if (this.newestGroup == null)
    {
    }
    else
    {
        this.newestGroup.newerGroup = group;
    }

    this.newestGroup = group;
    return group;
}
项目:4Space-5    文件:PitMapGenStructure.java   
@Override
protected void recursiveGenerate(World world, int xChunkCoord, int zChunkCoord, int origXChunkCoord, int origZChunkCoord, Block[] blocks, byte[] metadata) {
    this.rand.nextInt();

    if (this.canSpawnStructureAtCoords(xChunkCoord, zChunkCoord)) {
        final StructureStart var7 = this.getStructureStart(xChunkCoord, zChunkCoord);
        this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(xChunkCoord, zChunkCoord)), var7);
    }
}
项目:4Space-1.7    文件:MapGenBlazePitStructure.java   
@Override
protected void recursiveGenerate(World world, int xChunkCoord, int zChunkCoord, int origXChunkCoord, int origZChunkCoord, Block[] blocks, byte[] metadata) {
    this.rand.nextInt();

    if (this.canSpawnStructureAtCoords(xChunkCoord, zChunkCoord)) {
        final StructureStart var7 = this.getStructureStart(xChunkCoord, zChunkCoord);
        this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(xChunkCoord, zChunkCoord)), var7);
    }
}
项目:AbyssalCraft    文件:MapGenAbyStronghold.java   
/**
 * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this
 * structure generator.
 */
//  @Override
//  @SuppressWarnings({ "rawtypes", "unchecked" })
//  protected List getCoordList()
//  {
//      ArrayList var1 = new ArrayList();
//      ChunkPos[] var2 = structureCoords;
//      int var3 = var2.length;
//
//      for (int var4 = 0; var4 < var3; ++var4)
//      {
//          ChunkPos var5 = var2[var4];
//
//          if (var5 != null)
//              var1.add(var5.getCenterBlock(64));
//      }
//
//      return var1;
//  }

@Override
protected StructureStart getStructureStart(int par1, int par2)
{
    MapGenAbyStronghold.Start start;

    for (start = new MapGenAbyStronghold.Start(world, rand, par1, par2); start.getComponents().isEmpty() || ((StructureAbyStrongholdPieces.Stairs2)start.getComponents().get(0)).strongholdPortalRoom == null; start = new MapGenAbyStronghold.Start(world, rand, par1, par2))
        ;

    return start;
}
项目:RuneCraftery    文件:MapGenStronghold.java   
protected StructureStart func_75049_b(int p_75049_1_, int p_75049_2_) {
   StructureStrongholdStart var3;
   for(var3 = new StructureStrongholdStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_); var3.func_75073_b().isEmpty() || ((ComponentStrongholdStairs2)var3.func_75073_b().get(0)).field_75025_b == null; var3 = new StructureStrongholdStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_)) {
      ;
   }

   return var3;
}
项目:RuneCraftery    文件:MapGenScatteredFeature.java   
public boolean func_143030_a(int p_143030_1_, int p_143030_2_, int p_143030_3_) {
   StructureStart var4 = this.func_143028_c(p_143030_1_, p_143030_2_, p_143030_3_);
   if(var4 != null && var4 instanceof StructureScatteredFeatureStart && !var4.field_75075_a.isEmpty()) {
      StructureComponent var5 = (StructureComponent)var4.field_75075_a.getFirst();
      return var5 instanceof ComponentScatteredFeatureSwampHut;
   } else {
      return false;
   }
}
项目:RuneCraftery    文件:MapGenScatteredFeature.java   
public boolean func_143030_a(int par1, int par2, int par3)
{
    StructureStart structurestart = this.func_143028_c(par1, par2, par3);

    if (structurestart != null && structurestart instanceof StructureScatteredFeatureStart && !structurestart.components.isEmpty())
    {
        StructureComponent structurecomponent = (StructureComponent)structurestart.components.getFirst();
        return structurecomponent instanceof ComponentScatteredFeatureSwampHut;
    }
    else
    {
        return false;
    }
}
项目:BetterNutritionMod    文件:MapGenScatteredFeature.java   
public boolean func_143030_a(int par1, int par2, int par3)
{
    StructureStart structurestart = this.func_143028_c(par1, par2, par3);

    if (structurestart != null && structurestart instanceof StructureScatteredFeatureStart && !structurestart.components.isEmpty())
    {
        StructureComponent structurecomponent = (StructureComponent)structurestart.components.getFirst();
        return structurecomponent instanceof ComponentScatteredFeatureSwampHut;
    }
    else
    {
        return false;
    }
}
项目:4Space-5    文件:MapGenVillageMoon.java   
@Override
protected StructureStart getStructureStart(int par1, int par2)
{
    FMLLog.info("Generating Moon Village at x" + par1 * 16 + " z" + par2 * 16);
    return new StructureVillageStartMoon(this.worldObj, this.rand, par1, par2, this.terrainType);
}
项目:4Space-5    文件:PitMapGen.java   
@Override
protected StructureStart getStructureStart(int par1, int par2) {
    return new PitStructureStart(settings, this.worldObj, this.rand, par1, par2);
}
项目:4Space-5    文件:VillageMapGen.java   
@Override
protected StructureStart getStructureStart(int par1, int par2) {
    FMLLog.info("Generating " + settings.planetName + " Village at x" + par1 * 16 + " z" + par2 * 16);
    return new VillageStructureStart(this.worldObj, this.rand, par1, par2, this.terrainType);
}
项目:CrystalMod    文件:MapGenCrystexiumSpike.java   
@Override
protected StructureStart getStructureStart(int chunkX, int chunkZ) {
    return new Start(this.world, this.rand, chunkX, chunkZ);
}
项目:CrystalMod    文件:MapGenFusionTemple.java   
@Override
protected StructureStart getStructureStart(int chunkX, int chunkZ) {
    return new Start(this.world, this.rand, chunkX, chunkZ);
}
项目:LightningCraft    文件:MapGenUnderworldWaterTemple.java   
/** Get the start of the structure */
@Override
protected StructureStart getStructureStart(int x, int z) {
    return new MapGenUnderworldWaterTemple.Start(this.worldObj, this.rand, x, z);
}
项目:LightningCraft    文件:MapGenUnderworldRampart.java   
/** Get the start of the structure */
@Override
protected StructureStart getStructureStart(int x, int z) {
    return new MapGenUnderworldRampart.Start(this.worldObj, this.rand, x, z);
}
项目:LightningCraft    文件:MapGenUnderworldTower.java   
/** Get the start of the structure */
@Override
protected StructureStart getStructureStart(int x, int z) {
    return new MapGenUnderworldTower.Start(this.worldObj, this.rand, x, z);
}
项目:AntiMatterMod    文件:TestMapGen.java   
@Override
protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) {
    return new StructureTestStart(this.worldObj, this.rand, p_75049_1_,p_75049_2_);
}
项目:AntiMatterMod    文件:TiamatMapGen.java   
@Override
protected StructureStart getStructureStart(int chunkX, int chunkZ) {
    return new StructureTiamatStart(this.worldObj, this.rand, chunkX, chunkZ);
}
项目:4Space-1.7    文件:MapGenBlazeNest.java   
@Override
protected StructureStart getStructureStart(int par1, int par2) {
    return new StructureBlazePitStart(this.worldObj, this.rand, par1, par2);
}
项目:4Space-1.7    文件:MapGenVillageVenus.java   
@Override
protected StructureStart getStructureStart(int par1, int par2) {
    return new StructureVillageStartVenus(this.worldObj, this.rand, par1, par2, this.terrainType);
}
项目:AbyssalCraft    文件:MapGenOmothol.java   
@Override
protected StructureStart getStructureStart(int chunkX, int chunkZ)
{
    return new MapGenOmothol.Start(world, rand, chunkX, chunkZ, terrainType);
}
项目:AbyssalCraft    文件:MapGenAbyStronghold.java   
private void checkBiomes()
{
    initializeStructureData(world);
    int i = 0;

    for (StructureStart structurestart : structureMap.values())
        if (i < structureCoords.length)
            structureCoords[i++] = new ChunkPos(structurestart.getChunkPosX(), structurestart.getChunkPosZ());

    Random random = new Random();
    random.setSeed(world.getSeed());
    double d1 = random.nextDouble() * Math.PI * 2.0D;
    int j = 0;
    int k = 0;
    int l = structureMap.size();

    if (l < structureCoords.length)
        for (int i1 = 0; i1 < structureCoords.length; ++i1)
        {
            double d0 = 4.0D * field_82671_h + field_82671_h * j * 6.0D + (random.nextDouble() - 0.5D) * field_82671_h * 2.5D;
            int j1 = (int)Math.round(Math.cos(d1) * d0);
            int k1 = (int)Math.round(Math.sin(d1) * d0);
            BlockPos blockpos = world.getBiomeProvider().findBiomePosition((j1 << 4) + 8, (k1 << 4) + 8, 112, allowedBiomes, random);

            if (blockpos != null)
            {
                j1 = blockpos.getX() >> 4;
            k1 = blockpos.getZ() >> 4;
            }

            if (i1 >= l)
                structureCoords[i1] = new ChunkPos(j1, k1);

            d1 += Math.PI * 2D / field_82672_i;
            ++k;

            if (k == field_82672_i)
            {
                ++j;
                k = 0;
                field_82672_i += 2 * field_82672_i / (j + 1);
                field_82672_i = Math.min(field_82672_i, structureCoords.length - i1);
                d1 += random.nextDouble() * Math.PI * 2.0D;
            }
        }
}
项目:AbyssalCraft    文件:MapGenDreadlandsMine.java   
@Override
protected StructureStart getStructureStart(int par1, int par2)
{
    return new StructureDreadlandsMineStart(world, rand, par1, par2);
}
项目:RuneCraftery    文件:MapGenStructureIO.java   
public static String func_143033_a(StructureStart p_143033_0_) {
   return (String)field_143038_b.get(p_143033_0_.getClass());
}
项目:RuneCraftery    文件:MapGenStructure.java   
private void func_143026_a(int p_143026_1_, int p_143026_2_, StructureStart p_143026_3_) {
   this.field_143029_e.func_143043_a(p_143026_3_.func_143021_a(p_143026_1_, p_143026_2_), p_143026_1_, p_143026_2_);
   this.field_143029_e.func_76185_a();
}
项目:RuneCraftery    文件:MapGenMineshaft.java   
protected StructureStart func_75049_b(int p_75049_1_, int p_75049_2_) {
   return new StructureMineshaftStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_);
}
项目:RuneCraftery    文件:MapGenNetherBridge.java   
protected StructureStart func_75049_b(int p_75049_1_, int p_75049_2_) {
   return new StructureNetherBridgeStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_);
}
项目:RuneCraftery    文件:MapGenVillage.java   
protected StructureStart func_75049_b(int p_75049_1_, int p_75049_2_) {
   return new StructureVillageStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_, this.field_75054_f);
}
项目:RuneCraftery    文件:MapGenScatteredFeature.java   
protected StructureStart func_75049_b(int p_75049_1_, int p_75049_2_) {
   return new StructureScatteredFeatureStart(this.field_75039_c, this.field_75038_b, p_75049_1_, p_75049_2_);
}
项目:RuneCraftery    文件:MapGenScatteredFeature.java   
protected StructureStart getStructureStart(int par1, int par2)
{
    return new StructureScatteredFeatureStart(this.worldObj, this.rand, par1, par2);
}
项目:BetterNutritionMod    文件:MapGenScatteredFeature.java   
protected StructureStart getStructureStart(int par1, int par2)
{
    return new StructureScatteredFeatureStart(this.worldObj, this.rand, par1, par2);
}
项目:4-Space-Legacy    文件:SCVenusMapGenBlazeNest.java   
@Override
protected StructureStart getStructureStart(int par1, int par2)
{
    return new SCVenusStructureBlazePitStart(this.worldObj, this.rand, par1, par2);
}
项目:4-Space-Legacy    文件:SCVenusMapGenVillage.java   
@Override
protected StructureStart getStructureStart(int par1, int par2)
{
    FMLLog.info("Generating Venus Village at x" + par1 * 16 + " z" + par2 * 16);
    return new SCVenusStructureVillageStart(this.worldObj, this.rand, par1, par2, this.terrainType);
}