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

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

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

World.getPrecipitationHeight介绍

暂无

代码示例

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

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

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

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

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

  1. final BlockPos p2 = world.getPrecipitationHeight(chunkPos.add(rng.nextInt(16) + 8, 0, rng.nextInt(16) + 8));
  2. if (ClimateTFC.getHeightAdjustedBiomeTemp(world, p2) >= 7)
  3. waterplantGen.generate(world, rng, p2);

代码示例来源:origin: PenguinSquad/Harvest-Festival

  1. public static boolean isRainingAt(World world, BlockPos pos) {
  2. Biome biome = world.getBiome(pos);
  3. Weather weather = HFApi.calendar.getWeather(world);
  4. return (weather.isRain() || (weather.isSnow() && biome.isHighHumidity())) && world.canBlockSeeSky(pos) && world.getPrecipitationHeight(pos).getY() <= pos.getY() && world.getBiome(pos).canRain();
  5. }
  6. }

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

  1. final int y = world.getPrecipitationHeight(blockpos.add(x, 0, z)).getY();

代码示例来源:origin: PenguinSquad/Harvest-Festival

  1. BlockPos blockpos1 = world.getPrecipitationHeight(blockpos.add(random.nextInt(10) - random.nextInt(10), 0, random.nextInt(10) - random.nextInt(10)));
  2. Biome biome = world.getBiome(blockpos1);
  3. BlockPos blockpos2 = blockpos1.down();

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

  1. for (k1 = 0; doGen && k1 < 16; ++k1) {
  2. for (l1 = 0; l1 < 16; ++l1) {
  3. i2 = w.getPrecipitationHeight(new BlockPos(x + k1, 0, z + l1)).getY();

代码示例来源:origin: P3pp3rF1y/AncientWarfare2

  1. public static void sprinkleSnow(World world, StructureBB bb, int border) {
  2. BlockPos p1 = bb.min.add(-border, 0, -border);
  3. BlockPos p2 = bb.max.add(border, 0, border);
  4. for (int x = p1.getX(); x <= p2.getX(); x++) {
  5. for (int z = p1.getZ(); z <= p2.getZ(); z++) {
  6. int y = world.getPrecipitationHeight(new BlockPos(x, 1, z)).getY() - 1;
  7. BlockPos pos = new BlockPos(x, y, z);
  8. if (p2.getY() >= y && y > 0 && world.canSnowAtBody(pos.up(), true)) {
  9. IBlockState state = world.getBlockState(pos);
  10. Block block = state.getBlock();
  11. if (block != Blocks.AIR && state.getBlockFaceShape(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID) {
  12. world.setBlockState(pos.up(), Blocks.SNOW_LAYER.getDefaultState());
  13. }
  14. }
  15. }
  16. }
  17. }

代码示例来源:origin: Glitchfiend/SereneSeasons

  1. @SubscribeEvent
  2. public void onPopulateChunk(PopulateChunkEvent.Populate event)
  3. {
  4. if (!event.getWorld().isRemote && event.getType() != PopulateChunkEvent.Populate.EventType.ICE || !SeasonsConfig.isDimensionWhitelisted(event.getWorld().provider.getDimension()))
  5. return;
  6. event.setResult(Event.Result.DENY);
  7. BlockPos blockpos = new BlockPos(event.getChunkX() * 16, 0, event.getChunkZ() * 16).add(8, 0, 8);
  8. for (int k2 = 0; k2 < 16; ++k2)
  9. {
  10. for (int j3 = 0; j3 < 16; ++j3)
  11. {
  12. BlockPos blockpos1 = event.getWorld().getPrecipitationHeight(blockpos.add(k2, 0, j3));
  13. BlockPos blockpos2 = blockpos1.down();
  14. if (SeasonASMHelper.canBlockFreezeInSeason(event.getWorld(), blockpos2, false, SeasonHelper.getSeasonState(event.getWorld()), true))
  15. {
  16. event.getWorld().setBlockState(blockpos2, Blocks.ICE.getDefaultState(), 2);
  17. }
  18. if (SeasonASMHelper.canSnowAtInSeason(event.getWorld(), blockpos1, true, SeasonHelper.getSeasonState(event.getWorld()), true))
  19. {
  20. event.getWorld().setBlockState(blockpos1, Blocks.SNOW_LAYER.getDefaultState(), 2);
  21. }
  22. }
  23. }
  24. }

代码示例来源:origin: PenguinSquad/Harvest-Festival

  1. int j2 = world.getPrecipitationHeight(blockpos$mutableblockpos).getY();
  2. int k2 = j - i1;
  3. int l2 = j + i1;

相关文章

World类方法