Search in sources :

Example 6 with EnumRailDirection

use of net.minecraft.block.BlockRailBase.EnumRailDirection in project Railcraft by Railcraft.

the class TrackKitSwitchTurnout method getActuatorLocation.

@Override
public EnumFacing getActuatorLocation() {
    EnumFacing face = EnumFacing.NORTH;
    EnumRailDirection dir = getRailDirectionRaw();
    if (dir == EnumRailDirection.NORTH_SOUTH) {
        face = isMirrored() ? EnumFacing.EAST : EnumFacing.WEST;
    } else if (dir == EnumRailDirection.EAST_WEST) {
        face = isMirrored() ? EnumFacing.SOUTH : EnumFacing.NORTH;
    }
    return face;
}
Also used : EnumRailDirection(net.minecraft.block.BlockRailBase.EnumRailDirection) EnumFacing(net.minecraft.util.EnumFacing)

Example 7 with EnumRailDirection

use of net.minecraft.block.BlockRailBase.EnumRailDirection in project Railcraft by Railcraft.

the class TrackKitSwitchTurnout method getCartsAtSpringEntrance.

@Override
protected List<UUID> getCartsAtSpringEntrance() {
    EnumRailDirection dir = getRailDirectionRaw();
    BlockPos offset = getPos();
    if (dir == EnumRailDirection.NORTH_SOUTH) {
        offset = isMirrored() ? offset.west() : offset.east();
    } else if (dir == EnumRailDirection.EAST_WEST) {
        offset = isMirrored() ? offset.north() : offset.south();
    }
    return CartTools.getMinecartUUIDsAt(theWorldAsserted(), offset, 0.1f);
}
Also used : EnumRailDirection(net.minecraft.block.BlockRailBase.EnumRailDirection) BlockPos(net.minecraft.util.math.BlockPos)

Example 8 with EnumRailDirection

use of net.minecraft.block.BlockRailBase.EnumRailDirection in project Railcraft by Railcraft.

the class TrackKitSwitchTurnout method getCartsAtLockEntrance.

@Override
protected List<UUID> getCartsAtLockEntrance() {
    EnumRailDirection dir = getRailDirectionRaw();
    BlockPos offset = getPos();
    if (dir == EnumRailDirection.NORTH_SOUTH) {
        offset = isReversed() != isMirrored() ? offset.south() : offset.north();
    } else if (dir == EnumRailDirection.EAST_WEST) {
        offset = isReversed() == isMirrored() ? offset.east() : offset.west();
    }
    return CartTools.getMinecartUUIDsAt(theWorldAsserted(), offset, 0.1f);
}
Also used : EnumRailDirection(net.minecraft.block.BlockRailBase.EnumRailDirection) BlockPos(net.minecraft.util.math.BlockPos)

Example 9 with EnumRailDirection

use of net.minecraft.block.BlockRailBase.EnumRailDirection in project Railcraft by Railcraft.

the class TrackKitSwitchWye method getCartsAtLockEntrance.

@Override
protected List<UUID> getCartsAtLockEntrance() {
    EnumRailDirection dir = getRailDirectionRaw();
    BlockPos offset = getPos();
    if (dir == EnumRailDirection.EAST_WEST) {
        if (isMirrored()) {
            offset = offset.west();
        } else {
            offset = offset.east();
        }
    } else if (dir == EnumRailDirection.NORTH_SOUTH) {
        if (isMirrored()) {
            offset = offset.south();
        } else {
            offset = offset.north();
        }
    }
    return CartTools.getMinecartUUIDsAt(theWorldAsserted(), offset, 0.1f);
}
Also used : EnumRailDirection(net.minecraft.block.BlockRailBase.EnumRailDirection) BlockPos(net.minecraft.util.math.BlockPos)

Example 10 with EnumRailDirection

use of net.minecraft.block.BlockRailBase.EnumRailDirection in project Railcraft by Railcraft.

the class TrackKitSwitchWye method getCartsAtDecisionEntrance.

@Override
protected List<UUID> getCartsAtDecisionEntrance() {
    EnumRailDirection dir = getRailDirectionRaw();
    BlockPos offset = getPos();
    if (dir == EnumRailDirection.EAST_WEST) {
        if (isMirrored()) {
            offset = offset.north();
        } else {
            offset = offset.south();
        }
    } else if (dir == EnumRailDirection.NORTH_SOUTH) {
        if (isMirrored()) {
            offset = offset.west();
        } else {
            offset = offset.east();
        }
    }
    return CartTools.getMinecartUUIDsAt(theWorldAsserted(), offset, 0.1f);
}
Also used : EnumRailDirection(net.minecraft.block.BlockRailBase.EnumRailDirection) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

EnumRailDirection (net.minecraft.block.BlockRailBase.EnumRailDirection)15 BlockPos (net.minecraft.util.math.BlockPos)8 IBlockState (net.minecraft.block.state.IBlockState)2 EnumFacing (net.minecraft.util.EnumFacing)2 World (net.minecraft.world.World)2 HashSet (java.util.HashSet)1 EntityLocomotive (mods.railcraft.common.carts.EntityLocomotive)1 Vec3d (net.minecraft.util.math.Vec3d)1