本文整理匯總了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;
}