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

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

本文整理了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

  1. private final int blockLight( final int emit )
  2. {
  3. if( this.opacity < 0 )
  4. {
  5. final TileEntity te = this.getTile();
  6. this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
  7. }
  8. return (int) ( emit * ( this.opacity / 255.0f ) );
  9. }

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

  1. private int blockLight( final int emit )
  2. {
  3. if( this.opacity < 0 )
  4. {
  5. final TileEntity te = this.getTile();
  6. this.opacity = 255 - te.getWorld().getBlockLightOpacity( te.getPos().offset( this.getSide().getFacing() ) );
  7. }
  8. return (int) ( emit * ( this.opacity / 255.0f ) );
  9. }

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

  1. @Override
  2. public void updateTick(World world, BlockPos pos, IBlockState state, Random rand) {
  3. if(!world.isRemote && state.getBlock() == this && world.getLight(pos.up()) >= 9) {
  4. AltGrassVariant variant = state.getValue(BotaniaStateProps.ALTGRASS_VARIANT);
  5. for(int l = 0; l < 4; ++l) {
  6. BlockPos pos1 = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);
  7. world.getBlockState(pos1.up()).getBlock();
  8. 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)
  9. world.setBlockState(pos1, getDefaultState().withProperty(BotaniaStateProps.ALTGRASS_VARIANT, variant), 1 | 2);
  10. }
  11. }
  12. }

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

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

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

  1. @Override
  2. public int getBlockLightOpacity(BlockPos pos) {
  3. return getActualWorld().getBlockLightOpacity(pos);
  4. }

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

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

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

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

相关文章

World类方法