Begin work on structure /locate, fix voxel geometry and add test commands, begin work on simplex caves

This commit is contained in:
dfsek
2020-10-04 02:23:35 -07:00
parent 188cf612fb
commit c80e65cce9
18 changed files with 583 additions and 46 deletions

View File

@@ -7,6 +7,9 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* Class to procedurally determine the spawn point of an object based on a grid with padding between cells.
*/
public class GridSpawn {
private final int separation;
private final int width;
@@ -16,7 +19,7 @@ public class GridSpawn {
}
/**
* Get nearest spawnpoint
* Get nearest spawn point
* @param x X coordinate
* @param z Z coordinate
* @param seed Seed for RNG
@@ -40,7 +43,7 @@ public class GridSpawn {
}
/**
* Get the X/Z coordinates of the spawnpoint in the nearest Chunk (not Minecraft chunk)
* Get the X/Z coordinates of the spawn point in the nearest Chunk (not Minecraft chunk)
* @param structureChunkX Chunk X coordinate
* @param structureChunkZ Chunk Z coordinate
* @param seed Seed for RNG
@@ -54,4 +57,12 @@ public class GridSpawn {
int sz = structureChunkZ * (width + 2*separation) + offsetZ;
return new Vector(sx, 0, sz);
}
public int getWidth() {
return width;
}
public int getSeparation() {
return separation;
}
}

View File

@@ -0,0 +1,9 @@
package com.dfsek.terra.procgen.voxel;
import org.bukkit.util.Vector;
public class Cylinder extends VoxelGeometry {
public Cylinder(Vector start, int rad, int height) {
}
}

View File

@@ -20,7 +20,6 @@ public abstract class VoxelGeometry {
geometry.addAll(other.getGeometry());
}
public static VoxelGeometry getBlank() {
return new Blank();
return new VoxelGeometry() {};
}
private static class Blank extends VoxelGeometry {}
}