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


Java BiomeOcean类代码示例

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


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

示例1: generateFeature

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean generateFeature(World world, Random random, int chunkX, int chunkZ, boolean newGen) {
	if(!Config.generateSeaweed)return false;
	
	BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
	for (int i3 = 0; i3 < 5; ++i3)
       {
           int j7 = random.nextInt(16) + 8;
           int i11 = random.nextInt(16) + 8;
           BlockPos center = chunkPos.add(j7, 0, i11);
           int k14 = world.getHeight(center).getY() * 2;

           Biome biome = world.getBiome(chunkPos);
		if(BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN) || biome instanceof BiomeOcean){
            if (k14 > 0)
            {
                int l17 = random.nextInt(k14);
                BlockPos position = chunkPos.add(j7, l17, i11);
                
                for (IBlockState iblockstate = world.getBlockState(position); (iblockstate.getBlock().isAir(iblockstate, world, position) || iblockstate.getMaterial() == Material.WATER) && position.getY() > 0; iblockstate = world.getBlockState(position))
                {
                    position = position.down();
                }

                for (int i = 0; i < 128; ++i)
                {
                    BlockPos blockpos = position.add(random.nextInt(8) - random.nextInt(8), random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8));

                    if (world.getBlockState(blockpos).getBlock() == Blocks.WATER && ModBlocks.seaweed.canBlockStay(world, blockpos, ModBlocks.seaweed.getDefaultState()))
                    {
                        world.setBlockState(blockpos, ModBlocks.seaweed.getDefaultState(), 2);
                    }
                }

                return !newGen;
            }
		}
       }
	return false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:41,代码来源:SeaweedFeature.java

示例2: generateFeature

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean generateFeature(World world, Random random, int chunkX, int chunkZ, boolean newGen) {
	BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
	if (Config.coralChance > 0 && random.nextInt(Config.coralChance) == 0)
       {
           int j7 = random.nextInt(16) + 8;
           int i11 = random.nextInt(16) + 8;
           BlockPos center = chunkPos.add(j7, 0, i11);
           int k14 = world.getHeight(center).getY() * 2;

           Biome biome = world.getBiome(chunkPos);
		if(BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN) || biome instanceof BiomeOcean){
            if (k14 > 0)
            {
                int l17 = random.nextInt(k14);
                BlockPos position = chunkPos.add(j7, l17, i11);
                
                for (IBlockState iblockstate = world.getBlockState(position); (iblockstate.getBlock().isAir(iblockstate, world, position) || iblockstate.getMaterial() == Material.WATER) && position.getY() > 0; iblockstate = world.getBlockState(position))
                {
                    position = position.down();
                }

                BlockPos blockpos = position.add(random.nextInt(8) - random.nextInt(8), random.nextInt(4) - random.nextInt(4), random.nextInt(8) - random.nextInt(8));

                if (world.getBlockState(blockpos).getBlock() == Blocks.WATER && world.getBlockState(blockpos.down()).getMaterial() == Material.SAND)
                {
                	BlockCoral.generateCoralCluster(world, blockpos, MathHelper.getInt(random, 20, 40), false, false);
                }

                return !newGen;
            }
		}
       }
	return false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:36,代码来源:CoralReefFeature.java

示例3: isPermitted

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest || biome == Biomes.RIVER ||
            biome instanceof BiomeOcean ||
            biome instanceof BiomePlains ||
            biome instanceof BiomeJungle ||
            biome instanceof BiomeSavanna;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockCropHarvestable.java

示例4: isPermitted

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeOcean || biome == Biomes.RIVER ||
            biome instanceof BiomeBeach ||
            biome instanceof BiomeForest ||
            biome instanceof BiomePlains ||
            biome instanceof BiomeJungle;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockCrop.java

示例5: isPermitted

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest ||
            biome instanceof BiomeOcean ||
            biome instanceof BiomePlains || biome == Biomes.RIVER ||
            biome instanceof BiomeJungle ||
            biome instanceof BiomeSavanna;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockSeedling.java

示例6: isPermitted

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean isPermitted(Biome biome) {

    return biome instanceof BiomeForest || biome instanceof BiomeOcean ||
            biome == Biomes.RIVER || biome instanceof BiomePlains ||
            biome == Biomes.BEACH || biome instanceof BiomeSwamp ||
            biome instanceof BiomeMushroomIsland ||
            biome instanceof BiomeJungle || biome instanceof BiomeSavanna;
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:10,代码来源:BlockBeehive.java

示例7: generateFeature

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
@Override
public boolean generateFeature(World world, Random random, int chunkX, int chunkZ, boolean newGen) {
	if(!Config.generateKelp)return false;
	
	BlockPos chunkPos = new BlockPos(chunkX * 16, 0, chunkZ * 16);
	if(random.nextInt(5) == 0)
       {
           int j7 = random.nextInt(16) + 8;
           int i11 = random.nextInt(16) + 8;
           BlockPos center = chunkPos.add(j7, 0, i11);
           int k14 = world.getHeight(center).getY() * 2;

           Biome biome = world.getBiome(chunkPos);
		if(BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN) || biome instanceof BiomeOcean){
            if (k14 > 0)
            {
                int l17 = random.nextInt(k14);
                BlockPos position = chunkPos.add(j7, l17, i11);
                
                for (IBlockState iblockstate = world.getBlockState(position); (iblockstate.getBlock().isAir(iblockstate, world, position) || iblockstate.getMaterial() == Material.WATER) && position.getY() > 0; iblockstate = world.getBlockState(position))
                {
                    position = position.down();
                }
                boolean placed = false;
                for (int i = 0; i < 125; ++i)
                {
                    BlockPos blockpos = position.add(random.nextInt(4) - random.nextInt(4), random.nextInt(4) - random.nextInt(4), random.nextInt(4) - random.nextInt(4));

                    if (world.getBlockState(blockpos).getBlock() == Blocks.WATER && ModBlocks.kelp.canBlockStay(world, blockpos, ModBlocks.kelp.getDefaultState()) && world.getBlockState(blockpos.down()).getMaterial() == Material.SAND)
                    {
                        if(generateKelp(world, blockpos, random)){
                        	placed = true;
                        }
                    }
                }

                return !newGen && placed;
            }
		}
       }
	return false;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:43,代码来源:KelpFeature.java

示例8: chooseTemp

import net.minecraft.world.biome.BiomeOcean; //导入依赖的package包/类
/** Assigns a temperature to the biome.
 * @return The base temperature for the biome */
private static float chooseTemp(Biome biome) {
    
    if (biome == Biomes.MUTATED_ICE_FLATS) {
        
        return -4;
        
    } else if (biome instanceof BiomeSnow) {
        
        return -3;
        
    } else if (biome == Biomes.FROZEN_RIVER) {
        
        return -2;
        
    } else if (biome == Biomes.COLD_TAIGA ||
            biome == Biomes.COLD_TAIGA_HILLS ||
            biome == Biomes.MUTATED_TAIGA_COLD) {
        
        return -1;
        
    } else if (biome == Biomes.COLD_BEACH) {
        
        return -0.5F;
        
    } else if (biome instanceof BiomeHills || biome instanceof BiomeTaiga ||
            biome instanceof BiomeVoid || biome instanceof BiomeEnd) {
        
        return 0;
        
    } else if (biome == Biomes.STONE_BEACH) {
        
        return 0.5F;
        
    } else if (biome == Biomes.BIRCH_FOREST ||
            biome == Biomes.BIRCH_FOREST_HILLS) {
        
        return 1;
        
    } else if (biome instanceof BiomeOcean || biome instanceof BiomeForest
            || biome instanceof BiomeRiver) {
        
        return 2;
        
    } else if (biome instanceof BiomePlains) {
        
        return 2.5F;
        
    } else if (biome instanceof BiomeSwamp || biome instanceof BiomeBeach) {
        
        return 3;
        
    } else if (biome instanceof BiomeMushroomIsland) {

        return 4;
        
    } else if (biome instanceof BiomeJungle) {
        
        return 4.5F;
        
    } else if (biome instanceof BiomeSavanna) {
        
        return 5;
        
    } else if (biome instanceof BiomeDesert || biome instanceof BiomeMesa ||
            biome instanceof BiomeHell) {
        
        return 6;
        
    } else {

        float base = biome.getTemperature();
        float converted = (base - 1) * 10;
        Geomastery.LOG.info("Unsupported biome {} has had its temperature set to {}", biome.getBiomeName(), converted);
        return converted;
    }
}
 
开发者ID:JayAvery,项目名称:geomastery,代码行数:79,代码来源:GeoBiomes.java


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