Skip to content

Commit

Permalink
Update to 1.16.x-1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
JayCeeCreates committed Jun 14, 2021
1 parent 7074d43 commit 9f330d2
Show file tree
Hide file tree
Showing 58 changed files with 88 additions and 702 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

***

## 1.16.x-1.0.3
Since 1.17 is out now, the quest to port EarlyGame to 1.17 has begun! Updates are still slow, but I'll try my best to update as much as I can!
- (*) Common stick tag in all tool recipes for better compatibility with mods that add modded sticks
- (*) Revamped prop generation with a (kind of) new feature generation algorithm
- (*) Rock generation can now be disabled

## 1.16.x-1.0.2
- (+) You can now get plant fiber from ferns
- (*) Compatibility with sticks from ATBYW (#17)
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center">
<a href="https://github.com/JayCeeCreates/earlygame/blob/master/LICENSE"><img src="https://img.shields.io/github/license/jayceecreates/earlygame?style=for-the-badge"></a>
<img src="https://img.shields.io/badge/mc%20version-1.16.x-brightgreen?style=for-the-badge">
<img src="https://img.shields.io/badge/mod%20version-1.0.2-yellow?style=for-the-badge">
<img src="https://img.shields.io/badge/mod%20version-1.0.3-yellow?style=for-the-badge">
<a href="https://fabricmc.net"><img src="https://img.shields.io/badge/modloader-fabric-blue?style=for-the-badge"></a>
</p>

Expand Down Expand Up @@ -57,6 +57,10 @@ More details are in the [wiki](https://github.com/JayCeeCreates/earlygame/wiki).

Incompatibilities and bugs can be reported in the [issues](https://github.com/JayCeeCreates/earlygame/issues) section.

## Recommended Mods

- **[Unlit Campfire](https://www.curseforge.com/minecraft/mc-mods/unlit-campfire)**: placing campfires on unlit state by default

## Credits

- **Fabric Discord community** (a great help for the code)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.11.1

# Mod Properties
mod_version = 1.16.x-1.0.2
mod_version = 1.16.x-1.0.3
maven_group = jayceecreates.earlygame
archives_base_name = earlygame

Expand Down
13 changes: 10 additions & 3 deletions src/main/java/jayceecreates/earlygame/EarlyGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import jayceecreates.earlygame.config.EarlyGameConfig;
import jayceecreates.earlygame.init.*;
import jayceecreates.earlygame.utils.ModConfiguredFeatures;
import jayceecreates.earlygame.world.CopperOreGen;

import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.serializer.GsonConfigSerializer;
import net.fabricmc.api.ModInitializer;
Expand All @@ -18,14 +20,14 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

@SuppressWarnings("deprecation")
public class EarlyGame implements ModInitializer {

public static EarlyGameConfig CONFIG;

public static final Logger LOGGER = LogManager.getLogger("EarlyGame");

@Override
@SuppressWarnings("deprecation")
public void onInitialize() {

// config
Expand All @@ -38,10 +40,15 @@ public void onInitialize() {
EventsInit.init();

// world gen
RegistryKey<ConfiguredFeature<?, ?>> copperOreGen = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN,
new Identifier("earlygame", "copper_ore_gen"));
RegistryKey<ConfiguredFeature<?, ?>> copperOreGen = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN, new Identifier("earlygame", "copper_ore_gen"));
RegistryKey<ConfiguredFeature<?, ?>> stickTwigGen = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN, new Identifier("earlygame", "stick_twig_gen"));
RegistryKey<ConfiguredFeature<?, ?>> stoneRockGen = RegistryKey.of(Registry.CONFIGURED_FEATURE_WORLDGEN, new Identifier("earlygame", "stone_rock_gen"));
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, copperOreGen.getValue(), CopperOreGen.COPPER_ORE_GEN);
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, stickTwigGen.getValue(), ModConfiguredFeatures.STICK_TWIG);
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, stoneRockGen.getValue(), ModConfiguredFeatures.ROCK_BLOCK);
if (CONFIG.generateCopper) BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, copperOreGen);
if (CONFIG.generateSticks) BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.VEGETAL_DECORATION, stickTwigGen);
if (CONFIG.generateStones) BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.VEGETAL_DECORATION, stoneRockGen);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ public class EarlyGameConfig implements ConfigData {
public boolean warningMessage = false;

@ConfigEntry.Gui.Tooltip(count = 6)
@ConfigEntry.Gui.RequiresRestart
public boolean generateStones = true;

@ConfigEntry.Gui.Tooltip(count = 6)
@ConfigEntry.Gui.RequiresRestart
public boolean generateSticks = true;

@ConfigEntry.Gui.Tooltip(count = 8)
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/jayceecreates/earlygame/mixin/CopperOreGenMixin.java

This file was deleted.

104 changes: 0 additions & 104 deletions src/main/java/jayceecreates/earlygame/mixin/StickTwigGenMixin.java

This file was deleted.

104 changes: 0 additions & 104 deletions src/main/java/jayceecreates/earlygame/mixin/StoneRockGenMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,28 +1,19 @@
package jayceecreates.earlygame.utils;

import net.minecraft.util.Identifier;
import net.minecraft.util.registry.BuiltinRegistries;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.ConfiguredFeatures;
import net.minecraft.world.gen.feature.FeatureConfig;

public class ModConfiguredFeatures {
public static final ConfiguredFeature<?, ?> ROCK_BLOCK = Registry.register(
BuiltinRegistries.CONFIGURED_FEATURE,
new Identifier("earlygame", "rock_block_gen"),
public static final ConfiguredFeature<?, ?> ROCK_BLOCK =
ModFeature.ROCK_BLOCK_FEATURE
.configure(FeatureConfig.DEFAULT)
.decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP)
.repeat(4)
);
.repeat(4);

public static final ConfiguredFeature<?, ?> STICK_TWIG = Registry.register(
BuiltinRegistries.CONFIGURED_FEATURE,
new Identifier("earlygame", "stick_twig_gen"),
public static final ConfiguredFeature<?, ?> STICK_TWIG =
ModFeature.STICK_TWIG_FEATURE
.configure(FeatureConfig.DEFAULT)
.decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP)
.repeat(3)
);
.repeat(3);
}
16 changes: 6 additions & 10 deletions src/main/java/jayceecreates/earlygame/world/StickTwigGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.mojang.serialization.Codec;

import jayceecreates.earlygame.EarlyGame;
import jayceecreates.earlygame.init.BlocksInit;
import jayceecreates.earlygame.utils.ModBlockTags;
import net.minecraft.block.BlockState;
Expand All @@ -22,17 +21,14 @@ public StickTwigGen(Codec<DefaultFeatureConfig> configCodec) {

@Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
DefaultFeatureConfig featureConfig) {
if (EarlyGame.CONFIG.generateSticks) {
BlockState stateAt = world.getBlockState(pos);
BlockState stateDown = world.getBlockState(pos.down());
if (stateAt.isAir() && ModBlockTags.ROCK_PLACEABLE_ON.contains(stateDown.getBlock())) {
world.setBlockState(pos, BlocksInit.STICK_TWIG_BLOCK.getDefaultState(), 3);
return true;
}
DefaultFeatureConfig featureConfig) {
BlockState stateAt = world.getBlockState(pos);
BlockState stateDown = world.getBlockState(pos.down());
if (stateAt.isAir() && ModBlockTags.ROCK_PLACEABLE_ON.contains(stateDown.getBlock())) {
world.setBlockState(pos, BlocksInit.STICK_TWIG_BLOCK.getDefaultState(), 3);
return true;
}
else return false;
return false;
}

}
Loading

0 comments on commit 9f330d2

Please sign in to comment.