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

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

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

World.getBlockLightOpacity介绍

暂无

代码示例

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

private final int blockLight( final int emit )
{
  if( this.opacity < 0 )
  {
    final TileEntity te = this.getTile();
    this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
  }
  return (int) ( emit * ( this.opacity / 255.0f ) );
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

private int blockLight( final int emit )
{
  if( this.opacity < 0 )
  {
    final TileEntity te = this.getTile();
    this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
  }
  return (int) ( emit * ( this.opacity / 255.0f ) );
}

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

@Override
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
  if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) {
    AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT);
    for(int l = 0; l < 4; ++l) {
      BlockPos pos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);
      world.getBlockState(pos1.up()).getBlock();
      if(world.getBlockState(pos1).getBlock() == Blocks.DIRT && world.getBlockState(pos1).getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && world.getLight(pos1.up()) >= 4 && world.getBlockLightOpacity(pos1.up()) <= 2)
        world.setBlockState(pos1, getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, variant), 1 | 2);
    }
  }
}

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

@Override
public int getBlockLightOpacity(@Nonnull BlockPos pos) {
 return wrapped.getBlockLightOpacity(pos);
}

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

@Override
public int getBlockLightOpacity(BlockPos pos) {
  return getActualWorld().getBlockLightOpacity(pos);
}

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

private boolean isTransparent(Vector3d offset) {
 return world.getBlockLightOpacity(new BlockPos(getPos().getX() + (int) offset.x, getPos().getY() + (int) offset.y, getPos().getZ() + (int) offset.z)) == 0;
}

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

double opacity = world.getBlockLightOpacity((int) x, (int) y, (int) z);
light *= (255 - opacity) / 255;
if (light == 0.0) {

相关文章

微信公众号

最新文章

更多

World类方法