net.minecraft.world.World.getBiomeForCoordsBody()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中net.minecraft.world.World.getBiomeForCoordsBody()方法的一些代码示例,展示了World.getBiomeForCoordsBody()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getBiomeForCoordsBody()方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getBiomeForCoordsBody

World.getBiomeForCoordsBody介绍

暂无

代码示例

代码示例来源:origin: EngineHub/WorldEdit

  1. @Override
  2. public BaseBiome getBiome(BlockVector2 position) {
  3. checkNotNull(position);
  4. return new BaseBiome(Biome.getIdForBiome(getWorld().getBiomeForCoordsBody(new BlockPos(position.getBlockX(), 0, position.getBlockZ()))));
  5. }

代码示例来源:origin: SlimeKnights/TinkersConstruct

  1. protected float calcAridiculousness(World world, BlockPos pos) {
  2. Biome biome = world.getBiomeForCoordsBody(pos);
  3. float rain = world.isRaining() ? biome.getRainfall() / 2f : 0f;
  4. return (float) (Math.pow(1.25, 3d * (0.5f + biome.getTemperature() - biome.getRainfall())) - 1.25d) - rain;
  5. }
  6. }

代码示例来源:origin: SlimeKnights/TinkersConstruct

  1. @Override
  2. public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) {
  3. float coeff = 1f;
  4. // is the player in water?
  5. if(event.getEntityPlayer().isInWater()) {
  6. coeff += 5.5f; // being in water causes speed to be 1/5th. These values work fine.
  7. }
  8. // is it raining?
  9. if(event.getEntityPlayer().getEntityWorld().isRaining()) {
  10. coeff += event.getEntityPlayer().getEntityWorld().getBiomeForCoordsBody(event.getEntityPlayer().getPosition()).getRainfall() / 1.6f;
  11. }
  12. event.setNewSpeed(event.getNewSpeed() + event.getOriginalSpeed() * coeff);
  13. }
  14. }

代码示例来源:origin: SleepyTrousers/EnderIO

  1. @Override
  2. public @Nonnull Biome getBiomeForCoordsBody(@Nonnull BlockPos pos) {
  3. return wrapped.getBiomeForCoordsBody(pos);
  4. }

代码示例来源:origin: amadornes/MCMultiPart

  1. @Override
  2. public Biome getBiomeForCoordsBody(BlockPos pos) {
  3. return getActualWorld().getBiomeForCoordsBody(pos);
  4. }

代码示例来源:origin: MatrexsVigil/harvestcraft

  1. final int z = chunkZ * 16 + 8 + random.nextInt(16);
  2. Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 64, z));

代码示例来源:origin: JurassiCraftTeam/JurassiCraft2

  1. @Override
  2. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  3. if (world.provider.getDimension() == 0) {
  4. int blockX = (chunkX << 4) + random.nextInt(16);
  5. int blockZ = (chunkZ << 4) + random.nextInt(16);
  6. BlockPos pos = new BlockPos(blockX, 0, blockZ);
  7. Biome biome = world.getBiomeForCoordsBody(pos);
  8. StructureUtils.StructureData data = StructureUtils.getStructureData();
  9. boolean universalGeneratorsGenerated = false;
  10. for(GeneratorEntry generatorEntry : UNIVERSAL_GENERATORS) {
  11. if (generatorEntry.predicate.canSpawn(world, pos, random) && generatorEntry.configPredicate.test(data)) {
  12. generatorEntry.generatorFunction.apply(random).generate(world, random, pos);
  13. universalGeneratorsGenerated = true;
  14. }
  15. }
  16. if(!universalGeneratorsGenerated) {
  17. List<GeneratorEntry> entries = GENERATORS.get(biome);
  18. if (entries != null && !entries.isEmpty()) {
  19. GeneratorEntry generatorEntry = entries.get(random.nextInt(entries.size()));
  20. if (generatorEntry != null) {
  21. if (generatorEntry.predicate.canSpawn(world, pos, random)&& generatorEntry.configPredicate.test(data)) {
  22. generatorEntry.generatorFunction.apply(random).generate(world, random, pos);
  23. }
  24. }
  25. }
  26. }
  27. }
  28. }

代码示例来源:origin: MatrexsVigil/harvestcraft

  1. @Override
  2. public void generate(Random random, int chunkX, int chunkZ, World world,
  3. net.minecraft.world.gen.IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  4. if (!HarvestCraft.config.enableBeehiveGeneration) return;
  5. final Biome biome = world.getBiomeForCoordsBody(new BlockPos(chunkX, 0, chunkZ));
  6. if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.END) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)) {
  7. return;
  8. }
  9. tryGenerateBeehives(world, random, chunkX * 16 + 8, chunkZ * 16 + 8);
  10. }

代码示例来源:origin: McJtyMods/LostCities

  1. private List<Biome.SpawnListEntry> getDefaultCreatures(EnumCreatureType creatureType, BlockPos pos) {
  2. Biome Biome = this.worldObj.getBiomeForCoordsBody(pos);
  3. if (creatureType == EnumCreatureType.MONSTER) {
  4. if (profile.GENERATE_SCATTERED) {
  5. if (this.scatteredFeatureGenerator.isInsideStructure(pos)) {
  6. return this.scatteredFeatureGenerator.getMonsters();
  7. }
  8. }
  9. if (profile.GENERATE_OCEANMONUMENTS) {
  10. if (this.oceanMonumentGenerator.isPositionInStructure(this.worldObj, pos)) {
  11. return this.oceanMonumentGenerator.getMonsters();
  12. }
  13. }
  14. }
  15. return Biome.getSpawnableList(creatureType);
  16. }

代码示例来源:origin: Vazkii/Quark

  1. @Override
  2. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  3. if(!(world instanceof WorldServer) || !dims.canSpawnHere(world))
  4. return;
  5. WorldServer sWorld = (WorldServer) world;
  6. int x = chunkX * 16 + random.nextInt(16);
  7. int z = chunkZ * 16 + random.nextInt(16);
  8. BlockPos xzPos = new BlockPos(x, 1, z);
  9. Biome biome = world.getBiomeForCoordsBody(xzPos);
  10. if(biome == Biomes.OCEAN || biome == Biomes.DEEP_OCEAN) {
  11. if(random.nextInt(PirateShips.rarity) == 0) {
  12. BlockPos pos = getTopLiquidBlock(world, new BlockPos(x, 0, z));
  13. IBlockState state = world.getBlockState(pos.down());
  14. if(state.getBlock() != Blocks.WATER)
  15. return;
  16. pos = new BlockPos(pos.getX(), pos.getY() - 3, pos.getZ());
  17. generateShipAt(sWorld, random, pos);
  18. }
  19. }
  20. }

代码示例来源:origin: MCTCP/TerrainControl

  1. @Override
  2. public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType paramaca, BlockPos blockPos)
  3. {
  4. WorldConfig worldConfig = this.world.getConfigs().getWorldConfig();
  5. Biome biomeBase = this.worldHandle.getBiomeForCoordsBody(blockPos);
  6. if (worldConfig.rareBuildingsEnabled)
  7. {
  8. if (paramaca == EnumCreatureType.MONSTER && this.world.rareBuildingGen.isSwampHut(blockPos))
  9. {
  10. return this.world.rareBuildingGen.getMonsters();
  11. }
  12. }
  13. if (worldConfig.oceanMonumentsEnabled)
  14. {
  15. if (paramaca == EnumCreatureType.MONSTER && this.world.oceanMonumentGen.isPositionInStructure(this.worldHandle, blockPos))
  16. {
  17. return this.world.oceanMonumentGen.getMonsterSpawnList();
  18. }
  19. }
  20. return biomeBase.getSpawnableList(paramaca);
  21. }

代码示例来源:origin: TeamLapen/Vampirism

  1. if (worldIn.getBiomeForCoordsBody(position).getHeightVariation() < 0.3 && rand.nextInt(6) == 0) {
  2. int r = rand.nextInt(2);
  3. int r1 = rand.nextInt(2);

代码示例来源:origin: Esteemed-Innovation/Esteemed-Innovation

  1. @Override
  2. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  3. int coordX = chunkX * 16;
  4. int coordZ = chunkZ * 16;
  5. for (OreGenerationDefinition ore : MaterialsModule.oresConfig.getOres()) {
  6. for (BiomeDefinition biome : ore.getBiomeDefinitions()) {
  7. if (biome.getDimension() == world.provider.getDimension()) {
  8. Biome currentBiome = world.getBiomeForCoordsBody(new BlockPos(coordX, 0, coordZ));
  9. if (biome.getBiomeMatcher().matches(currentBiome)) {
  10. generateOre(biome, coordX, coordZ, ore.getOreType(biome.getDimension()), random, world);
  11. }
  12. }
  13. }
  14. }
  15. }

代码示例来源:origin: McJtyMods/LostCities

  1. int z = chunkZ * 16;
  2. World w = this.worldObj;
  3. Biome biome = w.getBiomeForCoordsBody(new BlockPos(x + 16, 0, z + 16));
  4. this.rand.setSeed(w.getSeed());
  5. long i1 = this.rand.nextLong() / 2L * 2L + 1L;

代码示例来源:origin: MatrexsVigil/harvestcraft

  1. int zCh = chunkZ * 16 + random.nextInt(16);
  2. final Biome biome = world.getBiomeForCoordsBody(new BlockPos(xChunk + 16, 0, zChunk + 16));
  3. final BlockPos blockPos = new BlockPos(xCh, yCh + 64, zCh);
  4. if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)) {

代码示例来源:origin: MatrexsVigil/harvestcraft

  1. @Override
  2. public void generate(Random random, int chunkX, int chunkZ, World world,
  3. net.minecraft.world.gen.IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  4. final int x = chunkX * 16 + 8;
  5. final int z = chunkZ * 16 + 8;
  6. final Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
  7. if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)) {
  8. return;
  9. }
  10. if (config.enablearidgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.MESA))) {
  11. generateGarden(BlockRegistry.getGarden(BlockRegistry.aridGarden), world, random, x, z);
  12. }
  13. if (config.enablefrostgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.MOUNTAIN))) {
  14. generateGarden(BlockRegistry.getGarden(BlockRegistry.frostGarden), world, random, x, z);
  15. }
  16. if (config.enableshadedgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SPOOKY))) {
  17. generateGarden(BlockRegistry.getGarden(BlockRegistry.shadedGarden), world, random, x, z);
  18. }
  19. if (config.enablesoggygardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SWAMP) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER))) {
  20. generateGarden(BlockRegistry.getGarden(BlockRegistry.soggyGarden), world, random, x, z);
  21. }
  22. if (config.enabletropicalgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.JUNGLE) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN))) {
  23. generateGarden(BlockRegistry.getGarden(BlockRegistry.tropicalGarden), world, random, x, z);
  24. }
  25. if (config.enablewindygardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.PLAINS) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SAVANNA))) {
  26. generateGarden(BlockRegistry.getGarden(BlockRegistry.windyGarden), world, random, x, z);
  27. }
  28. }

代码示例来源:origin: McJtyMods/LostCities

  1. int cx = cc.getX();
  2. int cz = cc.getZ();
  3. Biome biome = world.getBiomeForCoordsBody(event.getPos());
  4. BiomeDecorator decorator = biome.decorator;
  5. int treesPerChunk = decorator.treesPerChunk;

相关文章

World类方法