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

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

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

Block.getLightValue介绍

暂无

代码示例

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

@Override
public int getLightValue( final IBlockState state, final IBlockAccess world, final BlockPos pos )
{
  if( state.getBlock() != this )
  {
    return state.getBlock().getLightValue( state, world, pos );
  }
  return this.cb( world, pos ).getLightValue();
}

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

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

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

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

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

@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos) {
  if (state.getValue(IS_ACTIVE)) {
    return 10;
  }
  return super.getLightValue(state, world, pos);
}

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

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

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

@Override
public int getLightValue(IBlockState state, IBlockAccess world, BlockPos pos)
{
  return state.getValue(LIT) ? super.getLightValue(state, world, pos) : 0;
}

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

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

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

@Override
public int getLightValue(@Nonnull IBlockState bs, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
 Block block = bs.getBlock();
 if (block != this) {
  return block.getLightValue(bs, world, pos);
 }
 return bs.getValue(ACTIVE) ? 15 : 0;
}

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

public static int getLightValue(
    final IBlockState state )
{
  return state.getBlock().getLightValue( state, new HarvestWorld( state ), BlockPos.ORIGIN );
}

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

@SuppressWarnings("unlikely-arg-type")
public static void addLightSource(IBlockAccess access, BlockPos pos, IBlockState state) {
  if(!(access instanceof World))
    return;
  
  World world = (World) access;
  ListIterator<LightSource> iterator = lightSources.listIterator();
  while(iterator.hasNext()) {
    LightSource src = iterator.next();
    if(src.equals(pos)) {
      if(!src.isValid(world))
        iterator.remove();
      else return;
    }
  }
  
  int brightness = state.getBlock().getLightValue(state, access, pos);
  lightSources.add(new LightSource(world, pos, state, brightness));
}

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

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

代码示例来源:origin: AlgorithmX2/Chisels-and-Bits

@Override
public int getLightValue(
    final IBlockState state,
    final IBlockAccess world,
    final BlockPos pos )
{
  // is this the right block?
  final IBlockState realState = world.getBlockState( pos );
  final Block realBlock = realState.getBlock();
  if ( realBlock != this )
  {
    return realBlock.getLightValue( realState, world, pos );
  }
  // enabled?
  if ( ChiselsAndBits.getConfig().enableBitLightSource )
  {
    try
    {
      return getTileEntity( world, pos ).getLightValue();
    }
    catch ( final ExceptionNoTileEntity e )
    {
      Log.noTileError( e );
    }
  }
  return 0;
}

代码示例来源:origin: McJtyMods/TheOneProbe

private void showDebugInfo(IProbeInfo probeInfo, World world, IBlockState blockState, BlockPos pos, Block block, EnumFacing side) {
    String simpleName = block.getClass().getSimpleName();
    IProbeInfo vertical = probeInfo.vertical(new LayoutStyle().borderColor(0xffff4444).spacing(2))
        .text(LABEL + "Reg Name: " + INFO + block.getRegistryName().toString())
        .text(LABEL + "Unlocname: " + INFO + block.getUnlocalizedName())
        .text(LABEL + "Meta: " + INFO + blockState.getBlock().getMetaFromState(blockState))
        .text(LABEL + "Class: " + INFO + simpleName)
        .text(LABEL + "Hardness: " + INFO + block.getBlockHardness(blockState, world, pos))
        .text(LABEL + "Power W: " + INFO + block.getWeakPower(blockState, world, pos, side.getOpposite())
            + LABEL + ", S: " + INFO + block.getStrongPower(blockState, world, pos, side.getOpposite()))
        .text(LABEL + "Light: " + INFO + block.getLightValue(blockState, world, pos));
    TileEntity te = world.getTileEntity(pos);
    if (te != null) {
      vertical.text(LABEL + "TE: " + INFO + te.getClass().getSimpleName());
    }
  }
}

相关文章

Block类方法