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


Java IBlockState.isNormalCube方法代码示例

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


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

示例1: getAttachPosition

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private BlockSaltBarrier.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, EnumFacing direction) {
	final BlockPos blockpos = pos.offset(direction);
	final IBlockState iblockstate = worldIn.getBlockState(pos.offset(direction));

	if (!canConnectTo(worldIn.getBlockState(blockpos)) && (iblockstate.isNormalCube() || !canConnectUpwardsTo(worldIn, blockpos.down()))) {
		final IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

		if (!iblockstate1.isNormalCube()) {
			final boolean flag = worldIn.getBlockState(blockpos).isSideSolid(worldIn, blockpos, EnumFacing.UP) || worldIn.getBlockState(blockpos).getBlock() == Blocks.GLOWSTONE;

			if (flag && canConnectUpwardsTo(worldIn, blockpos.up())) {
				if (iblockstate.isBlockNormalCube()) {
					return BlockSaltBarrier.EnumAttachPosition.UP;
				}

				return BlockSaltBarrier.EnumAttachPosition.SIDE;
			}
		}

		return BlockSaltBarrier.EnumAttachPosition.NONE;
	} else {
		return BlockSaltBarrier.EnumAttachPosition.SIDE;
	}
}
 
开发者ID:Um-Mitternacht,项目名称:Bewitchment,代码行数:25,代码来源:BlockSaltBarrier.java

示例2: updateComparatorOutputLevel

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public void updateComparatorOutputLevel(BlockPos pos, Block blockIn)
{
    for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
    {
        BlockPos blockpos = pos.offset(enumfacing);

        if (this.isBlockLoaded(blockpos))
        {
            IBlockState iblockstate = this.getBlockState(blockpos);

            if (Blocks.UNPOWERED_COMPARATOR.isSameDiode(iblockstate))
            {
                iblockstate.neighborChanged(this, blockpos, blockIn, pos);
            }
            else if (iblockstate.isNormalCube())
            {
                blockpos = blockpos.offset(enumfacing);
                iblockstate = this.getBlockState(blockpos);

                if (Blocks.UNPOWERED_COMPARATOR.isSameDiode(iblockstate))
                {
                    iblockstate.neighborChanged(this, blockpos, blockIn, pos);
                }
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:World.java

示例3: getAttachPosition

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, EnumFacing direction)
{
    BlockPos blockpos = pos.offset(direction);
    IBlockState iblockstate = worldIn.getBlockState(pos.offset(direction));

    if (!canConnectTo(worldIn.getBlockState(blockpos), direction) && (iblockstate.isNormalCube() || !canConnectUpwardsTo(worldIn.getBlockState(blockpos.down()))))
    {
        IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

        if (!iblockstate1.isNormalCube())
        {
            boolean flag = worldIn.getBlockState(blockpos).isFullyOpaque() || worldIn.getBlockState(blockpos).getBlock() == Blocks.GLOWSTONE;

            if (flag && canConnectUpwardsTo(worldIn.getBlockState(blockpos.up())))
            {
                if (iblockstate.isBlockNormalCube())
                {
                    return BlockRedstoneWire.EnumAttachPosition.UP;
                }

                return BlockRedstoneWire.EnumAttachPosition.SIDE;
            }
        }

        return BlockRedstoneWire.EnumAttachPosition.NONE;
    }
    else
    {
        return BlockRedstoneWire.EnumAttachPosition.SIDE;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:BlockRedstoneWire.java

示例4: isPowerSourceAt

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isPowerSourceAt(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    BlockPos blockpos = pos.offset(side);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    boolean flag = iblockstate.isNormalCube();
    boolean flag1 = worldIn.getBlockState(pos.up()).isNormalCube();
    return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (iblockstate.getBlock() == Blocks.POWERED_REPEATER && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down())));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:BlockRedstoneWire.java

示例5: calculateInputStrength

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state)
{
    int i = super.calculateInputStrength(worldIn, pos, state);
    EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
    BlockPos blockpos = pos.offset(enumfacing);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);

    if (iblockstate.hasComparatorInputOverride())
    {
        i = iblockstate.getComparatorInputOverride(worldIn, blockpos);
    }
    else if (i < 15 && iblockstate.isNormalCube())
    {
        blockpos = blockpos.offset(enumfacing);
        iblockstate = worldIn.getBlockState(blockpos);

        if (iblockstate.hasComparatorInputOverride())
        {
            i = iblockstate.getComparatorInputOverride(worldIn, blockpos);
        }
        else if (iblockstate.getMaterial() == Material.AIR)
        {
            EntityItemFrame entityitemframe = this.findItemFrame(worldIn, enumfacing, blockpos);

            if (entityitemframe != null)
            {
                i = entityitemframe.getAnalogOutput();
            }
        }
    }

    return i;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:34,代码来源:BlockRedstoneComparator.java

示例6: getAttachPosition

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, EnumFacing direction)
{
    BlockPos blockpos = pos.offset(direction);
    IBlockState iblockstate = worldIn.getBlockState(pos.offset(direction));

    if (!canConnectTo(worldIn.getBlockState(blockpos), direction, worldIn, blockpos) && (iblockstate.isNormalCube() || !canConnectUpwardsTo(worldIn, blockpos.down())))
    {
        IBlockState iblockstate1 = worldIn.getBlockState(pos.up());

        if (!iblockstate1.isNormalCube())
        {
            boolean flag = worldIn.getBlockState(blockpos).isSideSolid(worldIn, blockpos, EnumFacing.UP) || worldIn.getBlockState(blockpos).getBlock() == Blocks.GLOWSTONE;

            if (flag && canConnectUpwardsTo(worldIn, blockpos.up()))
            {
                if (iblockstate.isBlockNormalCube())
                {
                    return BlockRedstoneWire.EnumAttachPosition.UP;
                }

                return BlockRedstoneWire.EnumAttachPosition.SIDE;
            }
        }

        return BlockRedstoneWire.EnumAttachPosition.NONE;
    }
    else
    {
        return BlockRedstoneWire.EnumAttachPosition.SIDE;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:32,代码来源:BlockRedstoneWire.java

示例7: isPowerSourceAt

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isPowerSourceAt(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    BlockPos blockpos = pos.offset(side);
    IBlockState iblockstate = worldIn.getBlockState(blockpos);
    boolean flag = iblockstate.isNormalCube();
    boolean flag1 = worldIn.getBlockState(pos.up()).isNormalCube();
    return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side, worldIn, pos) ? true : (iblockstate.getBlock() == Blocks.POWERED_REPEATER && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down())));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:9,代码来源:BlockRedstoneWire.java

示例8: isMostlyEmpty

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
private boolean isMostlyEmpty(BlockPos p) {
    IBlockState block = getStateAt(getWorld(this),p);
    return !block.isNormalCube()
        && !getStateAt(getWorld(this), p.offset(EnumFacing.UP)).isNormalCube();
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:6,代码来源:DummyPlayer.java

示例9: getRedstonePower

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
public int getRedstonePower(BlockPos pos, EnumFacing facing)
{
    IBlockState iblockstate = this.getBlockState(pos);
    return iblockstate.isNormalCube() ? this.getStrongPower(pos) : iblockstate.getWeakPower(this, pos, facing);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:World.java

示例10: shouldCheckWeakPower

import net.minecraft.block.state.IBlockState; //导入方法依赖的package包/类
/**
 * Called to determine whether to allow the a block to handle its own indirect power rather than using the default rules.
 * @param world The world
 * @param pos Block position in world
 * @param side The INPUT side of the block to be powered - ie the opposite of this block's output side
 * @return Whether Block#isProvidingWeakPower should be called when determining indirect power
 */
public boolean shouldCheckWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
{
    return state.isNormalCube();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:Block.java


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