Internal changes for surface-less floors

This commit is contained in:
Anuken
2020-10-08 14:44:02 -04:00
parent 6aa1144429
commit f14d631ff9
11 changed files with 21 additions and 13 deletions

View File

@@ -188,12 +188,12 @@ public class BaseGenerator{
tile.block.iterateTaken(tile.x + cx, tile.y + cy, (ex, ey) -> {
if(!tiles.getn(ex, ey).floor().isLiquid){
if(tiles.getn(ex, ey).floor().hasSurface()){
set(tiles.getn(ex, ey), item);
}
Tile rand = tiles.getc(ex + Mathf.range(1), ey + Mathf.range(1));
if(!rand.floor().isLiquid){
if(rand.floor().hasSurface()){
//random ores nearby to make it look more natural
set(rand, item);
}

View File

@@ -69,7 +69,7 @@ public abstract class BasicGenerator implements WorldGenerator{
public void ores(Seq<Block> ores){
pass((x, y) -> {
if(floor.asFloor().isLiquid) return;
if(!floor.asFloor().hasSurface()) return;
int offsetX = x - 4, offsetY = y + 23;
for(int i = ores.size - 1; i >= 0; i--){
@@ -124,7 +124,7 @@ public abstract class BasicGenerator implements WorldGenerator{
Block[] blocks = {Blocks.darkPanel3};
int secSize = 20;
pass((x, y) -> {
if(floor.asFloor().isLiquid) return;
if(!floor.asFloor().hasSurface()) return;
int mx = x % secSize, my = y % secSize;
int sclx = x / secSize, scly = y / secSize;