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