本文整理汇总了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;
}