Skip to content

Commit

Permalink
Merge pull request #27 from infernalstudios/1.19-Feature-Fix
Browse files Browse the repository at this point in the history
1.19 Converted features to JSON
  • Loading branch information
Dariensg authored Jun 29, 2022
2 parents 983e436 + 9c12bc4 commit 96899b9
Show file tree
Hide file tree
Showing 55 changed files with 847 additions and 1,008 deletions.
11 changes: 2 additions & 9 deletions src/main/java/org/infernalstudios/miningmaster/MiningMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.infernalstudios.miningmaster.client.MiningMasterClient;
import org.infernalstudios.miningmaster.config.MiningMasterConfig;
import org.infernalstudios.miningmaster.enchantments.GraceEnchantment;
import org.infernalstudios.miningmaster.enchantments.HeartfeltEnchantment;
import org.infernalstudios.miningmaster.enchantments.KnightJumpEnchantment;
import org.infernalstudios.miningmaster.enchantments.RunnerEnchantment;
import org.infernalstudios.miningmaster.enchantments.SnowpiercerEnchantment;
import org.infernalstudios.miningmaster.world.features.RandomGemOreFeature;
import org.infernalstudios.miningmaster.world.features.RandomNetherGemOreFeature;
import org.infernalstudios.miningmaster.init.MMBlocks;
import org.infernalstudios.miningmaster.init.MMContainerTypes;
import org.infernalstudios.miningmaster.init.MMEnchantments;
import org.infernalstudios.miningmaster.init.MMFeatures;
import org.infernalstudios.miningmaster.init.MMItems;
import org.infernalstudios.miningmaster.init.MMLootModifiers;
import org.infernalstudios.miningmaster.init.MMRecipes;
Expand Down Expand Up @@ -72,6 +69,7 @@ public MiningMaster() {
MMTileEntityTypes.register(modEventBus);
MMSounds.register(modEventBus);
MMLootModifiers.register(modEventBus);
MMFeatures.register(modEventBus);

MinecraftForge.EVENT_BUS.register(new MiningMasterEvents());
MinecraftForge.EVENT_BUS.addListener(RunnerEnchantment::onItemAttributeModifierCalculate);
Expand All @@ -82,14 +80,9 @@ public MiningMaster() {
MinecraftForge.EVENT_BUS.addListener(GraceEnchantment::onLivingUpdate);
MinecraftForge.EVENT_BUS.addListener(KnightJumpEnchantment::onClientTick);

// Registering Configs
modLoadingContext.registerConfig(ModConfig.Type.COMMON, MiningMasterConfig.CONFIG_SPEC);
}

private void commonSetup(final FMLCommonSetupEvent event) {
RandomNetherGemOreFeature.calculateEnabledOres();
RandomGemOreFeature.calculateEnabledOres();

event.enqueueWork(MMNetworkHandler::register);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegisterEvent;
import org.infernalstudios.miningmaster.init.MMFeatures;
import org.infernalstudios.miningmaster.init.MMRecipes;
import org.infernalstudios.miningmaster.recipes.ForgingRecipe;

Expand All @@ -30,7 +29,6 @@ public class MiningMasterEvents {
// Register the custom ore features and recipe types
@SubscribeEvent
public static void registerFeaturesAndRecipeTypes(RegisterEvent event) {
event.register(ForgeRegistries.Keys.FEATURES, helper -> MMFeatures.features.forEach(helper::register));
event.register(ForgeRegistries.Keys.RECIPE_TYPES, helper -> helper.register(ForgingRecipe.TYPE_ID, MMRecipes.FORGING_RECIPE_TYPE));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.client.RecipeBookRegistry;
import net.minecraftforge.fml.ModLoadingContext;
import org.infernalstudios.miningmaster.client.gui.screen.inventory.GemForgeScreen;
import org.infernalstudios.miningmaster.config.gui.ConfigScreen;
import org.infernalstudios.miningmaster.init.MMContainerTypes;
import org.infernalstudios.miningmaster.init.MMItems;
import org.infernalstudios.miningmaster.init.MMRecipes;
Expand All @@ -36,9 +33,6 @@ public class MiningMasterClient {
private static RecipeBookCategories GEM_FORGE;

public static void init() {
// Registering Config GUI Extension Point
ModLoadingContext.get().registerExtensionPoint(ConfigGuiHandler.ConfigGuiFactory.class, () -> new ConfigGuiHandler.ConfigGuiFactory(((minecraft, screen) -> new ConfigScreen())));

MenuScreens.register(MMContainerTypes.GEM_FORGE_CONTAINER.get(), GemForgeScreen::new);

GEM_FORGE = RecipeBookCategories.create("GEM_FORGE", new ItemStack(MMItems.FIRE_RUBY.get()));
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 96899b9

Please sign in to comment.