WIP minetest <-> laby import/export
- currently possible to export a laby into minetest - start of a lua content parser to import .we into lab
This commit is contained in:
24
java/org/artisanlogiciel/games/minetest/Material.java
Normal file
24
java/org/artisanlogiciel/games/minetest/Material.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package org.artisanlogiciel.games.minetest;
|
||||
|
||||
public class Material {
|
||||
|
||||
public static final String GRASS_MATERIAL = "default:dirt_with_grass";
|
||||
|
||||
public static Material DEFAULT = new Material(GRASS_MATERIAL);
|
||||
|
||||
private String name;
|
||||
|
||||
public Material(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static Material getMaterialByName(String name)
|
||||
{
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "name";
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,22 @@ public class Node {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
String material;
|
||||
Material material;
|
||||
|
||||
public Node(int x, int y, int z, String material) {
|
||||
public Node(int x, int y, int z, Material material) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public Node(int x, int y, int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.material = Material.DEFAULT;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
@@ -25,7 +32,7 @@ public class Node {
|
||||
return z;
|
||||
}
|
||||
|
||||
public String getMaterial() {
|
||||
public Material getMaterial() {
|
||||
return material;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class WorlEditGenerator
|
||||
addIntMember("x", node.getX() - refNode.getX());
|
||||
addIntMember("y", node.getY() - refNode.getY());
|
||||
addIntMember("z", node.getZ() - refNode.getZ());
|
||||
addStringMember("name",node.getMaterial());
|
||||
addStringMember("name",node.getMaterial().toString() );
|
||||
luaNode.append("}");
|
||||
start=false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user