net.minecraft.block.Block.doesSideBlockRendering()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(130)

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

Block.doesSideBlockRendering介绍

暂无

代码示例

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side) {
  return block.doesSideBlockRendering(this, world, pos, side);
}
// </editor-fold>

代码示例来源:origin: DimensionalDevelopment/VanillaFix

@Override
public boolean doesSideBlockRendering(IBlockAccess world, BlockPos pos, EnumFacing side) {
  return normalState.getBlock().doesSideBlockRendering(this, world, pos, side);
}

代码示例来源:origin: Direwolf20-MC/BuildingGadgets

@Override
public boolean doesSideBlockRendering(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing face) {
  IBlockState mimicBlock = getActualMimicBlock(world, pos);
  return mimicBlock == null ? true : mimicBlock.getBlock().doesSideBlockRendering(mimicBlock, world, pos, face);
}

代码示例来源:origin: MightyPirates/TIS-3D

/**
 * Convenience check for determining whether a module is actually visible.
 * <p>
 * This can allow for some optimizations, such as sending state updates
 * much more or infrequently (or not at all) while invisible. If rendering
 * a module's overlay is exceptionally complex,
 *
 * @return whether the module is currently visible.
 */
protected boolean isVisible() {
  final World world = getCasing().getCasingWorld();
  final BlockPos neighborPos = getCasing().getPosition().offset(Face.toEnumFacing(getFace()));
  if (!world.isBlockLoaded(neighborPos)) {
    // If the neighbor isn't loaded, we can assume we're also not visible on that side.
    return false;
  }
  final Chunk chunk = world.getChunkFromBlockCoords(neighborPos);
  if (chunk.isEmpty()) {
    // If the neighbor chunk is empty, we must assume we're visible.
    return true;
  }
  // Otherwise check if the neighboring block blocks visibility to our face.
  final IBlockState neighborState = world.getBlockState(neighborPos);
  final Block neighborBlock = neighborState.getBlock();
  return !neighborBlock.doesSideBlockRendering(neighborState, world, neighborPos, Face.toEnumFacing(getFace().getOpposite()));
}

相关文章

Block类方法