Search in sources :

Example 6 with PartWireBase

use of pl.asie.charset.wires.logic.PartWireBase in project Charset by CharsetMC.

the class WireUtils method canConnectInternal.

public static boolean canConnectInternal(PartWireBase wire, WireFace side) {
    WireFace location = wire.location;
    IMultipartContainer container = wire.getContainer();
    if (side == location) {
        return false;
    }
    if (side != WireFace.CENTER && location != WireFace.CENTER) {
        if (isBlockingPart(container, PartSlot.getEdgeSlot(side.facing, location.facing))) {
            return false;
        }
    }
    PartWireBase wire2 = getWire(container, side);
    return wire2 != null && wire2.type.connects(wire.type);
}
Also used : PartWireBase(pl.asie.charset.wires.logic.PartWireBase) IMultipartContainer(mcmultipart.multipart.IMultipartContainer) WireFace(pl.asie.charset.api.wires.WireFace)

Aggregations

PartWireBase (pl.asie.charset.wires.logic.PartWireBase)6 IMultipartContainer (mcmultipart.multipart.IMultipartContainer)4 Block (net.minecraft.block.Block)2 BlockPos (net.minecraft.util.BlockPos)2 ArrayList (java.util.ArrayList)1 IMultipart (mcmultipart.multipart.IMultipart)1 IRedstonePart (mcmultipart.multipart.IRedstonePart)1 BlockRedstoneWire (net.minecraft.block.BlockRedstoneWire)1 IBlockState (net.minecraft.block.state.IBlockState)1 BakedQuad (net.minecraft.client.renderer.block.model.BakedQuad)1 EnumFacing (net.minecraft.util.EnumFacing)1 IExtendedBlockState (net.minecraftforge.common.property.IExtendedBlockState)1 WireFace (pl.asie.charset.api.wires.WireFace)1