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


Java Blocks.redstone_wire方法代码示例

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


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

示例1: canConnectTo

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

    if (block == Blocks.redstone_wire)
    {
        return true;
    }
    else if (Blocks.unpowered_repeater.isAssociated(block))
    {
        EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING);
        return enumfacing == side || enumfacing.getOpposite() == side;
    }
    else
    {
        return block.canProvidePower() && side != null;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:19,代码来源:BlockRedstoneWire.java

示例2: getBlockPower

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
public int getBlockPower(BlockFace face) {
    int power = 0;
    BlockRedstoneWire wire = Blocks.redstone_wire;
    net.minecraft.world.World world = chunk.getHandle().worldObj;
    if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y - 1, z, 0)) power = wire.func_150178_a(world, x, y - 1, z, power);
    if ((face == BlockFace.UP || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y + 1, z, 1)) power = wire.func_150178_a(world, x, y + 1, z, power);
    if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.getIndirectPowerOutput(x + 1, y, z, 2)) power = wire.func_150178_a(world, x + 1, y, z, power);
    if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.getIndirectPowerOutput(x - 1, y, z, 3)) power = wire.func_150178_a(world, x - 1, y, z, power);
    if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y, z - 1, 4)) power = wire.func_150178_a(world, x, y, z - 1, power);
    if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.getIndirectPowerOutput(x, y, z + 1, 5)) power = wire.func_150178_a(world, x, y, z - 1, power);
    return power > 0 ? power : (face == BlockFace.SELF ? isBlockIndirectlyPowered() : isBlockFaceIndirectlyPowered(face)) ? 15 : 0;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:13,代码来源:CraftBlock.java

示例3: canConnectTo

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

	if (block == Blocks.redstone_wire) {
		return true;
	} else if (Blocks.unpowered_repeater.isAssociated(block)) {
		EnumFacing enumfacing = (EnumFacing) blockState.getValue(BlockRedstoneRepeater.FACING);
		return enumfacing == side || enumfacing.getOpposite() == side;
	} else {
		return block.canProvidePower() && side != null;
	}
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:BlockRedstoneWire.java

示例4: canHarvestBlock

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(Block blockIn)
{
    return blockIn == Blocks.web || blockIn == Blocks.redstone_wire || blockIn == Blocks.tripwire;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:8,代码来源:ItemShears.java

示例5: getPowerOnSide

import net.minecraft.init.Blocks; //导入方法依赖的package包/类
protected int getPowerOnSide(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);
    Block block = iblockstate.getBlock();
    return this.canPowerSide(block) ? (block == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side)) : 0;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:BlockRedstoneDiode.java


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