本文整理匯總了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;
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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)));
}
示例7: isAlternateInput
import net.minecraft.block.state.IBlockState; //導入方法依賴的package包/類
protected boolean isAlternateInput(IBlockState state)
{
return state.canProvidePower();
}
示例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();
}
示例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;
}