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

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

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

World.isAreaLoaded介绍

暂无

代码示例

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull BlockPos center, int radius, boolean allowEmpty) {
  3. return wrapped.isAreaLoaded(center, radius, allowEmpty);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull StructureBoundingBox box) {
  3. return wrapped.isAreaLoaded(box);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull BlockPos center, int radius) {
  3. return wrapped.isAreaLoaded(center, radius);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull StructureBoundingBox box, boolean allowEmpty) {
  3. return wrapped.isAreaLoaded(box, allowEmpty);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull BlockPos from, @Nonnull BlockPos to, boolean allowEmpty) {
  3. return wrapped.isAreaLoaded(from, to, allowEmpty);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(@Nonnull BlockPos from, @Nonnull BlockPos to) {
  3. return wrapped.isAreaLoaded(from, to);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(BlockPos center, int radius) {
  3. return getActualWorld().isAreaLoaded(center, radius);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(BlockPos from, BlockPos to, boolean allowEmpty) {
  3. return getActualWorld().isAreaLoaded(from, to, allowEmpty);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(BlockPos center, int radius, boolean allowEmpty) {
  3. return getActualWorld().isAreaLoaded(center, radius, allowEmpty);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(BlockPos from, BlockPos to) {
  3. return getActualWorld().isAreaLoaded(from, to);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(StructureBoundingBox box) {
  3. return getActualWorld().isAreaLoaded(box);
  4. }

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

  1. @Override
  2. public boolean isAreaLoaded(StructureBoundingBox box, boolean allowEmpty) {
  3. return getActualWorld().isAreaLoaded(box, allowEmpty);
  4. }

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

  1. @Override
  2. public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
  3. if (!worldIn.isRemote) {
  4. super.updateTick(worldIn, pos, state, rand);
  5. if (!worldIn.isAreaLoaded(pos, 1))
  6. return;
  7. if (worldIn.getLightFromNeighbors(pos.up()) >= 9 && rand.nextInt(7) == 0) {
  8. this.grow(worldIn, rand, pos, state);
  9. }
  10. }
  11. }

代码示例来源:origin: PrinceOfAmber/Cyclic

  1. private boolean isTargetValid(BlockPosDim target) {
  2. return target != null &&
  3. target.dimension == this.getDimension() &&
  4. world.isAreaLoaded(target.toBlockPos(), target.toBlockPos().up());
  5. }

代码示例来源:origin: PrinceOfAmber/Cyclic

  1. private boolean isTargetValid(BlockPosDim target) {
  2. return target != null &&
  3. target.dimension == this.getDimension() &&
  4. world.isAreaLoaded(target.toBlockPos(), target.toBlockPos().up());
  5. }

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

  1. public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
  2. if (!worldIn.isAreaLoaded(pos, 4))
  3. return; // Forge: avoid loading unloaded chunks
  4. Set<EnumFacing> flowDirections = this.getPossibleFlowDirections(worldIn, pos);
  5. for (EnumFacing direction : flowDirections) {
  6. tryFlowInto(worldIn, pos.offset(direction), worldIn.getBlockState(pos.offset(direction)), 8);
  7. }
  8. }

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

  1. @Override
  2. public void breakBlock(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnull IBlockState state) {
  3. int k = pos.getX();
  4. int l = pos.getY();
  5. int i1 = pos.getZ();
  6. if (worldIn.isAreaLoaded(new BlockPos(k - 2, l - 2, i1 - 2), new BlockPos(k + 2, l + 2, i1 + 2))) {
  7. for (int j1 = -1; j1 <= 1; ++j1) {
  8. for (int k1 = -1; k1 <= 1; ++k1) {
  9. for (int l1 = -1; l1 <= 1; ++l1) {
  10. BlockPos blockpos = pos.add(j1, k1, l1);
  11. IBlockState iblockstate = worldIn.getBlockState(blockpos);
  12. if (iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos)) {
  13. iblockstate.getBlock().beginLeavesDecay(iblockstate, worldIn, blockpos);
  14. }
  15. }
  16. }
  17. }
  18. }
  19. }

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

  1. @Override
  2. public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
  3. if (worldIn.isAreaLoaded(pos.add(-5, -5, -5), pos.add(5, 5, 5))) {
  4. for (BlockPos blockpos : BlockPos.getAllInBox(pos.add(-4, -4, -4), pos.add(4, 4, 4))) {
  5. IBlockState iblockstate = worldIn.getBlockState(blockpos);
  6. if (iblockstate.getBlock().isLeaves(iblockstate, worldIn, blockpos)) {
  7. iblockstate.getBlock().beginLeavesDecay(iblockstate, worldIn, blockpos);
  8. }
  9. }
  10. }
  11. }

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

  1. protected void checkFallable(@Nonnull World worldIn, @Nonnull BlockPos pos) {
  2. if ((worldIn.isAirBlock(pos.down()) || BlockFalling.canFallThrough(worldIn.getBlockState(pos.down()))) && pos.getY() >= 0) {
  3. if (!BlockFalling.fallInstantly && worldIn.isAreaLoaded(pos.add(-32, -32, -32), pos.add(32, 32, 32))) {
  4. worldIn.spawnEntity(new EntityFallingMachine(worldIn, pos, this));
  5. } else {
  6. IBlockState state = worldIn.getBlockState(pos);
  7. worldIn.setBlockToAir(pos);
  8. BlockPos blockpos;
  9. for (blockpos = pos.down(); (worldIn.isAirBlock(blockpos) || BlockFalling.canFallThrough(worldIn.getBlockState(blockpos)))
  10. && blockpos.getY() > 0; blockpos = blockpos.down()) {
  11. }
  12. if (blockpos.getY() > 0) {
  13. worldIn.setBlockState(blockpos.up(), state);
  14. }
  15. }
  16. }
  17. }

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

  1. private void checkFallable(World worldIn, BlockPos pos) {
  2. if((worldIn.isAirBlock(pos.down()) || BlockFalling.canFallThrough(worldIn.getBlockState(pos.down()))) && pos.getY() >= 0) {
  3. int i = 32;
  4. if(!BlockFalling.fallInstantly && worldIn.isAreaLoaded(pos.add(-32, -32, -32), pos.add(32, 32, 32))) {
  5. if(!worldIn.isRemote) {
  6. EntityFallingBlock entityfallingblock = new EntityFallingBlock(worldIn, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, worldIn.getBlockState(pos));
  7. worldIn.spawnEntity(entityfallingblock);
  8. }
  9. } else {
  10. IBlockState state = worldIn.getBlockState(pos);
  11. worldIn.setBlockToAir(pos);
  12. BlockPos blockpos;
  13. for(blockpos = pos.down(); (worldIn.isAirBlock(blockpos) || BlockFalling.canFallThrough(worldIn.getBlockState(blockpos))) && blockpos.getY() > 0; blockpos = blockpos.down());
  14. if(blockpos.getY() > 0)
  15. worldIn.setBlockState(blockpos.up(), state);
  16. }
  17. }
  18. }

相关文章

World类方法