implement world api changes

This commit is contained in:
dfsek
2021-11-28 12:19:10 -07:00
parent 01f6df4a19
commit 1e9e1dce75
49 changed files with 111 additions and 1428 deletions
@@ -7,6 +7,8 @@
package com.dfsek.terra.addons.flora.flora.gen;
import com.dfsek.terra.api.world.access.WorldAccess;
import net.jafama.FastMath;
import java.util.ArrayList;
@@ -56,7 +58,7 @@ public class TerraFlora implements Structure {
});
}
private void test(EnumSet<Direction> faces, Direction f, Vector3 b, World world) {
private void test(EnumSet<Direction> faces, Direction f, Vector3 b, WorldAccess world) {
if(testRotation.contains(
world.getBlockData(b.getBlockX() + f.getModX(), b.getBlockY() + f.getModY(), b.getBlockZ() + f.getModZ()).getBlockType()))
faces.add(f);
@@ -66,7 +68,7 @@ public class TerraFlora implements Structure {
return layers.get(FastMath.max(FastMath.min(layer, layers.size() - 1), 0));
}
private EnumSet<Direction> getFaces(Vector3 b, World world) {
private EnumSet<Direction> getFaces(Vector3 b, WorldAccess world) {
EnumSet<Direction> faces = EnumSet.noneOf(Direction.class);
test(faces, Direction.NORTH, b, world);
test(faces, Direction.SOUTH, b, world);
@@ -81,17 +83,17 @@ public class TerraFlora implements Structure {
}
@Override
public boolean generate(Vector3 location, World world, Chunk chunk, Random random, Rotation rotation) {
public boolean generate(Vector3 location, WorldAccess world, Chunk chunk, Random random, Rotation rotation) {
return generate(location, world, random, rotation);
}
@Override
public boolean generate(Buffer buffer, World world, Random random, Rotation rotation, int recursions) {
public boolean generate(Buffer buffer, WorldAccess world, Random random, Rotation rotation, int recursions) {
return generate(buffer.getOrigin(), world, random, rotation);
}
@Override
public boolean generate(Vector3 location, World world, Random random, Rotation rotation) {
public boolean generate(Vector3 location, WorldAccess world, Random random, Rotation rotation) {
boolean doRotation = testRotation.size() > 0;
int size = layers.size();
int c = ceiling ? -1 : 1;