Files
artloglaby/java/org/artisanlogiciel/games/minetest/Node.java
philippe lhardy 9792b79c56 MaimMim Man in the middle minetest interceptor
- prototype
- between client and server, allow to capture all exchanges and potentially change them
- created to capture server maps in laby
- first test get only MapBlock, support version serialization version 28
  - prepartion for 29 with zstd but untested.

# Conflicts:
#	fetch_dependencies.sh
2023-07-30 10:18:45 +02:00

62 lines
1.3 KiB
Java

package org.artisanlogiciel.games.minetest;
import java.util.HashMap;
public class Node {
// could be a core.v3s16
int x;
int y;
int z;
Material 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 Node(HashMap<String, Object> map)
throws ClassCastException, NullPointerException
{
// FIXME WARNING HACK reverse x and z ...
x = ((Integer) map.get("x")).intValue();
y = ((Integer) map.get("z")).intValue();
z = ((Integer) map.get("y")).intValue();
material = Material.getMaterialByName( (String) map.get("name"));
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public int getZ() {
return z;
}
public Material getMaterial() {
return material;
}
@Override
public String toString() {
return "Node{" +
"x=" + x +
", y=" + y +
", z=" + z +
", material=" + material +
'}';
}
}