本文整理了Java中net.minecraft.block.Block.getWeakPower()
方法的一些代码示例,展示了Block.getWeakPower()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Block.getWeakPower()
方法的具体详情如下:
包路径:net.minecraft.block.Block
类名称:Block
方法名:getWeakPower
暂无
代码示例来源:origin: DimensionalDevelopment/VanillaFix
@Override
public int getWeakPower(IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
return block.getWeakPower(this, blockAccess, pos, side);
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void onNeighborChanged( IBlockAccess w, BlockPos pos, BlockPos neighbor )
{
if( !this.isOutput() )
{
final BlockPos target = this.getTile().getPos().offset( this.getSide().getFacing() );
final IBlockState state = this.getTile().getWorld().getBlockState( target );
final Block b = state.getBlock();
if( b != null && !this.isOutput() )
{
EnumFacing srcSide = this.getSide().getFacing();
if( b instanceof BlockRedstoneWire )
{
srcSide = EnumFacing.UP;
}
this.power = b.getWeakPower( state, this.getTile().getWorld(), target, srcSide );
this.power = Math.max( this.power, b.getWeakPower( state, this.getTile().getWorld(), target, srcSide ) );
this.sendToOutput( this.power );
}
else
{
this.sendToOutput( 0 );
}
}
}
代码示例来源:origin: DimensionalDevelopment/VanillaFix
@Override
public int getWeakPower(IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
return normalState.getBlock().getWeakPower(this, blockAccess, pos, side);
}
代码示例来源:origin: RS485/LogisticsPipes
@Override
@ModDependentMethod(modId = LPConstants.mcmpModID)
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
Block block = mcmpBlockAccess.getBlock();
return block != null ? block.getWeakPower(state, world, pos, side) : super.getWeakPower(state, world, pos, side);
}
代码示例来源:origin: MightyPirates/TIS-3D
@SuppressWarnings("deprecation")
@Override
public int getWeakPower(final IBlockState blockState, final IBlockAccess world, final BlockPos pos, final EnumFacing side) {
final TileEntity tileentity = world.getTileEntity(pos);
if (tileentity instanceof TileEntityCasing) {
final TileEntityCasing casing = (TileEntityCasing) tileentity;
final Module module = casing.getModule(Face.fromEnumFacing(side.getOpposite()));
if (module instanceof Redstone) {
return ((Redstone) module).getRedstoneOutput();
}
}
return super.getWeakPower(blockState, 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());
}
}
}
内容来源于网络,如有侵权,请联系作者删除!