當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。