Skip to content

Commit

Permalink
Noise Settings fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
GirafiStudios committed Mar 9, 2022
1 parent bdc7374 commit 3ed264a
Show file tree
Hide file tree
Showing 13 changed files with 329 additions and 1,604 deletions.
18 changes: 12 additions & 6 deletions src/main/java/com/teammetallurgy/atum/init/AtumBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.HashMap;
import java.util.List;

@Mod.EventBusSubscriber(modid = Atum.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class AtumBiomes {
public static final DeferredRegister<Biome> BIOME_DEFERRED = DeferredRegister.create(ForgeRegistries.BIOMES, Atum.MOD_ID);
private static final List<ResourceKey<Biome>> BIOME_KEYS = Lists.newArrayList();
private static final HashMap<ResourceKey<Biome>, BiomeRegion> BIOME_KEYS = new HashMap<>();
public static final ResourceKey<Biome> DEAD_OASIS = registerBiome(AtumBiomeMaker.makeDeadOasis("dead_oasis"), "dead_oasis", BiomeRegion.STRANGE_SANDS); //Sub Biome
public static final ResourceKey<Biome> DENSE_WOODS = registerBiome(AtumBiomeMaker.makeDenseWoods("dense_woods"), "dense_woods", 10, BiomeRegion.DESSICATED_WOODS);
public static final ResourceKey<Biome> SPARSE_WOODS = registerBiome(AtumBiomeMaker.makeSparseWoods("sparse_woods"), "sparse_woods", 10, BiomeRegion.DESSICATED_WOODS);
Expand All @@ -33,6 +34,7 @@ public class AtumBiomes {
public static final ResourceKey<Biome> SAND_DUNES = registerBiome(AtumBiomeMaker.makeSandDunes("sand_dunes"), "sand_dunes", 15, BiomeRegion.STRANGE_SANDS);
public static final ResourceKey<Biome> SAND_HILLS = registerBiome(AtumBiomeMaker.makeSandHills("sand_hills"), "sand_hills", 10, BiomeRegion.STRANGE_SANDS);
public static final ResourceKey<Biome> SAND_PLAINS = registerBiome(AtumBiomeMaker.makeSandPlains("sand_plains"), "sand_plains", 30, BiomeRegion.STRANGE_SANDS);
public static final ResourceKey<Biome> KARST_CAVES = registerBiome(AtumBiomeMaker.makeKarstCaves("karst_caves"), "karst_caves", 30, BiomeRegion.DEPTHS);

public static ResourceKey<Biome> registerBiome(Biome biome, String biomeName, BiomeRegion biomeRegion) {
return registerBiome(biome, biomeName, 0, biomeRegion);
Expand All @@ -43,14 +45,17 @@ public static ResourceKey<Biome> registerBiome(Biome biome, String biomeName, in
if (weight > 0) {
new AtumConfig.Biome(AtumConfig.BUILDER, biomeName, weight); //Write config
}
return registerBiomeKey(biomeName);
return registerBiomeKey(biomeName, biomeRegion);
}

public static void addBiomeTags() {
for (ResourceKey<Biome> biome : BIOME_KEYS) {
for (ResourceKey<Biome> biome : BIOME_KEYS.keySet()) {
BiomeDictionary.addTypes(biome, BiomeTags.ATUM);
if (biome != AtumBiomes.OASIS) {
BiomeDictionary.addTypes(biome, BiomeDictionary.Type.HOT, BiomeDictionary.Type.SANDY, BiomeDictionary.Type.SPARSE, BiomeDictionary.Type.DRY);
BiomeDictionary.addTypes(biome, BiomeDictionary.Type.HOT, BiomeDictionary.Type.SPARSE, BiomeDictionary.Type.DRY);
}
if (BIOME_KEYS.get(biome) == BiomeRegion.STRANGE_SANDS) {
BiomeDictionary.addTypes(biome, BiomeDictionary.Type.SANDY);
}
}
BiomeDictionary.addTypes(DEAD_OASIS, BiomeTags.OASIS, BiomeDictionary.Type.DEAD, BiomeDictionary.Type.RARE);
Expand All @@ -63,6 +68,7 @@ public static void addBiomeTags() {
BiomeDictionary.addTypes(SAND_DUNES, BiomeDictionary.Type.HILLS);
BiomeDictionary.addTypes(SAND_HILLS, BiomeDictionary.Type.HILLS);
BiomeDictionary.addTypes(SAND_PLAINS, BiomeDictionary.Type.PLAINS);
BiomeDictionary.addTypes(KARST_CAVES, BiomeDictionary.Type.UNDERGROUND);
}

@SubscribeEvent
Expand All @@ -87,9 +93,9 @@ public static void registerBiome(Biome biome, String name) {
* @param biomeName The name to register the biome key with
* @return The Biome key that was registered
*/
public static ResourceKey<Biome> registerBiomeKey(String biomeName) {
public static ResourceKey<Biome> registerBiomeKey(String biomeName, BiomeRegion biomeRegion) {
ResourceKey<Biome> biomeKey = ResourceKey.create(ForgeRegistries.Keys.BIOMES, new ResourceLocation(Atum.MOD_ID, biomeName));
BIOME_KEYS.add(biomeKey);
BIOME_KEYS.put(biomeKey, biomeRegion);
return biomeKey;
}

Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/teammetallurgy/atum/init/AtumBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public BlockEntity newBlockEntity(@Nonnull BlockPos pos, @Nonnull BlockState sta
public static final RegistryObject<Block> LIMESTONE_CRACKED_BRICK_DOOR = registerBlock(() -> new DoorAtumBlock(copy(LIMESTONE_BRICK_CRACKED_BRICK.get())), "limestone_brick_cracked_brick_door");
public static final RegistryObject<Block> LIMESTONE_BRICK_CHISELED_DOOR = registerBlock(() -> new DoorAtumBlock(copy(LIMESTONE_BRICK_CHISELED.get())), "limestone_brick_chiseled_door");
public static final RegistryObject<Block> LIMESTONE_BRICK_CARVED_DOOR = registerBlock(() -> new DoorAtumBlock(copy(LIMESTONE_BRICK_CARVED.get())), "limestone_brick_carved_door");
public static final RegistryObject<Block> KARST = registerBlock(() -> new Block(copy(LIMESTONE.get()).strength(3.0F, 6.0F)), "karst");
public static final RegistryObject<Block> ALABASTER = registerBlock(() -> new Block(of(Material.STONE, MaterialColor.QUARTZ).strength(2.0F, 8.0F)), "alabaster");
public static final RegistryObject<Block> ALABASTER_BRICK_SMOOTH = registerBlock(() -> new Block(copy(ALABASTER.get())), "alabaster_brick_smooth");
public static final RegistryObject<Block> ALABASTER_BRICK_POLISHED = registerBlock(() -> new Block(copy(ALABASTER.get())), "alabaster_brick_polished");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@

public class AtumBiomeMaker { //TODO

public static Biome makeKarstCaves(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
addDefaultSpawns(biomeName);
return new Builder().generationSettings(biomeGen.build()).mobSpawnSettings(new MobSpawnSettings.Builder().build()).build();
}

public static Biome makeDeadOasis(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.GRAVEL_CRACKED)*/);
addDefaultSpawns(biomeName);
Expand All @@ -36,15 +42,15 @@ public static Biome makeDeadOasis(String biomeName) {
}

public static Biome makeSparseWoods(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
/*biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.SPARSE_DRY_GRASS_NOISE_08_2_3);
biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.SPARSE_TALL_GRASS);
biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DEADWOOD_3_01_1);*/
return makeBaseWoods(biomeName, biomeGen);
}

public static Biome makeDenseWoods(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
/*biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DENSE_DRY_GRASS_NOISE_08_5_10);
biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DRY_TALL_GRASS);
biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DEADWOOD_20_025_3);*/
Expand Down Expand Up @@ -93,7 +99,7 @@ public static Biome makeDriedRiver(String biomeName) {
}

public static Biome makeLimestoneCrags(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
addDefaultSpawns(biomeName);
addDesertWolfSpawning(biomeName);
/*biomeGen.addFeature(SURFACE_STRUCTURES, AtumFeatures.LIMESTONE_SPIKE_CONFIGURED);
Expand Down Expand Up @@ -159,7 +165,7 @@ public static Biome makeOasis(String biomeName) {
}

public static Biome makeSandDunes(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
addDefaultSpawns(biomeName);
addCamelSpawning(biomeName);
/*iomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DEADWOOD_0_01_1);
Expand All @@ -182,7 +188,7 @@ public static Biome makeSandDunes(String biomeName) {
}

public static Biome makeSandHills(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
addDefaultSpawns(biomeName);
addDesertWolfSpawning(biomeName);
/*biomeGen.addFeature(VEGETAL_DECORATION, AtumFeatures.DEADWOOD_0_08_1);
Expand All @@ -203,7 +209,7 @@ public static Biome makeSandHills(String biomeName) {
}

public static Biome makeSandPlains(String biomeName) {
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder()/*.surfaceBuilder(AtumSurfaceBuilders.SANDY)*/);
BiomeGenerationSettings.Builder biomeGen = (new BiomeGenerationSettings.Builder());
addDefaultSpawns(biomeName);
addCamelSpawning(biomeName);
/*biomeGen.addStructureStart(AtumStructures.GIRAFI_TOMB_FEATURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public enum BiomeRegion implements StringRepresentable {
DESSICATED_WOODS("dessicated_woods"),
SCORCHED_CHASMS("scorched_chasms"),
SUNSCARRED_CLAIM("sunscarred_claim"),
ABYSSAL_REACHES("abyssal_reaches");
ABYSSAL_REACHES("abyssal_reaches"),
DEPTHS("depths");;

private final String name;

Expand Down
10 changes: 10 additions & 0 deletions src/main/resources/assets/atum/blockstates/karst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"variants": {
"": [
{ "model": "atum:block/karst" },
{ "model": "atum:block/karst_mirrored" },
{ "model": "atum:block/karst", "y": 180 },
{ "model": "atum:block/karst_mirrored", "y": 180 }
]
}
}
6 changes: 6 additions & 0 deletions src/main/resources/assets/atum/models/block/karst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "atum:block/karst"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_mirrored_all",
"textures": {
"all": "atum:block/karst"
}
}
3 changes: 3 additions & 0 deletions src/main/resources/assets/atum/models/item/karst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "atum:block/karst"
}
32 changes: 31 additions & 1 deletion src/main/resources/data/atum/dimension/atum.json
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@
],
"continentalness": [
0.1,
0.2
0.25
]
},
"biome": "atum:dead_oasis"
Expand Down Expand Up @@ -273,6 +273,36 @@
]
},
"biome": "atum:dried_river"
},
{
"parameters": {
"erosion": [
-1.0,
1.0
],
"depth": [
0.2,
0.9
],
"weirdness": [
-1.0,
1.0
],
"offset": 0.0,
"temperature": [
0.55,
1.0
],
"humidity": [
-1.0,
-0.35
],
"continentalness": [
0.8,
1.0
]
},
"biome": "atum:karst_caves"
}
]
},
Expand Down
43 changes: 43 additions & 0 deletions src/main/resources/data/atum/loot_tables/blocks/karst.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:alternatives",
"children": [
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
],
"name": "atum:karst"
},
{
"type": "minecraft:item",
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"name": "atum:limestone_cracked"
}
]
}
]
}
]
}

0 comments on commit 3ed264a

Please sign in to comment.