當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。