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

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

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

Block.getStrongPower介绍

暂无

代码示例

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

@Override
public int getStrongPower(IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
  return block.getStrongPower(this, blockAccess, pos, side);
}

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

@Override
public int getStrongPower(IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
  return normalState.getBlock().getStrongPower(this, blockAccess, pos, side);
}

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

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

代码示例来源: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());
    }
  }
}

代码示例来源:origin: PrinceOfAmber/Cyclic

@SuppressWarnings("deprecation")
public void onCorrectPassword(World world) {
 Block me = this.getBlockType();
 IBlockState blockState = world.getBlockState(this.getPos());
 switch (this.type) {
  case PULSE:
   world.setBlockState(this.getPos(), me.getDefaultState().withProperty(BlockPassword.POWERED, true));
   this.powerTimeout = Const.TICKS_PER_SEC / 2;
  break;
  case TOGGLE:
   boolean hasPowerHere = me.getStrongPower(blockState, world, this.getPos(), EnumFacing.UP) > 0;
   world.setBlockState(this.getPos(), me.getDefaultState().withProperty(BlockPassword.POWERED, !hasPowerHere));
  break;
  default:
  break;
 }
}

相关文章

Block类方法