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