当前位置: 首页>>代码示例>>Java>>正文


Java IBlockState.canProvidePower方法代码示例

本文整理汇总了Java中net.minecraft.block.state.IBlockState.canProvidePower方法的典型用法代码示例。如果您正苦于以下问题:Java IBlockState.canProvidePower方法的具体用法?Java IBlockState.canProvidePower怎么用?Java IBlockState.canProvidePower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.block.state.IBlockState的用法示例。


在下文中一共展示了IBlockState.canProvidePower方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isBasicBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isBasicBlock(IBlockAccess w, BlockPos p, IBlockState s) {
    int stateId = Block.getStateId(s);
    if (basicBlocks.contains(stateId)) {
        return true;
    }
    if (nonBasicBlocks.contains(stateId)) {
        return false;
    }
    boolean result = !s.getBlock().hasTileEntity(s) && !s.canProvidePower() && !s.hasComparatorInputOverride()
            && s.getProperties().entrySet().stream().allMatch(e -> allowedProperty(e.getKey()));

    if (result) {
        basicBlocks.add(stateId);
    } else {
        nonBasicBlocks.add(stateId);
    }
    return result;
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:19,代码来源:OpSetBasicBlock.java

示例2: canConnectTo

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected static boolean canConnectTo(IBlockState blockState, @Nullable EnumFacing side)
{
    Block block = blockState.getBlock();

    if (block == Blocks.REDSTONE_WIRE)
    {
        return true;
    }
    else if (Blocks.UNPOWERED_REPEATER.isSameDiode(blockState))
    {
        EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING);
        return enumfacing == side || enumfacing.getOpposite() == side;
    }
    else
    {
        return Blocks.field_190976_dk == blockState.getBlock() ? side == blockState.getValue(BlockObserver.FACING) : blockState.canProvidePower() && side != null;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:19,代码来源:BlockRedstoneWire.java

示例3: getWeakPower

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    if (!blockState.canProvidePower())
    {
        return 0;
    }
    else
    {
        int i = 0;
        TileEntity tileentity = blockAccess.getTileEntity(pos);

        if (tileentity instanceof TileEntityChest)
        {
            i = ((TileEntityChest)tileentity).numPlayersUsing;
        }

        return MathHelper.clamp(i, 0, 15);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:20,代码来源:BlockChest.java

示例4: getWeakPower

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public int getWeakPower(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side)
{
    if (!blockState.canProvidePower())
    {
        return 0;
    }
    else
    {
        int i = 0;
        TileEntity tileentity = blockAccess.getTileEntity(pos);

        if (tileentity instanceof TileEntityChest)
        {
            i = ((TileEntityChest)tileentity).numPlayersUsing;
        }

        return MathHelper.clamp_int(i, 0, 15);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:BlockChest.java

示例5: isNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
@Deprecated

    /**
     * Used for nearly all game logic (non-rendering) purposes. Use Forge-provided isNormalCube(IBlockAccess, BlockPos)
     * instead.
     */
    public boolean isNormalCube(IBlockState state)
    {
        return state.getMaterial().isOpaque() && state.isFullCube() && !state.canProvidePower();
    }
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:11,代码来源:Block.java

示例6: isValidEmptySpawnBlock

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public static boolean isValidEmptySpawnBlock(IBlockState state)
{
    return state.isBlockNormalCube() ? false : (state.canProvidePower() ? false : (state.getMaterial().isLiquid() ? false : !BlockRailBase.isRailBlock(state)));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:WorldEntitySpawner.java

示例7: isAlternateInput

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected boolean isAlternateInput(IBlockState state)
{
    return state.canProvidePower();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:5,代码来源:BlockRedstoneDiode.java

示例8: isNormalCube

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Used for nearly all game logic (non-rendering) purposes. Use Forge-provided isNormalCube(IBlockAccess, BlockPos)
 * instead.
 */
@Deprecated
public boolean isNormalCube(IBlockState state)
{
    return state.getMaterial().isOpaque() && state.isFullCube() && !state.canProvidePower();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:10,代码来源:Block.java

示例9: canConnectRedstone

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Determine if this block can make a redstone connection on the side provided,
 * Useful to control which sides are inputs and outputs for redstone wires.
 *
 * @param state The current state
 * @param world The current world
 * @param pos Block position in world
 * @param side The side that is trying to make the connection, CAN BE NULL
 * @return True to make the connection
 */
public boolean canConnectRedstone(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
{
    return state.canProvidePower() && side != null;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:Block.java


注:本文中的net.minecraft.block.state.IBlockState.canProvidePower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。