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

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

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

World.getBiomeForCoordsBody介绍

暂无

代码示例

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

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

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

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

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

@Override
 public void miningSpeed(ItemStack tool, PlayerEvent.BreakSpeed event) {
  float coeff = 1f;
  // is the player in water?
  if(event.getEntityPlayer().isInWater()) {
   coeff += 5.5f; // being in water causes speed to be 1/5th. These values work fine.
  }
  // is it raining?
  if(event.getEntityPlayer().getEntityWorld().isRaining()) {
   coeff += event.getEntityPlayer().getEntityWorld().getBiomeForCoordsBody(event.getEntityPlayer().getPosition()).getRainfall() / 1.6f;
  }

  event.setNewSpeed(event.getNewSpeed() + event.getOriginalSpeed() * coeff);
 }
}

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

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

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

@Override
public Biome getBiomeForCoordsBody(BlockPos pos) {
  return getActualWorld().getBiomeForCoordsBody(pos);
}

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

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

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

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  if (world.provider.getDimension() == 0) {
    int blockX = (chunkX << 4) + random.nextInt(16);
    int blockZ = (chunkZ << 4) + random.nextInt(16);
    BlockPos pos = new BlockPos(blockX, 0, blockZ);
    Biome biome = world.getBiomeForCoordsBody(pos);
    StructureUtils.StructureData data = StructureUtils.getStructureData();
    boolean universalGeneratorsGenerated = false;
    for(GeneratorEntry generatorEntry : UNIVERSAL_GENERATORS) {
      if (generatorEntry.predicate.canSpawn(world, pos, random) && generatorEntry.configPredicate.test(data)) {
        generatorEntry.generatorFunction.apply(random).generate(world, random, pos);
        universalGeneratorsGenerated = true;
      }
    }
    if(!universalGeneratorsGenerated) {
      List<GeneratorEntry> entries = GENERATORS.get(biome);
      if (entries != null && !entries.isEmpty()) {
        GeneratorEntry generatorEntry = entries.get(random.nextInt(entries.size()));
        if (generatorEntry != null) {
          if (generatorEntry.predicate.canSpawn(world, pos, random)&& generatorEntry.configPredicate.test(data)) {
            generatorEntry.generatorFunction.apply(random).generate(world, random, pos);
          }
        }
      }
    }
  }
}

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

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

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

private List<Biome.SpawnListEntry> getDefaultCreatures(EnumCreatureType creatureType, BlockPos pos) {
  Biome Biome = this.worldObj.getBiomeForCoordsBody(pos);
  if (creatureType == EnumCreatureType.MONSTER) {
    if (profile.GENERATE_SCATTERED) {
      if (this.scatteredFeatureGenerator.isInsideStructure(pos)) {
        return this.scatteredFeatureGenerator.getMonsters();
      }
    }
    if (profile.GENERATE_OCEANMONUMENTS) {
      if (this.oceanMonumentGenerator.isPositionInStructure(this.worldObj, pos)) {
        return this.oceanMonumentGenerator.getMonsters();
      }
    }
  }
  return Biome.getSpawnableList(creatureType);
}

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

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  if(!(world instanceof WorldServer) || !dims.canSpawnHere(world))
    return;
  WorldServer sWorld = (WorldServer) world;
  int x = chunkX * 16 + random.nextInt(16);
  int z = chunkZ * 16 + random.nextInt(16);
  BlockPos xzPos = new BlockPos(x, 1, z);
  Biome biome = world.getBiomeForCoordsBody(xzPos);
  if(biome == Biomes.OCEAN || biome == Biomes.DEEP_OCEAN) {
    if(random.nextInt(PirateShips.rarity) == 0) {
      BlockPos pos = getTopLiquidBlock(world, new BlockPos(x, 0, z));
      IBlockState state = world.getBlockState(pos.down());
      if(state.getBlock() != Blocks.WATER)
        return;
      
      pos = new BlockPos(pos.getX(), pos.getY() - 3, pos.getZ());
      generateShipAt(sWorld, random, pos);
    }
  }
}

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

@Override
public List<SpawnListEntry> getPossibleCreatures(EnumCreatureType paramaca, BlockPos blockPos)
{
  WorldConfig worldConfig = this.world.getConfigs().getWorldConfig();
  Biome biomeBase = this.worldHandle.getBiomeForCoordsBody(blockPos);
  if (worldConfig.rareBuildingsEnabled)
  {
    if (paramaca == EnumCreatureType.MONSTER && this.world.rareBuildingGen.isSwampHut(blockPos))
    {
      return this.world.rareBuildingGen.getMonsters();
    }
  }
  if (worldConfig.oceanMonumentsEnabled)
  {
    if (paramaca == EnumCreatureType.MONSTER && this.world.oceanMonumentGen.isPositionInStructure(this.worldHandle, blockPos))
    {
      return this.world.oceanMonumentGen.getMonsterSpawnList();
    }
  }
  return biomeBase.getSpawnableList(paramaca);
}

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

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

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

@Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  int coordX = chunkX * 16;
  int coordZ = chunkZ * 16;
  for (OreGenerationDefinition ore : MaterialsModule.oresConfig.getOres()) {
    for (BiomeDefinition biome : ore.getBiomeDefinitions()) {
      if (biome.getDimension() == world.provider.getDimension()) {
        Biome currentBiome = world.getBiomeForCoordsBody(new BlockPos(coordX, 0, coordZ));
        if (biome.getBiomeMatcher().matches(currentBiome)) {
          generateOre(biome, coordX, coordZ, ore.getOreType(biome.getDimension()), random, world);
        }
      }
    }
  }
}

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

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

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

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

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

@Override
public void generate(Random random, int chunkX, int chunkZ, World world,
    net.minecraft.world.gen.IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
  final int x = chunkX * 16 + 8;
  final int z = chunkZ * 16 + 8;
  final Biome biome = world.getBiomeForCoordsBody(new BlockPos(x, 0, z));
  if (BiomeDictionary.hasType(biome, BiomeDictionary.Type.DEAD)) {
    return;
  }
  if (config.enablearidgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SANDY) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.MESA))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.aridGarden), world, random, x, z);
  }
  if (config.enablefrostgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SNOWY) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.MOUNTAIN))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.frostGarden), world, random, x, z);
  }
  if (config.enableshadedgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.FOREST) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SPOOKY))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.shadedGarden), world, random, x, z);
  }
  if (config.enablesoggygardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.SWAMP) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.RIVER))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.soggyGarden), world, random, x, z);
  }
  if (config.enabletropicalgardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.JUNGLE) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.OCEAN))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.tropicalGarden), world, random, x, z);
  }
  if (config.enablewindygardenGeneration && (BiomeDictionary.hasType(biome, BiomeDictionary.Type.PLAINS) || BiomeDictionary.hasType(biome, BiomeDictionary.Type.SAVANNA))) {
    generateGarden(BlockRegistry.getGarden(BlockRegistry.windyGarden), world, random, x, z);
  }
}

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

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

相关文章

微信公众号

最新文章

更多

World类方法