generate .we maze
- export maze as .we ( still hlf boundaries missing )
This commit is contained in:
@@ -6,13 +6,13 @@ import org.artisanlogiciel.games.minetest.Node;
|
||||
import org.artisanlogiciel.games.minetest.WorlEditGenerator;
|
||||
import java.io.*;
|
||||
|
||||
public class MazePeristWorldEdit {
|
||||
public class MazePersistWorldEdit {
|
||||
|
||||
private LabyModel model;
|
||||
private WorlEditGenerator generator;
|
||||
private static final String GRASS_MATERIAL = "default:dirt_with_grass";
|
||||
|
||||
public MazePeristWorldEdit(LabyModel model) {
|
||||
public MazePersistWorldEdit(LabyModel model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
@@ -40,11 +40,14 @@ public class MazePeristWorldEdit {
|
||||
int y = oy + (int) (pY * h);
|
||||
|
||||
// copied from drawing, where order did matter, might not be the case here...
|
||||
if ((pY == 0) && LabyModel.isFlagSet(walls, Brick.UP)) {
|
||||
addNode(new Node(x,y,z,material));
|
||||
addNode(new Node(x + (int) w,y,z,material));
|
||||
//if ((pY == 0) && LabyModel.isFlagSet(walls, Brick.UP)) {
|
||||
if (LabyModel.isFlagSet(walls, Brick.UP)) {
|
||||
for ( int dx = 0; dx < w; dx++) {
|
||||
addNode(new Node(x + dx, y, z, material));
|
||||
}
|
||||
wdrawn |= Brick.UP;
|
||||
}
|
||||
/*
|
||||
if (LabyModel.isFlagSet(walls, Brick.RIGHT)) {
|
||||
if (!LabyModel.isFlagSet(wdrawn, Brick.UP)) {
|
||||
addNode(new Node(x + (int) w, y, 0, material));
|
||||
@@ -59,11 +62,12 @@ public class MazePeristWorldEdit {
|
||||
addNode(new Node(x, y + (int) h, z, material));
|
||||
wdrawn |= Brick.DOWN;
|
||||
}
|
||||
if ((pX == 0) && LabyModel.isFlagSet(walls, Brick.LEFT)) {
|
||||
if (!LabyModel.isFlagSet(wdrawn, Brick.DOWN)) {
|
||||
addNode(new Node(x, y + (int) h, z, material));
|
||||
*/
|
||||
//if ((pX == 0) && LabyModel.isFlagSet(walls, Brick.LEFT)) {
|
||||
if (LabyModel.isFlagSet(walls, Brick.LEFT)) {
|
||||
for (int dy = 0; dy < h; dy ++) {
|
||||
addNode(new Node(x, y + dy, z, material));
|
||||
}
|
||||
addNode(new Node(x, y, z, material));
|
||||
wdrawn |= Brick.LEFT;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user