Package mods.railcraft.api.tracks

Examples of mods.railcraft.api.tracks.ITrackInstance


    @Override
    public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) {
        TileEntity tile = world.getTileEntity(i, j, k);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            if (track instanceof ITrackCustomShape)
                return ((ITrackCustomShape) track).getSelectedBoundingBoxFromPool();
        }
        return AxisAlignedBB.getBoundingBox((double) i + minX, (double) j + minY, (double) k + minZ, (double) i + maxX, (double) j + maxY, (double) k + maxZ);
    }
View Full Code Here


    @Override
    public MovingObjectPosition collisionRayTrace(World world, int i, int j, int k, Vec3 vec3d, Vec3 vec3d1) {
        TileEntity tile = world.getTileEntity(i, j, k);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            if (track instanceof ITrackCustomShape)
                return ((ITrackCustomShape) track).collisionRayTrace(vec3d, vec3d1);
        }
        return super.collisionRayTrace(world, i, j, k, vec3d, vec3d1);
    }
View Full Code Here

    @Override
    public boolean getBlocksMovement(IBlockAccess world, int x, int y, int z) {
        TileEntity tile = world.getTileEntity(x, y, z);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            if (track instanceof ITrackBlocksMovement)
                return !((ITrackBlocksMovement) track).blocksMovement();
        }
        return super.getBlocksMovement(world, x, y, z);
    }
View Full Code Here

        TileEntity tile = world.getTileEntity(x, y, z);
        if (!(tile instanceof TileTrack))
            return;

        ITrackInstance track = ((TileTrack) tile).getTrackInstance();
        if (!(track instanceof IElectricGrid))
            return;

        IElectricGrid.ChargeHandler chargeHandler = ((IElectricGrid) track).getChargeHandler();
        if (chargeHandler.getCharge() > 2000)
View Full Code Here

    @Override
    public boolean canConnectRedstone(IBlockAccess world, int x, int y, int z, int side) {
        TileEntity tile = world.getTileEntity(x, y, z);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            return track instanceof ITrackEmitter;
        }
        return false;
    }
View Full Code Here

    @Override
    public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
        TileEntity tile = world.getTileEntity(x, y, z);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            return track instanceof ITrackEmitter ? ((ITrackEmitter) track).getPowerOutput() : PowerPlugin.NO_POWER;
        }
        return PowerPlugin.NO_POWER;
    }
View Full Code Here

    @Override
    public ConnectStyle connectsToPost(IBlockAccess world, int i, int j, int k, ForgeDirection side) {
        TileEntity tile = world.getTileEntity(i, j, k);
        if (tile instanceof TileTrack) {
            ITrackInstance track = ((TileTrack) tile).getTrackInstance();
            if (track instanceof IPostConnection)
                return ((IPostConnection) track).connectsToPost(world, i, j, k, side);
        }
        return ConnectStyle.NONE;
    }
View Full Code Here

TOP

Related Classes of mods.railcraft.api.tracks.ITrackInstance

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.