mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-13 11:16:05 +00:00
Begin work on structure /locate, fix voxel geometry and add test commands, begin work on simplex caves
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user