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

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

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

Block.getLightOpacity介绍

暂无

代码示例

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

@Override
public int getLightOpacity() {
  return block.getLightOpacity(this);
}

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

@Override
public int getLightOpacity(IBlockAccess world, BlockPos pos) {
  return block.getLightOpacity(this, world, pos);
}

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

@Override
@Deprecated
public int getLightOpacity() {
  return normalState.getBlock().getLightOpacity(this);
}

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

@Override
public int getLightOpacity(IBlockAccess world, BlockPos pos) {
  return normalState.getBlock().getLightOpacity(this, world, pos);
}

代码示例来源:origin: Electrical-Age/ElectricalAge

@Override
public int getLightOpacity(IBlockAccess w, int x, int y, int z) {
  TileEntity e = w.getTileEntity(x, y, z);
  if (e == null) return 0;
  SixNodeEntity sne = (SixNodeEntity) e;
  Block b = sne.sixNodeCacheBlock;
  if (b == Blocks.air) return 0;
  // return b.getIcon(w, x, y, z, side);
  try {
    return b.getLightOpacity();
  } catch (Exception e2) {
    return 255;
  }
}

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

private boolean isClear(@Nonnull World w, @Nonnull IBlockState bs, @Nonnull Block block, @Nonnull BlockPos bp) {
 if (block.isAir(bs, w, bp)) {
  return true;
 }
 final AxisAlignedBB aabb = bs.getBoundingBox(w, bp);
 if (aabb.getAverageEdgeLength() < 0.7) {
  return true;
 }
 return block.getLightOpacity(bs, w, bp) < 2;
}

代码示例来源:origin: RS485/LogisticsPipes

@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public int getLightOpacity(IBlockState state, IBlockAccess world, BlockPos pos) {
  Block block = mcmpBlockAccess.getBlock();
  return block != null ? block.getLightOpacity(state, world, pos) : super.getLightOpacity(state, world, pos);
}

代码示例来源:origin: TeamLapen/Vampirism

public static boolean canBlockSeeSun(World world, BlockPos pos) {
  if (pos.getY() >= world.getSeaLevel()) {
    return world.canSeeSky(pos);
  } else {
    BlockPos blockpos = new BlockPos(pos.getX(), world.getSeaLevel(), pos.getZ());
    if (!world.canSeeSky(blockpos)) {
      return false;
    } else {
      int liquidBlocks = 0;
      for (blockpos = blockpos.down(); blockpos.getY() > pos.getY(); blockpos = blockpos.down()) {
        IBlockState iblockstate = world.getBlockState(blockpos);
        if (iblockstate.getBlock().getLightOpacity(iblockstate, world, blockpos) > 0) {
          if (iblockstate.getMaterial().isLiquid()) {
            liquidBlocks++;
            if (liquidBlocks >= Balance.vp.SUNDAMAGE_WATER_BLOCKS) {
              return false;
            }
          } else {
            return false;
          }
        }
      }
      return true;
    }
  }
}

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

return;
int opacity = tempState.getBlock().getLightOpacity(tempState, world, setPos);
boolean neighborBrightness = tempState.getBlock().getUseNeighborBrightness(tempState);
if (opacity == 255 || neighborBrightness) {

相关文章

Block类方法