本文整理汇总了Java中net.minecraft.world.World.getRedstonePower方法的典型用法代码示例。如果您正苦于以下问题:Java World.getRedstonePower方法的具体用法?Java World.getRedstonePower怎么用?Java World.getRedstonePower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.world.World
的用法示例。
在下文中一共展示了World.getRedstonePower方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateInputStrength
import net.minecraft.world.World; //导入方法依赖的package包/类
protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
int i = worldIn.getRedstonePower(blockpos, enumfacing);
if (i >= 15)
{
return i;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(blockpos);
return Math.max(i, iblockstate.getBlock() == Blocks.redstone_wire ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0);
}
}
示例2: calculateInputStrength
import net.minecraft.world.World; //导入方法依赖的package包/类
protected int calculateInputStrength(World worldIn, BlockPos pos, IBlockState state)
{
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
int i = worldIn.getRedstonePower(blockpos, enumfacing);
if (i >= 15)
{
return i;
}
else
{
IBlockState iblockstate = worldIn.getBlockState(blockpos);
return Math.max(i, iblockstate.getBlock() == Blocks.REDSTONE_WIRE ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0);
}
}
示例3: canAdvance
import net.minecraft.world.World; //导入方法依赖的package包/类
@Override
public boolean canAdvance(World world, BlockPos pos, IBlockState state) {
for (EnumFacing facing : EnumFacing.VALUES) {
int powersignal = world.getRedstonePower(pos.offset(facing), facing);
if (powersignal >= 8)
return true;
}
return false;
}
示例4: calculateInputStrength
import net.minecraft.world.World; //导入方法依赖的package包/类
protected static int calculateInputStrength(World worldIn, BlockPos pos, EnumFacing enumfacing) {
IBlockState adjacentState = worldIn.getBlockState(pos);
Block block = adjacentState.getBlock();
int i = worldIn.getRedstonePower(pos, enumfacing);
if (i >= 15) {
return 15;
}
int redstoneWirePower = 0;
if (block == Blocks.REDSTONE_WIRE) {
redstoneWirePower = adjacentState.getValue(BlockRedstoneWire.POWER);
}
return Math.max(i, redstoneWirePower);
}
示例5: getRedstoneLevel
import net.minecraft.world.World; //导入方法依赖的package包/类
/**
* Returns the redstone level for the given face at the given position. Use this to check redstone signal level
* on a specific face of a block.
*
* @param world the world
* @param pos the position
* @param face the face to check
* @return the redstone level
*/
public static int getRedstoneLevel(World world, BlockPos pos, EnumFacing face) {
return world.getRedstonePower(pos, face);
}