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

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

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

World.getActualHeight介绍

暂无

代码示例

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

  1. @Override
  2. public int getActualHeight() {
  3. return wrapped.getActualHeight();
  4. }

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

  1. @Override
  2. public int getActualHeight() {
  3. return getActualWorld().getActualHeight();
  4. }

代码示例来源:origin: GregTechCE/GregTech

  1. public CachedGridEntry(World world, int gridX, int gridZ) {
  2. this.gridX = gridX;
  3. this.gridZ = gridZ;
  4. long gridRandomSeed = Objects.hash(gridX, gridZ) ^ world.getSeed();
  5. this.gridRandom = new XSTR(gridRandomSeed);
  6. int gridSizeX = WorldGeneratorImpl.GRID_SIZE_X * 16;
  7. int gridSizeZ = WorldGeneratorImpl.GRID_SIZE_Z * 16;
  8. BlockPos blockPos = new BlockPos(gridX * gridSizeX + gridSizeX / 2, world.getActualHeight(), gridZ * gridSizeZ + gridSizeZ / 2);
  9. Biome currentBiome = world.getBiomeProvider().getBiome(blockPos);
  10. this.cachedDepositMap = new ArrayList<>(WorldGenRegistry.INSTANCE.getCachedBiomeVeins(world.provider, currentBiome));
  11. this.maxHeight = world.getActualHeight();
  12. this.generatedVeins = triggerVeinsGeneration();
  13. }

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

  1. final int lowest = Math.round(world.getActualHeight() * 0.22f); // 56
  2. final int range = Math.round(world.getActualHeight() * 0.72f); // 184
  3. if (random.nextFloat() < 0.8f) {
  4. int randPosX = x + random.nextInt(16);
  5. final int lowest = Math.round(world.getActualHeight() / 8f); // 32
  6. final int range = Math.round(world.getActualHeight() * 0.297f); // 76
  7. int randPosX = x + random.nextInt(16);
  8. int randPosY = random.nextInt(range) + lowest;
  9. final int lowest = Math.round(world.getActualHeight() / 16f); // 16
  10. final int range = Math.round(world.getActualHeight() * 0.297f); // 76
  11. int randPosX = x + random.nextInt(16);
  12. int randPosY = random.nextInt(range) + lowest;

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

  1. public static int getTargetY(World world, int x, int z, boolean skipWater) {
  2. Block block;
  3. for (int y = world.getActualHeight(); y > 0; y--) {
  4. IBlockState state = world.getBlockState(new BlockPos(x, y, z));
  5. block = state.getBlock();
  6. if (AWStructureStatics.isSkippable(state)) {
  7. continue;
  8. }
  9. if (skipWater && (block == Blocks.WATER || block == Blocks.FLOWING_WATER)) {
  10. continue;
  11. }
  12. return y;
  13. }
  14. return -1;
  15. }

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

  1. @Override
  2. public boolean shouldIncludeForSelection(World world, int x, int y, int z, EnumFacing face, StructureTemplate template) {
  3. int remainingHeight = world.getActualHeight() - getMinFlyingHeight() - (template.getSize().getY() - template.getOffset().getY());
  4. return y < remainingHeight;
  5. }

代码示例来源:origin: lawremi/CustomOreGen

  1. properties.put("dimension.hasNoSky", world == null ? false : world.provider.hasSkyLight());
  2. properties.put("dimension.groundLevel", world == null ? 0 : world.provider.getAverageGroundLevel());
  3. properties.put("dimension.actualHeight", world == null ? 0 : world.getActualHeight());
  4. properties.put("dimension.height", world == null ? 0 : world.getHeight());
  5. properties.put("age", false);

代码示例来源:origin: CyclopsMC/IntegratedDynamics

  1. @Override
  2. public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
  3. super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
  4. // Simulate chorus-eating
  5. if (entityIn instanceof EntityLivingBase) {
  6. EntityLivingBase entityLiving = (EntityLivingBase) entityIn;
  7. double d0 = entityLiving.posX;
  8. double d1 = entityLiving.posY;
  9. double d2 = entityLiving.posZ;
  10. for (int i = 0; i < 16; ++i) {
  11. double d3 = entityLiving.posX + (entityLiving.getRNG().nextDouble() - 0.5D) * 16.0D;
  12. double d4 = MathHelper.clamp(entityLiving.posY + (double) (entityLiving.getRNG().nextInt(16) - 8), 0.0D, (double) (worldIn.getActualHeight() - 1));
  13. double d5 = entityLiving.posZ + (entityLiving.getRNG().nextDouble() - 0.5D) * 16.0D;
  14. if (entityLiving.isRiding()) {
  15. entityLiving.dismountRidingEntity();
  16. }
  17. if (entityLiving.attemptTeleport(d3, d4, d5)) {
  18. worldIn.playSound((EntityPlayer) null, d0, d1, d2, SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
  19. entityLiving.playSound(SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, 1.0F, 1.0F);
  20. break;
  21. }
  22. }
  23. }
  24. }
  25. }

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

  1. double desty;
  2. if (random.nextFloat() > 0.5f) {
  3. desty = world.getTopSolidOrLiquidBlock(new BlockPos((int) destx, world.getActualHeight(),(int) destz)).getY();
  4. } else {
  5. desty = centery + dist * Math.sin(phi);

代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition

  1. heightCheck = 3;
  2. int height = Math.min(pos.getY() + heightCheck, world.getActualHeight());
  3. IBlockState block;
  4. for (int i = pos.getY(); i < height; i++) {

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

  1. posBlock = posBlock.add(offset);
  2. if (posBlock.getY() <= 1 || posBlock.getY() >= world.getActualHeight()) {
  3. continue;

相关文章

World类方法