Package mods.railcraft.api.core

Examples of mods.railcraft.api.core.WorldCoordinate


    public static WorldCoordinate getTarget(EntityPlayer player) {
        return sentinelPairingMap.get(player);
    }

    public static void setTarget(RailcraftTileEntity tile, EntityPlayer player) {
        sentinelPairingMap.put(player, new WorldCoordinate(tile));
        ChatPlugin.sendLocalizedChatFromClient(player, "railcraft.gui.anchor.pair.start", tile.getName());
    }
View Full Code Here


//        super.startPairing();
//    }
    public boolean createSignalBlock(SignalBlock other) {
        locateTrack();
        other.locateTrack();
        WorldCoordinate tA = getTrackLocation();
        WorldCoordinate tB = other.getTrackLocation();
        if (tA == null || tB == null)
            return false;
        if (!TrackTools.areTracksConnectedAlongAxis(tile.getWorldObj(), tA.x, tA.y, tA.z, tB.x, tB.y, tB.z))
            return false;
        addPairing(other.getCoords());
View Full Code Here

        SignalAspect myAspect = determineMyAspect(otherCoord);
        return SignalAspect.mostRestrictive(myAspect, otherAspect);
    }

    private SignalAspect determineMyAspect(WorldCoordinate otherCoord) {
        WorldCoordinate myTrack = getTrackLocation();
        if (myTrack == null)
            return SignalAspect.RED;
        WorldCoordinate otherTrack = getOtherTrackLocation(otherCoord);
        if (otherTrack == null)
            return SignalAspect.YELLOW;
        int x1 = Math.min(myTrack.x, otherTrack.x);
        int y1 = Math.min(myTrack.y, otherTrack.y);
        int z1 = Math.min(myTrack.z, otherTrack.z);
View Full Code Here

    }

    protected WorldCoordinate getOtherTrackLocation(WorldCoordinate otherCoord) {
        SignalBlock other = getSignalAt(otherCoord);
        if (other != null) {
            WorldCoordinate track = other.getTrackLocation();
            trackCache.put(otherCoord, track);
            return track;
        }
        return trackCache.get(otherCoord);
    }
View Full Code Here

    private boolean isSignalBlockValid(WorldCoordinate other) {
        if (other == null)
            return true;
        if (getSignalAt(other) == null)
            return true;
        WorldCoordinate tA = getTrackLocation();
        WorldCoordinate tB = getOtherTrackLocation(other);
        if (tA == null || tB == null)
            return false;
        if (!TrackTools.areTracksConnectedAlongAxis(tile.getWorldObj(), tA.x, tA.y, tA.z, tB.x, tB.y, tB.z))
            return false;
        return true;
View Full Code Here

        World world = tile.getWorldObj();
        for (int jj = -2; jj < 4; jj++) {
            if (!world.blockExists(x, y - jj, z))
                return Status.UNKNOWN;
            if (TrackTools.isRailBlockAt(world, x, y - jj, z)) {
                trackLocation = new WorldCoordinate(world.provider.dimensionId, x, y - jj, z);
                return Status.VALID;
            }
        }
        return Status.INVALID;
    }
View Full Code Here

            if (tile instanceof ISignalBlockTile) {
//            System.out.println("target found");
                if (Game.isHost(world)) {
                    ISignalBlockTile signalTile = (ISignalBlockTile) tile;
                    SignalBlock signalBlock = signalTile.getSignalBlock();
                    WorldCoordinate pos = null;
                    NBTTagCompound data = item.getTagCompound();
                    if (data != null) {
                        int sDim = data.getInteger("signalDim");
                        int sx = data.getInteger("signalX");
                        int sy = data.getInteger("signalY");
                        int sz = data.getInteger("signalZ");
                        pos = new WorldCoordinate(sDim, sx, sy, sz);
                    }
                    WorldCoordinate track = signalBlock.getTrackLocation();
                    if (track == null)
                        ChatPlugin.sendLocalizedChat(player, "railcraft.gui.surveyor.track", signalTile.getName());
                    else if (pos == null) {
                        ChatPlugin.sendLocalizedChat(player, "railcraft.gui.surveyor.begin");
                        setSignalData(item, tile);
View Full Code Here

TOP

Related Classes of mods.railcraft.api.core.WorldCoordinate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.