From 2f8b4bcf2060b8841b1b8f662a177909fb64f38d Mon Sep 17 00:00:00 2001 From: abelhooge Date: Fri, 3 Jul 2020 20:23:14 +0200 Subject: [PATCH] Fixed the Strata generator from creating an unpleasant world of shitstone. --- src/main/java/com/terraforged/api/material/WGTags.java | 1 + .../com/terraforged/api/material/geology/StrataConfig.java | 3 ++- src/main/java/com/terraforged/mod/material/Materials.java | 5 +++++ .../com/terraforged/mod/material/geology/GeoGenerator.java | 3 +++ src/main/resources/data/forge/tags/blocks/wg_cold.json | 6 ++++++ 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/data/forge/tags/blocks/wg_cold.json diff --git a/src/main/java/com/terraforged/api/material/WGTags.java b/src/main/java/com/terraforged/api/material/WGTags.java index 9cf6f76..8e8cf3a 100644 --- a/src/main/java/com/terraforged/api/material/WGTags.java +++ b/src/main/java/com/terraforged/api/material/WGTags.java @@ -40,6 +40,7 @@ public class WGTags { public static final Tag CLAY = tag("wg_clay"); public static final Tag SEDIMENT = tag("wg_sediment"); public static final Tag ERODIBLE = tag("wg_erodible"); + public static final Tag COLD = tag("wg_cold"); public static void init() { diff --git a/src/main/java/com/terraforged/api/material/geology/StrataConfig.java b/src/main/java/com/terraforged/api/material/geology/StrataConfig.java index 8078601..e0991a9 100644 --- a/src/main/java/com/terraforged/api/material/geology/StrataConfig.java +++ b/src/main/java/com/terraforged/api/material/geology/StrataConfig.java @@ -32,7 +32,8 @@ public class StrataConfig { public Config soil = new Config(0, 1, 0.1F, 0.25F); public Config sediment = new Config(0, 2, 0.05F, 0.15F); public Config clay = new Config(0, 2, 0.05F, 0.1F); - public Config rock = new Config(10, 30, 0.1F, 1.5F); + public Config rock = new Config(2, 4, 0.05F, 0.1F); + public Config cold = new Config(10, 30, 0.1F, 1.5F); public static class Config { diff --git a/src/main/java/com/terraforged/mod/material/Materials.java b/src/main/java/com/terraforged/mod/material/Materials.java index f493350..95ab192 100644 --- a/src/main/java/com/terraforged/mod/material/Materials.java +++ b/src/main/java/com/terraforged/mod/material/Materials.java @@ -57,11 +57,16 @@ public class Materials { public final Set clay = create(WGTags.CLAY, States.CLAY.getBlock()); public final Set sediment = create(WGTags.SEDIMENT, States.GRAVEL.getBlock()); public final Set erodible = create(WGTags.ERODIBLE, null); + public final Set cold = create(WGTags.COLD, States.STONE.getBlock()); public LayerManager getLayerManager() { return layerManager; } + public boolean isCold(Block block) { + return cold.contains(block); + } + public boolean isStone(Block block) { return stone.contains(block); } diff --git a/src/main/java/com/terraforged/mod/material/geology/GeoGenerator.java b/src/main/java/com/terraforged/mod/material/geology/GeoGenerator.java index 5918dcf..2b84acd 100644 --- a/src/main/java/com/terraforged/mod/material/geology/GeoGenerator.java +++ b/src/main/java/com/terraforged/mod/material/geology/GeoGenerator.java @@ -44,6 +44,7 @@ public class GeoGenerator implements StrataGenerator { private final List soil; private final List clay; private final List sediment; + private final List cold; private final List types = new ArrayList<>(); public GeoGenerator(Materials materials) { @@ -52,6 +53,7 @@ public class GeoGenerator implements StrataGenerator { soil = Materials.toList(materials.dirt); clay = Materials.toList(materials.clay); sediment = Materials.toList(materials.sediment); + cold = Materials.toList(materials.cold); } @Override @@ -62,6 +64,7 @@ public class GeoGenerator implements StrataGenerator { addLayer(seed + 2, random, config.sediment, sediment, builder); addLayer(seed + 3, random, config.clay, clay, builder); addLayer(seed + 4, random, config.rock, rock, builder); + addLayer(seed + 5, random, config.cold, cold, builder); return builder.build(); } diff --git a/src/main/resources/data/forge/tags/blocks/wg_cold.json b/src/main/resources/data/forge/tags/blocks/wg_cold.json new file mode 100644 index 0000000..52fd055 --- /dev/null +++ b/src/main/resources/data/forge/tags/blocks/wg_cold.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "minecraft:stone" + ] +} \ No newline at end of file