Removed ores from existing built-in maps / Default oregen
This commit is contained in:
@@ -186,25 +186,35 @@ public class Maps implements Disposable{
|
||||
@SuppressWarnings("unchecked")
|
||||
public Array<GenerateFilter> readFilters(String str){
|
||||
if(str == null || str.isEmpty()){
|
||||
return Array.with(
|
||||
//stone
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.stone;
|
||||
block = Blocks.rock;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.shale;
|
||||
block = Blocks.shaleBoulder;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.snow;
|
||||
block = Blocks.snowrock;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.ice;
|
||||
block = Blocks.snowrock;
|
||||
}}
|
||||
//create default filters list
|
||||
Array<GenerateFilter> filters = Array.with(
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.stone;
|
||||
block = Blocks.rock;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.shale;
|
||||
block = Blocks.shaleBoulder;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.snow;
|
||||
block = Blocks.snowrock;
|
||||
}},
|
||||
new ScatterFilter(){{
|
||||
flooronto = Blocks.ice;
|
||||
block = Blocks.snowrock;
|
||||
}}
|
||||
);
|
||||
|
||||
int index = 0;
|
||||
for(Block block : new Block[]{Blocks.oreCopper, Blocks.oreLead, Blocks.oreCoal, Blocks.oreTitanium, Blocks.oreThorium}){
|
||||
OreFilter filter = new OreFilter();
|
||||
filter.threshold += index ++ * 0.019f;
|
||||
filter.ore = block;
|
||||
filters.add(filter);
|
||||
}
|
||||
|
||||
return filters;
|
||||
}else{
|
||||
return JsonIO.read(Array.class, str);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package io.anuke.mindustry.maps.filters;
|
||||
|
||||
import io.anuke.mindustry.content.*;
|
||||
import io.anuke.mindustry.world.*;
|
||||
|
||||
import static io.anuke.mindustry.maps.filters.FilterOption.*;
|
||||
|
||||
public class ClearFilter extends GenerateFilter{
|
||||
protected Block block = Blocks.air;
|
||||
|
||||
{
|
||||
options(
|
||||
new BlockOption("block", () -> block, b -> block = b, wallsOnly)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply(){
|
||||
|
||||
if(in.block == block){
|
||||
in.block = Blocks.air;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import static io.anuke.mindustry.maps.filters.FilterOption.BlockOption;
|
||||
import static io.anuke.mindustry.maps.filters.FilterOption.oresOnly;
|
||||
|
||||
public class OreFilter extends GenerateFilter{
|
||||
public float scl = 45, threshold = 0.73f, octaves = 3f, falloff = 0.4f;
|
||||
public float scl = 43, threshold = 0.705f, octaves = 3f, falloff = 0.4f;
|
||||
public Block ore = Blocks.oreCopper;
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user