mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
more Column API
This commit is contained in:
parent
687efb7444
commit
c928a1a806
@ -1,9 +1,12 @@
|
|||||||
package com.dfsek.terra.addons.generation.feature;
|
package com.dfsek.terra.addons.generation.feature;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
|
import com.dfsek.terra.api.structure.feature.BinaryColumn;
|
||||||
import com.dfsek.terra.api.world.Column;
|
import com.dfsek.terra.api.world.Column;
|
||||||
import com.dfsek.terra.api.world.World;
|
import com.dfsek.terra.api.world.World;
|
||||||
|
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
|
||||||
public class ColumnImpl implements Column {
|
public class ColumnImpl implements Column {
|
||||||
private final int x;
|
private final int x;
|
||||||
@ -45,4 +48,16 @@ public class ColumnImpl implements Column {
|
|||||||
public int getMaxY() {
|
public int getMaxY() {
|
||||||
return world.getMaxHeight();
|
return world.getMaxHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void forEach(IntConsumer function) {
|
||||||
|
for(int y = world.getMinHeight(); y < world.getMaxHeight(); y++) {
|
||||||
|
function.accept(y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BinaryColumn newBinaryColumn() {
|
||||||
|
return new BinaryColumn(getMinY(), getMaxY());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
package com.dfsek.terra.api.world;
|
package com.dfsek.terra.api.world;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.state.BlockState;
|
import com.dfsek.terra.api.block.state.BlockState;
|
||||||
|
import com.dfsek.terra.api.structure.feature.BinaryColumn;
|
||||||
|
|
||||||
|
import java.util.function.IntConsumer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -18,4 +21,8 @@ public interface Column {
|
|||||||
int getMinY();
|
int getMinY();
|
||||||
|
|
||||||
int getMaxY();
|
int getMaxY();
|
||||||
|
|
||||||
|
void forEach(IntConsumer function);
|
||||||
|
|
||||||
|
BinaryColumn newBinaryColumn();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user