Java 类net.minecraft.world.gen.feature.WorldGeneratorBonusChest 实例源码

项目:DecompiledMinecraft    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10);

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:DecompiledMinecraft    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10);

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:BaseClient    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10);

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:BaseClient    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(bonusChestContent, 10);

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:Backmemed    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest();

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:CustomWorldGen    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest();

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        BlockPos blockpos = this.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if (worldgeneratorbonuschest.generate(this, this.rand, blockpos))
        {
            break;
        }
    }
}
项目:justenoughdimensions    文件:WorldUtils.java   
public static void createBonusChest(World world)
{
    WorldInfo info = world.getWorldInfo();
    WorldGeneratorBonusChest gen = new WorldGeneratorBonusChest();

    for (int i = 0; i < 10; ++i)
    {
        int x = info.getSpawnX() + world.rand.nextInt(6) - world.rand.nextInt(6);
        int z = info.getSpawnZ() + world.rand.nextInt(6) - world.rand.nextInt(6);
        BlockPos pos = world.getTopSolidOrLiquidBlock(new BlockPos(x, 0, z)).up();

        if (gen.generate(world, world.rand, pos))
        {
            break;
        }
    }
}
项目:ClockworkPhase2    文件:WorldHandler.java   
/**
 * Creates the bonus chest in the specified world.
 */
protected void createBonusChest(World world)
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest();

    for (int i = 0; i < 10; ++i)
    {
        int j = world.getWorldInfo().getSpawnX() + world.rand.nextInt(6) - world.rand.nextInt(6);
        int k = world.getWorldInfo().getSpawnZ() + world.rand.nextInt(6) - world.rand.nextInt(6);
        BlockPos blockpos = world.getTopSolidOrLiquidBlock(new BlockPos(j, 0, k)).up();

        if(worldgeneratorbonuschest.generate(world, world.rand, blockpos))
        {
            break;
        }
    }
}
项目:Resilience-Client-Source    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest var1 = new WorldGeneratorBonusChest(bonusChestContent, 10);

    for (int var2 = 0; var2 < 10; ++var2)
    {
        int var3 = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int var4 = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int var5 = this.getTopSolidOrLiquidBlock(var3, var4) + 1;

        if (var1.generate(this, this.rand, var3, var5, var4))
        {
            break;
        }
    }
}
项目:Cauldron    文件:WorldServer.java   
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
项目:Cauldron    文件:WorldServer.java   
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
项目:RuneCraftery    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
项目:BetterNutritionMod    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest()
{
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i)
    {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k))
        {
            break;
        }
    }
}
项目:Geographicraft    文件:DimensionManager.java   
public void onCreateSpawn(WorldEvent.CreateSpawnPosition event) {
    WorldServer world = (WorldServer)(event.getWorld());
    if (ignore(world.getWorldType(),this.newSettings)) {
        return;
    }
    int dimension = world.provider.getDimension();
    if (!this.dimensionSettings.ccOnIn(dimension)) {
        if (!DimensionalSettingsRegistry.instance.useCCIn(dimension)) {
            return;
        }
    }// only change dimensions we're supposed to;
    onWorldLoad(event.getWorld());
    salvageSpawn(event.getWorld());
    if (event.getSettings().isBonusChestEnabled()) {
        Random rand = new Random(world.getSeed());
        WorldGeneratorBonusChest worldgeneratorbonuschest =new WorldGeneratorBonusChest();

        for (int i = 0; i < 100; ++i){
            int j = world.getWorldInfo().getSpawnX() + rand.nextInt(6+i/10) - rand.nextInt(6+i/10);
            int k = world.getWorldInfo().getSpawnZ() + rand.nextInt(6+i/10) - rand.nextInt(6+i/10);

            BlockPos topBlockSpot = new BlockPos(j,world.getActualHeight()-1,k);
            while (!world.getBlockState(topBlockSpot).getBlock().isBlockSolid(world, topBlockSpot, EnumFacing.UP)) {
                topBlockSpot = topBlockSpot.down();
            }
            BlockPos above = topBlockSpot.up();

            if (world.getBlockState(above).getBlock().isAir(world.getBlockState(above),world, above)){
                if (worldgeneratorbonuschest.generate(world, rand, above)) break;
            }
        }
    }
    event.setCanceled(true);
}
项目:Jiffy    文件:WorldServer.java   
/**
 * Creates the bonus chest in the world.
 */
protected void createBonusChest() {
    WorldGeneratorBonusChest worldgeneratorbonuschest = new WorldGeneratorBonusChest(
            ChestGenHooks.getItems(BONUS_CHEST, rand), ChestGenHooks.getCount(BONUS_CHEST, rand));

    for (int i = 0; i < 10; ++i) {
        int j = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int k = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6);
        int l = this.getTopSolidOrLiquidBlock(j, k) + 1;

        if (worldgeneratorbonuschest.generate(this, this.rand, j, l, k)) {
            break;
        }
    }
}
项目:RuneCraftery    文件:WorldServer.java   
protected void func_73047_i() {
   WorldGeneratorBonusChest var1 = new WorldGeneratorBonusChest(field_73069_S, 10);

   for(int var2 = 0; var2 < 10; ++var2) {
      int var3 = this.field_72986_A.func_76079_c() + this.field_73012_v.nextInt(6) - this.field_73012_v.nextInt(6);
      int var4 = this.field_72986_A.func_76074_e() + this.field_73012_v.nextInt(6) - this.field_73012_v.nextInt(6);
      int var5 = this.func_72825_h(var3, var4) + 1;
      if(var1.func_76484_a(this, this.field_73012_v, var3, var5, var4)) {
         break;
      }
   }

}
项目:N-API    文件:EventBonusChestAdded.java   
public EventBonusChestAdded(WorldGeneratorBonusChest chest)
{
    this.chest = chest;
}