Skip to content

Commit

Permalink
make rubber trees more common (1.19) (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
screret authored Jul 31, 2023
1 parent b20aaea commit f9746da
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ public static class WorldGenConfigs {
@Configurable
@Configurable.Comment({"Debug ore vein placement? (will print placed veins to server's debug.log)", "Default: false (no placement printout in debug.log)"})
public boolean debugWorldgen;

@Configurable
@Configurable.Comment({"Rubber Tree spawn chance (% per chunk)", "Default: 0.5"})
public float rubberTreeSpawnChance = 0.5f;
}

public static class MachineConfigs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTPlacements;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CustomTags;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -63,11 +64,12 @@ public static void register() {
new BiomePlacement(List.of(
new BiomeWeightModifier(biomeRegistry.getOrCreateTag(CustomTags.IS_SWAMP), 50)
)),
PlacementUtils.countExtra(0, 0.005F, 1),
InSquarePlacement.spread(), VegetationPlacements.TREE_THRESHOLD,
PlacementUtils.countExtra(0, ConfigHolder.INSTANCE.worldgen.rubberTreeSpawnChance, 1),
InSquarePlacement.spread(),
VegetationPlacements.TREE_THRESHOLD,
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(GTBlocks.RUBBER_SAPLING.getDefaultState(), BlockPos.ZERO)),
BiomeFilter.biome()
BiomeFilter.biome(),
PlacementUtils.filteredByBlockSurvival(GTBlocks.RUBBER_SAPLING.get())
));

Registry.register(BuiltinRegistries.PLACED_FEATURE, id, placedFeature);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.gregtechceu.gtceu.api.registry.GTRegistries;
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTPlacements;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CustomTags;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
Expand Down Expand Up @@ -84,11 +85,12 @@ public static void register() {
new BiomePlacement(List.of(
new BiomeWeightModifier(biomeRegistry.getOrCreateTag(CustomTags.IS_SWAMP), 50)
)),
PlacementUtils.countExtra(0, 0.005F, 1),
InSquarePlacement.spread(), VegetationPlacements.TREE_THRESHOLD,
PlacementUtils.countExtra(0, ConfigHolder.INSTANCE.worldgen.rubberTreeSpawnChance, 1),
InSquarePlacement.spread(),
VegetationPlacements.TREE_THRESHOLD,
PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(GTBlocks.RUBBER_SAPLING.getDefaultState(), BlockPos.ZERO)),
BiomeFilter.biome()
BiomeFilter.biome(),
PlacementUtils.filteredByBlockSurvival(GTBlocks.RUBBER_SAPLING.get())
));
});

Expand Down

0 comments on commit f9746da

Please sign in to comment.