Skip to content

Commit

Permalink
Minor API tweaks & refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
whichonespink44 committed Jul 14, 2017
1 parent afaeca7 commit 7dcf816
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
17 changes: 16 additions & 1 deletion src/main/java/rtg/api/world/biome/IRealisticBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public interface IRealisticBiome {
void initConfig();
boolean hasConfig();
TerrainBase initTerrain();
TerrainBase terrain();
SurfaceBase initSurface();
SurfaceBase surface();
SurfaceBase surfaceGeneric();
void initDecos();
ArrayList<DecoBase> getDecos();
ArrayList<TreeRTG> getTrees();
Expand Down Expand Up @@ -67,7 +70,19 @@ default int lavaSurfaceLakeChance() {
return 0; // Lower equals more frequent.
}

void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, IRTGWorld rtgWorld, float[] noise, float river, Biome[] base);
default void rReplace(ChunkPrimer primer, int i, int j, int x, int y, int depth, IRTGWorld rtgWorld, float[] noise, float river, Biome[] base) {

float riverRegion = !this.getConfig().ALLOW_RIVERS.get() ? 0f : river;

if (rtgConfig.ENABLE_RTG_BIOME_SURFACES.get() && this.getConfig().USE_RTG_SURFACES.get()) {

this.surface().paintTerrain(primer, i, j, x, y, depth, rtgWorld, noise, riverRegion, base);
}
else {

this.surfaceGeneric().paintTerrain(primer, i, j, x, y, depth, rtgWorld, noise, riverRegion, base);
}
}

default float lakePressure(IRTGWorld rtgWorld, int x, int y, float border, float lakeInterval, float largeBendSize, float mediumBendSize, float smallBendSize) {
if (!this.getConfig().ALLOW_SCENIC_LAKES.get()) return 1f;
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/rtg/world/biome/realistic/RealisticBiomeBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,21 @@ public float r3Dnoise(float z) {
return 0f;
}

public TerrainBase getTerrain() {

@Override
public TerrainBase terrain() {
return this.terrain;
}

public SurfaceBase getSurface() {

@Override
public SurfaceBase surface() {
return this.surface;
}

@Override
public SurfaceBase surfaceGeneric() {
return this.surfaceGeneric;
}

private class ChunkDecoration {
ChunkPos chunkLocation;
DecoBase decoration;
Expand Down

0 comments on commit 7dcf816

Please sign in to comment.