-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
132 additions
and
65 deletions.
There are no files selected for viewing
14 changes: 7 additions & 7 deletions
14
common/src/main/generated/.cache/1feb4c76a7f661f0310d685620450608f5a76bca
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
// 1.20.1 2024-10-31T12:11:48.172926144 CTGen/Registries | ||
// 1.20.1 2024-10-31T12:27:26.172865087 CTGen/Registries | ||
09917112f8476aaef3e39f5780a478b955edc3e7 data/ctgen/worldgen/map_based/zones/plains.json | ||
3ca73f0225adf1fd168bfc73558fbf63bcf54aec data/ctgen/worldgen/map_based/zones/badlands_mountains.json | ||
ea8abee99ec67bf274bec024eff481325863952a data/ctgen/worldgen/map_based/zones/stony_flats.json | ||
4e10b1b02ad79d86538524c470d56dedf8c779f1 data/ctgen/worldgen/map_based/zones/desert.json | ||
b24dcc94b75a2092b2386357c78a1f93808fd7f8 data/ctgen/worldgen/map_based/zones/river.json | ||
ea8abee99ec67bf274bec024eff481325863952a data/ctgen/worldgen/map_based/zones/stony_flats.json | ||
0bd4367d5837e151081d147227d11e56c29ecffb data/ctgen/worldgen/map_based/zones/river.json | ||
166eb560b75b90c63217a66b4eac9cf59dcb8f9e data/ctgen/worldgen/map_based/zones/lake.json | ||
786353e42c828bf1348fb727db3e60adec29c18d data/ctgen/worldgen/map_based/zones/forest.json | ||
a78f910d231a5d843042462e8517155aab8b5ca2 data/ctgen/worldgen/map_based/zones/snowy_mountains.json | ||
3fcf216d906f96f57ba447df2dab0a13157af1ce data/ctgen/worldgen/map_based/zones/snowy_slopes.json | ||
10fbdfeee308b501bed36a2d800c40b11810ce63 data/ctgen/worldgen/map_based/zones/ocean.json | ||
a034954687c0b0280accf18519f3022d029489b8 data/ctgen/worldgen/map_based/zones/ocean.json | ||
178d1061c64452922300ec3d5db0f066c59ca438 data/ctgen/worldgen/map_based/zones/badlands.json | ||
b5339019d9316486c132e0832d7f86a08a9ec1e4 data/ctgen/worldgen/map_based/zones/mountains.json | ||
d281f3a59adaf68e61a56c40493788015fd6ef95 data/ctgen/worldgen/map_based/zones/hills.json | ||
12195224411b05e2dc54730b03a6ed894279f49c data/ctgen/worldgen/map_based/zones/frozen_river.json | ||
2a289331bed4faa0aabefde7efaaff6ade8fd966 data/ctgen/worldgen/map_based/zones/frozen_river.json | ||
bdedb4d289b62ce9049dad7260e5e2a58987dfb3 data/ctgen/worldgen/map_based/zones/snowy_flats.json | ||
e09748905aab9f3b627aabb7cf3e1ae3eee3b2b1 data/ctgen/worldgen/map_based/zones/deep_ocean.json | ||
c6a7a763fb76dc1de84eb2511629ae6faeb17945 data/ctgen/worldgen/map_based/zones/frozen_lake.json | ||
e20907968549754b4f2bdd776a641ca5c6f44fcd data/ctgen/worldgen/map_based/zones/deep_ocean.json | ||
ae7297b8304833244f8be82c73215aefae5bb273 data/ctgen/worldgen/map_based/zones/frozen_lake.json |
4 changes: 2 additions & 2 deletions
4
common/src/main/generated/data/ctgen/worldgen/map_based/zones/deep_ocean.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"biome": "minecraft:deep_ocean", | ||
"carver_modifier": 26.0, | ||
"color": { | ||
"b": 85, | ||
"g": 35, | ||
"r": 0 | ||
}, | ||
"height": -60, | ||
"terrain_modifier": 33.0, | ||
"threshold_modifier": 26 | ||
"terrain_modifier": 33.0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
common/src/main/java/dev/tocraft/ctgen/xtend/carver/Carver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.tocraft.ctgen.xtend.carver; | ||
|
||
import com.mojang.serialization.Codec; | ||
import dev.tocraft.ctgen.xtend.CTRegistries; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.world.level.levelgen.synth.SimplexNoise; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.function.Function; | ||
|
||
public abstract class Carver { | ||
public static final Codec<Carver> CODEC = CTRegistries.CARVER.byNameCodec().dispatchStable(Carver::codec, Function.identity()); | ||
|
||
public static void register() { | ||
CTRegistries.CARVER.register(NoiseCarver.ID, NoiseCarver.CODEC); | ||
} | ||
|
||
|
||
public abstract boolean canSetBlock(SimplexNoise noise, @NotNull BlockPos pos, double surfaceHeight, int minHeight, double carverModifier); | ||
|
||
protected abstract Codec<? extends Carver> codec(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...tocraft/ctgen/worldgen/CarverSetting.java → ...aft/ctgen/xtend/carver/CarverSetting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
common/src/main/java/dev/tocraft/ctgen/xtend/carver/NoiseCarver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package dev.tocraft.ctgen.xtend.carver; | ||
|
||
import com.mojang.serialization.Codec; | ||
import com.mojang.serialization.codecs.RecordCodecBuilder; | ||
import dev.tocraft.ctgen.CTerrainGeneration; | ||
import dev.tocraft.ctgen.util.Noise; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.level.levelgen.synth.SimplexNoise; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
|
||
public class NoiseCarver extends Carver { | ||
public static final NoiseCarver DEFAULT = new NoiseCarver(new Noise(List.of(1F, 0.5F), 2, 63, 47), 0.55F); | ||
|
||
public static final Codec<NoiseCarver> CODEC = RecordCodecBuilder.create(instance -> instance.group( | ||
Noise.CODEC.optionalFieldOf("noise", DEFAULT.noise).forGetter(o -> o.noise), | ||
Codec.DOUBLE.optionalFieldOf("threshold", DEFAULT.threshold).forGetter(o -> o.threshold) | ||
).apply(instance, NoiseCarver::new)); | ||
public static final ResourceLocation ID = CTerrainGeneration.id("noise_carver"); | ||
|
||
private final Noise noise; | ||
private final double threshold; | ||
|
||
public NoiseCarver(Noise noise, double threshold) { | ||
this.noise = noise; | ||
this.threshold = threshold; | ||
} | ||
|
||
|
||
@Override | ||
public boolean canSetBlock(SimplexNoise noise, @NotNull BlockPos pos, double surfaceHeight, int minHeight, double carverModifier) { | ||
double height = (double) (pos.getY() - minHeight) / (surfaceHeight - minHeight) - 0.5; | ||
double addThreshold = height * height * height * height * carverModifier; | ||
|
||
double perlin = this.noise.getPerlin(noise, pos.getX(), pos.getY(), pos.getZ()); | ||
|
||
double threshold = this.threshold + addThreshold; | ||
return !(perlin > threshold); | ||
} | ||
|
||
@Override | ||
protected Codec<NoiseCarver> codec() { | ||
return CODEC; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.