Editor generation cleanup
This commit is contained in:
@@ -26,14 +26,14 @@ public abstract class GenerateFilter{
|
||||
//save to buffer
|
||||
for(int i = 0; i < tiles.width * tiles.height; i++){
|
||||
Tile tile = tiles.geti(i);
|
||||
buffer[i] = TileBuffer.get(tile.blockID(), tile.floorID(), tile.overlayID());
|
||||
buffer[i] = PackTile.get(tile.blockID(), tile.floorID(), tile.overlayID());
|
||||
}
|
||||
|
||||
for(int i = 0; i < tiles.width * tiles.height; i++){
|
||||
Tile tile = tiles.geti(i);
|
||||
long b = buffer[i];
|
||||
|
||||
in.apply(tile.x, tile.y, Vars.content.block(TileBuffer.block(b)), Vars.content.block(TileBuffer.floor(b)), Vars.content.block(TileBuffer.overlay(b)));
|
||||
in.apply(tile.x, tile.y, Vars.content.block(PackTile.block(b)), Vars.content.block(PackTile.floor(b)), Vars.content.block(PackTile.overlay(b)));
|
||||
apply();
|
||||
|
||||
tile.setFloor(in.floor.asFloor());
|
||||
@@ -151,7 +151,7 @@ public abstract class GenerateFilter{
|
||||
}
|
||||
|
||||
@Struct
|
||||
class TileBufferStruct{
|
||||
class PackTileStruct{
|
||||
short block, floor, overlay;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class NoiseFilter extends GenerateFilter{
|
||||
new SliderOption("octaves", () -> octaves, f -> octaves = f, 1f, 10f),
|
||||
new SliderOption("falloff", () -> falloff, f -> falloff = f, 0f, 1f),
|
||||
new BlockOption("target", () -> target, b -> target = b, anyOptional),
|
||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOnly),
|
||||
new BlockOption("floor", () -> floor, b -> floor = b, floorsOptional),
|
||||
new BlockOption("wall", () -> block, b -> block = b, wallsOptional)
|
||||
);
|
||||
}
|
||||
@@ -29,8 +29,8 @@ public class NoiseFilter extends GenerateFilter{
|
||||
float noise = noise(in.x, in.y, scl, 1f, octaves, falloff);
|
||||
|
||||
if(noise > threshold && (target == Blocks.air || in.floor == target || in.block == target)){
|
||||
in.floor = floor;
|
||||
if(block != Blocks.air) in.block = block;
|
||||
if(floor != Blocks.air) in.floor = floor;
|
||||
if(block != Blocks.air && in.block != Blocks.air) in.block = block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user