Package mods.railcraft.common.blocks.tracks

Examples of mods.railcraft.common.blocks.tracks.EnumTrackMeta


            --y;

        Block block = this.worldObj.getBlock(x, y, z);

        if (TrackTools.isRailBlock(block)) {
            EnumTrackMeta trackMeta = EnumTrackMeta.fromMeta(((BlockRailBase) block).getBasicRailMetadata(worldObj, this, x, y, z));
            y--;

            boolean slotANull = true;
            boolean slotBNull = true;
            if (patternInv.getStackInSlot(SLOT_EXIST_UNDER_A) != null) {
View Full Code Here


//            System.out.println("Yaw = " + MathHelper.floor_double(rotationYaw));

                int x;
                int y = MathHelper.floor_double(posY);
                int z;
                EnumTrackMeta dir = EnumTrackMeta.NORTH_SOUTH;
                if (getFacing() == ForgeDirection.WEST || getFacing() == ForgeDirection.EAST)
                    dir = EnumTrackMeta.EAST_WEST;

                if (getDelay() == 0) {
                    float offset = 1.5f;
                    x = MathHelper.floor_double(getXAhead(posX, offset));
                    z = MathHelper.floor_double(getZAhead(posZ, offset));

                    if (placeBallast) {
                        boolean placed = placeBallast(x, y - 1, z);
                        if (placed)
                            setDelay(STANDARD_DELAY);
                        else {
                            setDelay(FAIL_DELAY);
                            setActive(false);
                        }
                        placeBallast = false;
                    } else if (!worldObj.isSideSolid(x, y - 1, z, ForgeDirection.UP)) {
                        placeBallast = true;
                        setDelay(BALLAST_DELAY);
                    }
                }

                if (getDelay() == 0) {
                    float offset = 0.8f;
                    x = MathHelper.floor_double(getXAhead(posX, offset));
                    z = MathHelper.floor_double(getZAhead(posZ, offset));

                    if (placeRail) {
                        boolean placed = placeTrack(x, y, z, dir);
                        if (placed)
                            setDelay(STANDARD_DELAY);
                        else {
                            setDelay(FAIL_DELAY);
                            setActive(false);
                        }
                        placeRail = false;
                    } else if (TrackTools.isRailBlockAt(worldObj, x, y, z)) {
                        if (!dir.isEqual(TrackTools.getTrackMeta(worldObj, this, x, y, z))) {
                            worldObj.setBlockMetadataWithNotify(x, y, z, dir.ordinal(), 3);
                            setDelay(STANDARD_DELAY);
                        }
                    } else if (worldObj.isAirBlock(x, y, z) || replaceableBlocks.contains(worldObj.getBlock(x, y, z))) {
                        placeRail = true;
                        setDelay(STANDARD_DELAY);
View Full Code Here

TOP

Related Classes of mods.railcraft.common.blocks.tracks.EnumTrackMeta

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.