本文整理了Java中net.minecraft.world.World.getActualHeight()
方法的一些代码示例,展示了World.getActualHeight()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getActualHeight()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getActualHeight
暂无
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public int getActualHeight() {
return wrapped.getActualHeight();
}
代码示例来源:origin: amadornes/MCMultiPart
@Override
public int getActualHeight() {
return getActualWorld().getActualHeight();
}
代码示例来源:origin: GregTechCE/GregTech
public CachedGridEntry(World world, int gridX, int gridZ) {
this.gridX = gridX;
this.gridZ = gridZ;
long gridRandomSeed = Objects.hash(gridX, gridZ) ^ world.getSeed();
this.gridRandom = new XSTR(gridRandomSeed);
int gridSizeX = WorldGeneratorImpl.GRID_SIZE_X * 16;
int gridSizeZ = WorldGeneratorImpl.GRID_SIZE_Z * 16;
BlockPos blockPos = new BlockPos(gridX * gridSizeX + gridSizeX / 2, world.getActualHeight(), gridZ * gridSizeZ + gridSizeZ / 2);
Biome currentBiome = world.getBiomeProvider().getBiome(blockPos);
this.cachedDepositMap = new ArrayList<>(WorldGenRegistry.INSTANCE.getCachedBiomeVeins(world.provider, currentBiome));
this.maxHeight = world.getActualHeight();
this.generatedVeins = triggerVeinsGeneration();
}
代码示例来源:origin: ForestryMC/ForestryMC
final int lowest = Math.round(world.getActualHeight() * 0.22f); // 56
final int range = Math.round(world.getActualHeight() * 0.72f); // 184
if (random.nextFloat() < 0.8f) {
int randPosX = x + random.nextInt(16);
final int lowest = Math.round(world.getActualHeight() / 8f); // 32
final int range = Math.round(world.getActualHeight() * 0.297f); // 76
int randPosX = x + random.nextInt(16);
int randPosY = random.nextInt(range) + lowest;
final int lowest = Math.round(world.getActualHeight() / 16f); // 16
final int range = Math.round(world.getActualHeight() * 0.297f); // 76
int randPosX = x + random.nextInt(16);
int randPosY = random.nextInt(range) + lowest;
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
public static int getTargetY(World world, int x, int z, boolean skipWater) {
Block block;
for (int y = world.getActualHeight(); y > 0; y--) {
IBlockState state = world.getBlockState(new BlockPos(x, y, z));
block = state.getBlock();
if (AWStructureStatics.isSkippable(state)) {
continue;
}
if (skipWater && (block == Blocks.WATER || block == Blocks.FLOWING_WATER)) {
continue;
}
return y;
}
return -1;
}
代码示例来源:origin: P3pp3rF1y/AncientWarfare2
@Override
public boolean shouldIncludeForSelection(World world, int x, int y, int z, EnumFacing face, StructureTemplate template) {
int remainingHeight = world.getActualHeight() - getMinFlyingHeight() - (template.getSize().getY() - template.getOffset().getY());
return y < remainingHeight;
}
代码示例来源:origin: lawremi/CustomOreGen
properties.put("dimension.hasNoSky", world == null ? false : world.provider.hasSkyLight());
properties.put("dimension.groundLevel", world == null ? 0 : world.provider.getAverageGroundLevel());
properties.put("dimension.actualHeight", world == null ? 0 : world.getActualHeight());
properties.put("dimension.height", world == null ? 0 : world.getHeight());
properties.put("age", false);
代码示例来源:origin: CyclopsMC/IntegratedDynamics
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
super.onEntityCollidedWithBlock(worldIn, pos, state, entityIn);
// Simulate chorus-eating
if (entityIn instanceof EntityLivingBase) {
EntityLivingBase entityLiving = (EntityLivingBase) entityIn;
double d0 = entityLiving.posX;
double d1 = entityLiving.posY;
double d2 = entityLiving.posZ;
for (int i = 0; i < 16; ++i) {
double d3 = entityLiving.posX + (entityLiving.getRNG().nextDouble() - 0.5D) * 16.0D;
double d4 = MathHelper.clamp(entityLiving.posY + (double) (entityLiving.getRNG().nextInt(16) - 8), 0.0D, (double) (worldIn.getActualHeight() - 1));
double d5 = entityLiving.posZ + (entityLiving.getRNG().nextDouble() - 0.5D) * 16.0D;
if (entityLiving.isRiding()) {
entityLiving.dismountRidingEntity();
}
if (entityLiving.attemptTeleport(d3, d4, d5)) {
worldIn.playSound((EntityPlayer) null, d0, d1, d2, SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, SoundCategory.PLAYERS, 1.0F, 1.0F);
entityLiving.playSound(SoundEvents.ITEM_CHORUS_FRUIT_TELEPORT, 1.0F, 1.0F);
break;
}
}
}
}
}
代码示例来源:origin: McJtyMods/DeepResonance
double desty;
if (random.nextFloat() > 0.5f) {
desty = world.getTopSolidOrLiquidBlock(new BlockPos((int) destx, world.getActualHeight(),(int) destz)).getY();
} else {
desty = centery + dist * Math.sin(phi);
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
heightCheck = 3;
int height = Math.min(pos.getY() + heightCheck, world.getActualHeight());
IBlockState block;
for (int i = pos.getY(); i < height; i++) {
代码示例来源:origin: ForestryMC/ForestryMC
posBlock = posBlock.add(offset);
if (posBlock.getY() <= 1 || posBlock.getY() >= world.getActualHeight()) {
continue;
内容来源于网络,如有侵权,请联系作者删除!