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


Java IRedstonePart类代码示例

本文整理汇总了Java中codechicken.multipart.IRedstonePart的典型用法代码示例。如果您正苦于以下问题:Java IRedstonePart类的具体用法?Java IRedstonePart怎么用?Java IRedstonePart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: canConnectRedstone

import codechicken.multipart.IRedstonePart; //导入依赖的package包/类
@Override
public boolean canConnectRedstone(World world, Vec3i location, ForgeDirection side, ForgeDirection face) {

    if (!isMultipart(world, location))
        return false;

    int s = Direction.getMovementDirection(side.offsetX, side.offsetZ);

    TileMultipart tmp = TileMultipart.getOrConvertTile(world, new BlockCoord(location.getX(), location.getY(), location.getZ()));

    if (face == ForgeDirection.UNKNOWN)
        return tmp.canConnectRedstone(s);

    TMultiPart slotPart = tmp.partMap(side.ordinal());
    if (slotPart != null) {
        if (slotPart instanceof IRedstonePart)
            return ((IRedstonePart) slotPart).canConnectRedstone(side.ordinal());
        return false;
    }

    for (TMultiPart p : tmp.jPartList())
        if (p instanceof IRedstonePart && ((IRedstonePart) p).canConnectRedstone(s))
            return true;

    return false;
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:27,代码来源:FMPCompat.java

示例2: getStrongRedstoneOuput

import codechicken.multipart.IRedstonePart; //导入依赖的package包/类
@Override
public int getStrongRedstoneOuput(World world, Vec3i location, ForgeDirection side, ForgeDirection face) {

    TileMultipart tmp = TileMultipart.getOrConvertTile(world, new BlockCoord(location.getX(), location.getY(), location.getZ()));
    if (tmp == null)
        return 0;

    if (face == ForgeDirection.UNKNOWN) {
        if (side != ForgeDirection.UNKNOWN)
            return tmp.strongPowerLevel(side.ordinal());
        return 0;
    }

    TMultiPart slotPart = tmp.partMap(side.ordinal());
    if (slotPart != null) {
        if (slotPart instanceof IRedstonePart)
            return ((IRedstonePart) slotPart).strongPowerLevel(side.ordinal());
        return 0;
    }

    int strong = 0;

    for (TMultiPart p : tmp.jPartList())
        if (p instanceof IRedstonePart && p instanceof IFaceRedstonePart)
            if (((IFaceRedstonePart) p).getFace() == face.ordinal())
                strong = Math.max(strong, ((IRedstonePart) p).strongPowerLevel(side.ordinal()));

    return strong;
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:30,代码来源:FMPCompat.java

示例3: getWeakRedstoneOuput

import codechicken.multipart.IRedstonePart; //导入依赖的package包/类
@Override
public int getWeakRedstoneOuput(World world, Vec3i location, ForgeDirection side, ForgeDirection face) {

    TileMultipart tmp = TileMultipart.getOrConvertTile(world, new BlockCoord(location.getX(), location.getY(), location.getZ()));
    if (tmp == null)
        return 0;

    if (face == ForgeDirection.UNKNOWN) {
        if (side != ForgeDirection.UNKNOWN)
            return tmp.weakPowerLevel(side.ordinal());
        return 0;
    }

    TMultiPart slotPart = tmp.partMap(side.ordinal());
    if (slotPart != null) {
        if (slotPart instanceof IRedstonePart)
            return ((IRedstonePart) slotPart).weakPowerLevel(side.ordinal());
        return 0;
    }

    int weak = 0;

    for (TMultiPart p : tmp.jPartList())
        if (p instanceof IRedstonePart && p instanceof IFaceRedstonePart)
            if (((IFaceRedstonePart) p).getFace() == face.ordinal())
                weak = Math.max(weak, ((IRedstonePart) p).weakPowerLevel(side.ordinal()));

    return weak;
}
 
开发者ID:Qmunity,项目名称:QmunityLib,代码行数:30,代码来源:FMPCompat.java


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