Skip to content

Commit

Permalink
Hello darkness, my old friend. I've come to talk with you again.
Browse files Browse the repository at this point in the history
- **This release is based on 1.11.4, and is released to patch a game breaking issue!**
- Bump version to 1.11.5
- Issues Fixed:
  - Fix #380
  - Fix #379
  - Fix #378
  - Fix #371
  - Fix #369
  - Fix #354
- Dependency Removal:
  - LibStructure
  - Cloth API: Dynamic Registry API
- Dependency Updates:
  - Minecraft -> 1.16.5
  - Cardinal Components -> 2.7.10
  - Shapes -> 1.0.0+build.4
  - Patchouli -> 1.16.4-48-FABRIC
  - LBA -> 0.8.5
  - Auto Config -> 3.3.1
  - TR Energy -> 0.1.1
  - Cloth Config -> 4.8.3
  - Cloth API -> 1.4.9
  - JOML -> 1.10.0
  - PigLib -> 1.0.2-1.16
  - Fermion -> 1.10.218
  - REI -> 5.8.10
  - Mod Menu -> 1.14.13+build.19
  - Tech Reborn -> 3.7.3+build.192
  - Reborn Core -> 4.6.3+build.110

"I saw 14,000,605 possible outcomes."
"How many did we win?"
"...One."
  • Loading branch information
shedaniel committed Jan 16, 2021
1 parent fb75818 commit 637ed17
Show file tree
Hide file tree
Showing 13 changed files with 126 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.render.SkyProperties;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
Expand All @@ -40,7 +39,7 @@ public MarsSkyProperties() {
}

@Override
public Vec3d adjustSkyColor(Vec3d color, float sunHeight) {
public Vec3d adjustFogColor(Vec3d color, float sunHeight) {
return new Vec3d(0.8, 0.5, 0.08);
}

Expand All @@ -50,7 +49,7 @@ public boolean useThickFog(int camX, int camY) {
}

@Override
public float[] getSkyColor(float skyAngle, float tickDelta) {
public float[] getFogColorOverride(float skyAngle, float tickDelta) {
// Help me, how in the world does this work
float g = MathHelper.cos(skyAngle * 6.2831855F) - 0.0F;
if (g >= -0.4F && g <= 0.4F) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.render.SkyProperties;
import net.minecraft.util.math.Vec3d;

Expand All @@ -37,7 +36,7 @@ public MoonSkyProperties() {
}

@Override
public Vec3d adjustSkyColor(Vec3d color, float sunHeight) {
public Vec3d adjustFogColor(Vec3d color, float sunHeight) {
return color.multiply(0.15000000596046448D);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.render.SkyProperties;
import net.minecraft.util.math.Vec3d;

Expand All @@ -37,7 +36,7 @@ public SpaceSkyProperties() {
}

@Override
public Vec3d adjustSkyColor(Vec3d color, float sunHeight) {
public Vec3d adjustFogColor(Vec3d color, float sunHeight) {
return color.multiply(0.15000000596046448D);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import net.minecraft.client.render.SkyProperties;
import net.minecraft.util.math.Vec3d;

Expand All @@ -37,7 +36,7 @@ public VulcanSkyProperties() {
}

@Override
public Vec3d adjustSkyColor(Vec3d color, float sunHeight) {
public Vec3d adjustFogColor(Vec3d color, float sunHeight) {
return new Vec3d(0.4, 0.35, 0.31);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@

package com.github.chainmailstudios.astromine.discoveries.common.world.feature;

import com.github.chainmailstudios.astromine.common.utilities.data.Range;
import com.github.chainmailstudios.astromine.discoveries.client.registry.AsteroidOreRegistry;
import com.github.chainmailstudios.astromine.discoveries.registry.AstromineDiscoveriesBlocks;
import com.mojang.serialization.Codec;
import com.terraformersmc.terraform.shapes.api.Position;
import com.terraformersmc.terraform.shapes.api.Quaternion;
import com.terraformersmc.terraform.shapes.api.Shape;
import com.terraformersmc.terraform.shapes.impl.Shapes;
import com.terraformersmc.terraform.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.terraform.shapes.impl.layer.transform.TranslateLayer;
import net.minecraft.block.Block;
import net.minecraft.util.Pair;
import net.minecraft.util.collection.WeightedList;
Expand All @@ -32,17 +42,6 @@
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import com.mojang.serialization.Codec;

import com.github.chainmailstudios.astromine.common.utilities.data.Range;
import com.github.chainmailstudios.astromine.discoveries.client.registry.AsteroidOreRegistry;
import com.github.chainmailstudios.astromine.discoveries.registry.AstromineDiscoveriesBlocks;
import com.terraformersmc.shapes.api.Position;
import com.terraformersmc.shapes.api.Quaternion;
import com.terraformersmc.shapes.api.Shape;
import com.terraformersmc.shapes.impl.Shapes;
import com.terraformersmc.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.shapes.impl.layer.transform.TranslateLayer;
import org.jetbrains.annotations.Nullable;

import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,19 @@

package com.github.chainmailstudios.astromine.discoveries.common.world.feature;

import com.github.chainmailstudios.astromine.discoveries.registry.AstromineDiscoveriesBlocks;
import com.mojang.serialization.Codec;
import com.terraformersmc.terraform.shapes.api.Position;
import com.terraformersmc.terraform.shapes.api.Quaternion;
import com.terraformersmc.terraform.shapes.api.Shape;
import com.terraformersmc.terraform.shapes.impl.Shapes;
import com.terraformersmc.terraform.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.terraform.shapes.impl.layer.transform.TranslateLayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import com.mojang.serialization.Codec;

import com.github.chainmailstudios.astromine.discoveries.registry.AstromineDiscoveriesBlocks;
import com.terraformersmc.shapes.api.Position;
import com.terraformersmc.shapes.api.Quaternion;
import com.terraformersmc.shapes.api.Shape;
import com.terraformersmc.shapes.impl.Shapes;
import com.terraformersmc.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.shapes.impl.layer.transform.TranslateLayer;

import java.util.Random;
import java.util.stream.Collectors;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@

package com.github.chainmailstudios.astromine.foundations.common.world.feature;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsFluids;
import com.mojang.serialization.Codec;
import com.terraformersmc.terraform.shapes.api.Position;
import com.terraformersmc.terraform.shapes.impl.Shapes;
import com.terraformersmc.terraform.shapes.impl.layer.transform.NoiseTranslateLayer;
import com.terraformersmc.terraform.shapes.impl.layer.transform.TranslateLayer;
import net.minecraft.block.Block;
import net.minecraft.block.FluidBlock;
import net.minecraft.util.Lazy;
Expand All @@ -35,14 +42,6 @@
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import com.mojang.serialization.Codec;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsFluids;
import com.terraformersmc.shapes.api.Position;
import com.terraformersmc.shapes.impl.Shapes;
import com.terraformersmc.shapes.impl.layer.transform.NoiseTranslateLayer;
import com.terraformersmc.shapes.impl.layer.transform.TranslateLayer;

import java.util.Random;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,31 @@

package com.github.chainmailstudios.astromine.foundations.common.world.feature;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.common.noise.OpenSimplexNoise;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsBlocks;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsFeatures;
import com.terraformersmc.terraform.shapes.api.Position;
import com.terraformersmc.terraform.shapes.api.Quaternion;
import com.terraformersmc.terraform.shapes.api.Shape;
import com.terraformersmc.terraform.shapes.impl.Shapes;
import com.terraformersmc.terraform.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.terraform.shapes.impl.layer.transform.TranslateLayer;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.fluid.Fluids;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.structure.StructureManager;
import net.minecraft.structure.StructurePieceWithDimensions;
import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.math.*;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.Heightmap;
import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.World;
import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.common.noise.OpenSimplexNoise;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsBlocks;
import com.github.chainmailstudios.astromine.foundations.registry.AstromineFoundationsFeatures;
import com.terraformersmc.shapes.api.Position;
import com.terraformersmc.shapes.api.Quaternion;
import com.terraformersmc.shapes.api.Shape;
import com.terraformersmc.shapes.impl.Shapes;
import com.terraformersmc.shapes.impl.layer.transform.RotateLayer;
import com.terraformersmc.shapes.impl.layer.transform.TranslateLayer;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,28 @@

package com.github.chainmailstudios.astromine.foundations.registry;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.foundations.AstromineFoundationsCommon;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.CrudeOilFeature;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.MeteorFeature;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.MeteorGenerator;
import com.github.chainmailstudios.astromine.registry.AstromineFeatures;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectionContext;
import net.fabricmc.fabric.api.biome.v1.ModificationPhase;
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
import net.minecraft.structure.StructurePieceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.chunk.StructureConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.StructureFeature;
import net.minecraft.world.gen.feature.*;

import com.github.chainmailstudios.astromine.AstromineCommon;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.CrudeOilFeature;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.MeteorFeature;
import com.github.chainmailstudios.astromine.foundations.common.world.feature.MeteorGenerator;
import com.github.chainmailstudios.astromine.registry.AstromineFeatures;
import me.shedaniel.cloth.api.dynamic.registry.v1.BiomesRegistry;
import me.shedaniel.cloth.api.dynamic.registry.v1.DynamicRegistryCallback;
import net.earthcomputer.libstructure.LibStructure;
import java.util.function.Predicate;

public class AstromineFoundationsFeatures extends AstromineFeatures {
public static final Identifier ASTROMINE_FOUNDATIONS_MODIFICATIONS_FEATURES = AstromineFoundationsCommon.identifier("foundations_odifications_features");
public static final Identifier METEOR_ID = AstromineCommon.identifier("meteor");
public static final StructurePieceType METEOR_STRUCTURE = register(MeteorGenerator::new, METEOR_ID);
public static final RegistryKey<ConfiguredStructureFeature<?, ?>> METEOR_KEY = RegistryKey.of(Registry.CONFIGURED_STRUCTURE_FEATURE_WORLDGEN, METEOR_ID);
Expand All @@ -58,18 +57,26 @@ public class AstromineFoundationsFeatures extends AstromineFeatures {
public static void initialize() {
MeteorFeature meteor = new MeteorFeature(DefaultFeatureConfig.CODEC);
ConfiguredStructureFeature<DefaultFeatureConfig, ? extends StructureFeature<DefaultFeatureConfig>> meteorStructure = meteor.configure(new DefaultFeatureConfig());
LibStructure.registerStructure(METEOR_ID, meteor, GenerationStep.Feature.RAW_GENERATION, new StructureConfig(32, 8, 12345), meteorStructure);
FabricStructureBuilder.create(METEOR_ID, meteor)
.step(GenerationStep.Feature.SURFACE_STRUCTURES)
.defaultConfig(32, 8, 12345)
.superflatFeature(meteorStructure)
.register();

DynamicRegistryCallback.callback(Registry.BIOME_KEY).register((manager, key, biome) -> {
if (biome.getCategory() != Biome.Category.NETHER && biome.getCategory() != Biome.Category.THEEND) {
BiomesRegistry.registerStructure(manager, biome, () -> meteorStructure);
}
});
BiomeModifications.create(ASTROMINE_FOUNDATIONS_MODIFICATIONS_FEATURES)
.add(ModificationPhase.ADDITIONS, overworldPredicate(), context -> {
context.getGenerationSettings().addStructure(METEOR_KEY);
})
.add(ModificationPhase.ADDITIONS, oceanPredicate(), context -> {
context.getGenerationSettings().addFeature(GenerationStep.Feature.LAKES, CRUDE_OIL_KEY);
});
}

private static Predicate<BiomeSelectionContext> overworldPredicate() {
return context -> context.getBiome().getCategory() != Biome.Category.NETHER && context.getBiome().getCategory() != Biome.Category.THEEND;
}

DynamicRegistryCallback.callback(Registry.BIOME_KEY).register((manager, key, biome) -> {
if (biome.getCategory() == Biome.Category.OCEAN || biome.getCategory() == Biome.Category.DESERT) {
BiomesRegistry.registerFeature(manager, biome, GenerationStep.Feature.LAKES, CRUDE_OIL_KEY);
}
});
private static Predicate<BiomeSelectionContext> oceanPredicate() {
return context -> context.getBiome().getCategory() == Biome.Category.OCEAN;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,21 @@

package com.github.chainmailstudios.astromine.foundations.registry;

import com.github.chainmailstudios.astromine.foundations.AstromineFoundationsCommon;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectionContext;
import net.fabricmc.fabric.api.biome.v1.ModificationPhase;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.ConfiguredFeature;

import com.github.chainmailstudios.astromine.foundations.AstromineFoundationsCommon;
import me.shedaniel.cloth.api.dynamic.registry.v1.BiomesRegistry;
import me.shedaniel.cloth.api.dynamic.registry.v1.DynamicRegistryCallback;
import java.util.function.Predicate;

public class AstromineFoundationsOres {
public static final Identifier ASTROMINE_FOUNDATIONS_MODIFICATIONS_ORES = AstromineFoundationsCommon.identifier("foundations_odifications_ores");
public static final Identifier TIN_ORE_ID = AstromineFoundationsCommon.identifier("tin_ore");
public static final RegistryKey<ConfiguredFeature<?, ?>> TIN_ORE_KEY = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN, TIN_ORE_ID);

Expand All @@ -49,17 +52,22 @@ public class AstromineFoundationsOres {
public static final RegistryKey<ConfiguredFeature<?, ?>> LEAD_ORE_KEY = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN, LEAD_ORE_ID);

public static void initialize() {
DynamicRegistryCallback.callback(Registry.BIOME_KEY).register((manager, key, biome) -> {
if (biome.getCategory() != Biome.Category.NETHER && biome.getCategory() != Biome.Category.THEEND) {
if (AstromineFoundationsConfig.get().overworldTinOre)
BiomesRegistry.registerFeature(manager, biome, GenerationStep.Feature.UNDERGROUND_ORES, TIN_ORE_KEY);
if (AstromineFoundationsConfig.get().overworldCopperOre)
BiomesRegistry.registerFeature(manager, biome, GenerationStep.Feature.UNDERGROUND_ORES, COPPER_ORE_KEY);
if (AstromineFoundationsConfig.get().overworldSilverOre)
BiomesRegistry.registerFeature(manager, biome, GenerationStep.Feature.UNDERGROUND_ORES, SILVER_ORE_KEY);
if (AstromineFoundationsConfig.get().overworldLeadOre)
BiomesRegistry.registerFeature(manager, biome, GenerationStep.Feature.UNDERGROUND_ORES, LEAD_ORE_KEY);
}
});
BiomeModifications.create(ASTROMINE_FOUNDATIONS_MODIFICATIONS_ORES)
.add(ModificationPhase.ADDITIONS, overworldPredicate().and(context -> AstromineFoundationsConfig.get().overworldTinOre), context -> {
context.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, TIN_ORE_KEY);
})
.add(ModificationPhase.ADDITIONS, overworldPredicate().and(context -> AstromineFoundationsConfig.get().overworldCopperOre), context -> {
context.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, COPPER_ORE_KEY);
})
.add(ModificationPhase.ADDITIONS, overworldPredicate().and(context -> AstromineFoundationsConfig.get().overworldSilverOre), context -> {
context.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, SILVER_ORE_KEY);
})
.add(ModificationPhase.ADDITIONS, overworldPredicate().and(context -> AstromineFoundationsConfig.get().overworldLeadOre), context -> {
context.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, LEAD_ORE_KEY);
});
}

private static Predicate<BiomeSelectionContext> overworldPredicate() {
return context -> context.getBiome().getCategory() != Biome.Category.NETHER && context.getBiome().getCategory() != Biome.Category.THEEND;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "astromine:meteor",
"config": {}
}
Loading

0 comments on commit 637ed17

Please sign in to comment.