chore(joml): add toBlockMapping utility
import org.terasology.math.geom.Rect2f;
import org.terasology.math.geom.Rect2i;
import org.terasology.math.geom.Vector3f;
+import org.terasology.world.block.Block;
import org.terasology.world.block.BlockRegion;
+import java.util.Map;
+import java.util.stream.Collectors;
+
public final class JomlUtil {
private JomlUtil() {
@@ -237,4 +241,8 @@ public static Rectanglei rectangleiFromMinAndSize(int minX, int minY, int width,
public static Rectanglef rectanglefFromMinAndSize(float minX, float minY, float width, float height) {
return new Rectanglef(minX, minY, minX + width, minY + height);
}
+
+ public static Map<org.terasology.math.geom.Vector3i, Block> blockMap(Map<Vector3i, Block> maps) {
+ return maps.entrySet().stream().collect(Collectors.toMap(k -> JomlUtil.from(k.getKey()), Map.Entry::getValue));
+ }
}
