Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Juniper Primavera committed Sep 19, 2023
2 parents d3755ab + ac34eab commit 8a2001d
Show file tree
Hide file tree
Showing 3 changed files with 41 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 @@ -3,33 +3,39 @@
import io.github.teampropulsive.block.Blocks;
import io.github.teampropulsive.celestial.Star;
import io.github.teampropulsive.celestial.Terrestrial;
import io.github.teampropulsive.data.RocketReloadListener;
import io.github.teampropulsive.screen.BlueprintTableScreenHandler;
import io.github.teampropulsive.types.AtmoCompositionGas;
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.resource.ResourceManagerHelper;
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.entity.damage.DamageType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.resource.ResourceType;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec2f;
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 org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.ArrayList;

import static io.github.teampropulsive.util.Gases.*;


public class Propulsive implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger("Propulsive");
public static ArrayList<Planet> TICKABLE_PLANETS = new ArrayList<>();
public static final RegistryKey<PlacedFeature> ALUMINUM_ORE_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, id("ore_aluminum"));
public static final RegistryKey<PlacedFeature> BAUXITE_CLUSTER_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, id("ore_bauxite_cluster"));
Expand Down Expand Up @@ -61,6 +67,8 @@ public void onInitialize() {
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, ALUMINUM_ORE_PLACED_KEY);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, BAUXITE_CLUSTER_PLACED_KEY);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.UNDERGROUND_ORES, PURE_BAUXITE_CLUSTER_PLACED_KEY);

ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new RocketReloadListener());
}

// Dimensions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.github.teampropulsive.data;

import io.github.teampropulsive.Propulsive;
import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourceManager;
import net.minecraft.util.Identifier;

import java.io.InputStream;
import java.util.Map;

public class RocketReloadListener implements SimpleSynchronousResourceReloadListener {
@Override
public Identifier getFabricId() {
return Propulsive.id("rocket");
}

@Override
public void reload(ResourceManager manager) {
// Clear caches here

for (Map.Entry<Identifier, Resource> entry : manager.findResources("rockets", path -> path.getPath().endsWith(".json")).entrySet()) {
Identifier id = entry.getKey();
Resource resource = entry.getValue();
try (InputStream stream = resource.getInputStream()) {
Propulsive.LOGGER.info("Pretend like this is doing something useful with " + id.toString());
} catch (Exception e) {
Propulsive.LOGGER.error("Error occurred while loading rocket recipe " + id.toString(), e);
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/data/propulsive/rockets/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}

0 comments on commit 8a2001d

Please sign in to comment.