Skip to content

Commit

Permalink
Ores now generate
Browse files Browse the repository at this point in the history
  • Loading branch information
JunePrimavera committed Sep 1, 2023
1 parent 0f80bff commit f416071
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/io/github/teampropulsive/Propulsive.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.github.teampropulsive.space.spacecraft.SpacecraftEntity;
import io.github.teampropulsive.types.Planet;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.fabricmc.loader.api.FabricLoader;
Expand All @@ -20,6 +22,8 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.PlacedFeature;
import qouteall.q_misc_util.my_util.Vec2d;

import java.util.ArrayList;
Expand All @@ -35,6 +39,7 @@ public class Propulsive implements ModInitializer {
RocketEntity::new
).dimensions(EntityDimensions.fixed(0.75f, 0.75f)).build()
);
public static final RegistryKey<PlacedFeature> ALUMINUM_ORE_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier("propulsive","ore_aluminum"));
@Override
public void onInitialize() {

Expand All @@ -55,6 +60,9 @@ public void onInitialize() {
Items.register();

FabricDefaultAttributeRegistry.register(TEST_ROCKET, RocketEntity.createMobAttributes());

// Ores
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, ALUMINUM_ORE_PLACED_KEY);
}

// Dimensions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"type": "minecraft:ore",
"config": {
"discard_chance_on_air_exposure": 0.0,
"size": 12,
"targets": [
{
"state": {
"Name": "propulsive:aluminum_ore"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:stone_ore_replaceables"
}
},
{
"state": {
"Name": "propulsive:aluminum_ore_deepslate"
},
"target": {
"predicate_type": "minecraft:tag_match",
"tag": "minecraft:deepslate_ore_replaceables"
}
}
]
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"feature": "propulsive:ore_aluminum",
"placement": [
{
"type": "minecraft:count",
"count": 3
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:height_range",
"height": {
"type": "minecraft:trapezoid",
"max_inclusive": {
"absolute": 70
},
"min_inclusive": {
"absolute": -24
}
}
},
{
"type": "minecraft:biome"
}
]
}

0 comments on commit f416071

Please sign in to comment.