Tangled Maze API 1.0

maze generation API of TangledMaze

  1. MightyOne
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    This is the API for the maze generator plugin TangledMaze. Check it out for an explanation what this API is all about!

    Here you can get to the source code where I added a few comments.

    Example code for creating a maze:
    Code (Text):

    //The imports from the API used for this code:
    //import me.gorgeousone.tangledmazeapi.clip.Clip;
    //import me.gorgeousone.tangledmazeapi.clip.shape.Circle;
    //import me.gorgeousone.tangledmazeapi.clip.shape.Rectangle;
    //import me.gorgeousone.tangledmazeapi.core.Maze;
    //import me.gorgeousone.tangledmazeapi.generation.BlockGenerator;
    //import me.gorgeousone.tangledmazeapi.generation.PathGenerator;
    //import me.gorgeousone.tangledmazeapi.util.Vec2;

    Location center = new Location(world, 0, 64, 0);

    Location upperMazeCorner = center.clone().add( 20, 0,  20);
    Location lowerMazeCorner = center.clone().add(-10, 0, -10);

    Location cornerForAddition = center.clone().add( 20, 0,  20);
    Location cornerForDeletion = center.clone().add(-20, 0, -20);

    Clip mazeClip = Rectangle.createClip(upperMazeCorner, lowerMazeCorner);
    Clip clipToAdd = Circle.createClip(center, cornerForAddition);
    Clip clipToRemove = Rectangle.createClip(center, cornerForDeletion);

    maze = new Maze(mazeClip);
    maze.processAction(maze.getAddition(clipToAdd), true);
    maze.processAction(maze.getDeletion(clipToRemove), true);

    maze.addExit(new Vec2(center).add(-1, 0));
    maze.setWallMaterials((List<MaterialData>) Arrays.asList(new MaterialData(Material.OAK_LOG)));
    maze.buildMaze(new PathGenerator(), new BlockGenerator(), this);

    Feel free to pm me if there are questions about code or any other problems! :D
    Ajaxan and HexedHero like this.