From 45b3521c577dff9d998eac2abe800297578d6813 Mon Sep 17 00:00:00 2001 From: mrthomas20121 Date: Wed, 9 Sep 2020 09:16:16 +0200 Subject: [PATCH] Modules fixes --- .../tinkers_reforged/Config/Config.java | 116 +++------- .../tinkers_reforged/modules/ModuleAA.java | 194 +++++++++++++++++ .../tinkers_reforged/modules/ModuleAe.java | 64 ++++++ .../modules/ModuleAstralSorcery.java | 50 +++++ .../tinkers_reforged/modules/ModuleAtum.java | 63 ++++++ .../modules/ModuleBlueSkies.java | 119 +++++++++++ .../modules/ModuleBotania.java | 101 +++++++++ .../modules/ModuleCavern.java | 68 ++++++ .../modules/ModuleCommonMaterials.java | 152 ++++++++++++++ .../modules/ModuleExtremeReactor.java | 108 ++++++++++ .../modules/ModuleFluids.java | 44 ++++ .../tinkers_reforged/modules/ModuleItems.java | 198 ++++++++++++++++++ .../modules/ModuleMekanism.java | 85 ++++++++ .../modules/ModuleNatureAura.java | 100 +++++++++ .../tinkers_reforged/modules/ModuleRoots.java | 70 +++++++ .../modules/ModuleThermal.java | 83 ++++++++ .../tinkers_reforged/modules/ModuleTools.java | 191 +++++++++++++++++ .../tinkers_reforged/modules/Modules.java | 114 ++++++++++ 18 files changed, 1835 insertions(+), 85 deletions(-) create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAA.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAe.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAstralSorcery.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAtum.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBlueSkies.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBotania.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCavern.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCommonMaterials.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleExtremeReactor.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleFluids.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleItems.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleMekanism.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleNatureAura.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleRoots.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleThermal.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleTools.java create mode 100644 src/main/java/mrthomas20121/tinkers_reforged/modules/Modules.java diff --git a/src/main/java/mrthomas20121/tinkers_reforged/Config/Config.java b/src/main/java/mrthomas20121/tinkers_reforged/Config/Config.java index 83e3be36..312d2b98 100644 --- a/src/main/java/mrthomas20121/tinkers_reforged/Config/Config.java +++ b/src/main/java/mrthomas20121/tinkers_reforged/Config/Config.java @@ -1,81 +1,22 @@ -package mrthomas20121.tinkers_reforged.Config; +package mrthomas20121.tinkers_reforged.config; +import mrthomas20121.biolib.config.ConfigBase; import mrthomas20121.tinkers_reforged.TinkersReforged; -import mrthomas20121.tinkers_reforged.proxy.CommonProxy; import net.minecraftforge.common.config.ConfigManager; -import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.client.event.ConfigChangedEvent; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.apache.logging.log4j.Level; +import java.util.ArrayList; + @Mod.EventBusSubscriber(modid = TinkersReforged.MODID) public class Config { - // thermalfoundation - public static boolean enderium = true; - public static boolean signalum = true; - public static boolean lumium = true; - public static boolean platinum = true; - public static boolean invar = true; - public static boolean iridium = true; - public static boolean aluminum = true; - // naturesaura - public static boolean infused_iron = true; - public static boolean ancient_wood = true; - public static boolean ingot_of_the_sky = true; - // actually additions - public static boolean blackquartz = true; - public static boolean enori = true; - public static boolean diamantine = true; - public static boolean voidcrystal = true; - public static boolean redstonia = true; - public static boolean palis = true; - public static boolean emeratic = true; - // appliedenergistic2 - public static boolean certus_quartz = true; - public static boolean fluix_crystal = true; - // astral - public static boolean starmetal = true; - // atum - public static boolean limestone = true; - public static boolean khnumite = true; - // blue skies - public static boolean ventium = true; - public static boolean horizonite = true; - public static boolean pyrope = true; - public static boolean turquoise = true; - public static boolean charoite = true; - public static boolean diopside = true; - public static boolean lunar_stone = true; - public static boolean turquoise_stone = true; - //mekanism - public static boolean refined_obsidian = true; - public static boolean refined_glowstone = true; - public static boolean osmium = true; - // mystical world - public static boolean amethyst = true; - // roots - public static boolean runestone = true; - // extreme reactor - public static boolean yellorium = true; - public static boolean cyanite = true; - public static boolean ludicrite = true; - public static boolean blutonium = true; - // tinkers' reforged - public static boolean lavium = true; - public static boolean qivium = true; - public static boolean kovar = true; - - // tools - public static boolean tools = true; - public static boolean toolGladius = true; - public static boolean toolClub = true; - public static boolean toolGreatsword = true; - public static boolean toolKhopesh = true; - public static boolean toolRunedKnife = true; - // fuels - public static boolean pyrotheum = true; + public static ConfigReforged configReforged = new ConfigReforged(); + public static ConfigModule configModule = new ConfigModule(); + public static ConfigMaterials configMaterials = new ConfigMaterials(); @SubscribeEvent public static void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent event) @@ -86,27 +27,32 @@ public static void onConfigChangedEvent(ConfigChangedEvent.OnConfigChangedEvent } } - public static void readConfig() { - Configuration cfg = CommonProxy.config; + public static void readConfig(FMLPreInitializationEvent event) { + configReforged.preInit(event); + configMaterials.preInit(event); + configModule.preInit(event); + try { - cfg.load(); - ConfigModules.moduleTinkersReforged(cfg); - ConfigModules.moduleAa(cfg); - ConfigModules.moduleAe2(cfg); - ConfigModules.moduleAstralSorcery(cfg); - ConfigModules.moduleAtum(cfg); - ConfigModules.moduleBlueSkies(cfg); - ConfigModules.moduleExtremReactor(cfg); - ConfigModules.moduleMekanism(cfg); - ConfigModules.moduleMysticalWorld(cfg); - ConfigModules.moduleNaturesAura(cfg); - ConfigModules.moduleRoots(cfg); - ConfigModules.moduleThermal(cfg); + configReforged.getConfig().load(); + configMaterials.getConfig().load(); + configModule.getConfig().load(); + if(configReforged.canLoad() || configMaterials.canLoad() || configModule.canLoad()) + { + configReforged.init(); + configMaterials.init(); + configModule.init(); + } } catch (Exception e1) { - TinkersReforged.logger.log(Level.ERROR, "Problem loading config file!", e1); + TinkersReforged.getLogger().log(Level.ERROR, "Problem loading config files!", e1); } finally { - if (cfg.hasChanged()) { - cfg.save(); + if (configReforged.getConfig().hasChanged()){ + configReforged.getConfig().save(); + } + if (configMaterials.getConfig().hasChanged()) { + configMaterials.getConfig().save(); + } + if (configModule.getConfig().hasChanged()) { + configModule.getConfig().save(); } } } diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAA.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAA.java new file mode 100644 index 00000000..dbc037fc --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAA.java @@ -0,0 +1,194 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.common.OredictHelper; +import mrthomas20121.biolib.common.SmelteryUtils; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; + +import de.ellpeck.actuallyadditions.mod.blocks.InitBlocks; +import de.ellpeck.actuallyadditions.mod.items.*; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +import static slimeknights.tconstruct.smeltery.TinkerSmeltery.castIngot; +import static slimeknights.tconstruct.smeltery.TinkerSmeltery.castNugget; + +public class ModuleAA implements ModuleBase { + + public ModuleAA() { + Resources.blackquartz.builder.setTrait(TinkerTraits.crude2, MaterialTypes.HEAD); + Resources.blackquartz.builder.setTrait(TinkerTraits.sharp); + Resources.blackquartz.builder.setHeadStats(204, 6, 4, HarvestLevels.DIAMOND); + Resources.blackquartz.builder.setHandleStats(0.95f, 60); + Resources.blackquartz.builder.setExtraStats(50); + + Resources.enori.builder.setTrait(Traits.starry_night, MaterialTypes.HEAD); + Resources.enori.builder.setTrait(Traits.starshaped); + Resources.enori.builder.setHeadStats(304, 6.5f, 6, HarvestLevels.DIAMOND); + Resources.enori.builder.setHandleStats(0.95f, 60); + Resources.enori.builder.setExtraStats(50); + + Resources.redstonia.builder.setTrait(Traits.flux); + Resources.redstonia.builder.setHeadStats(304, 6.5f, 6, HarvestLevels.DIAMOND); + Resources.redstonia.builder.setHandleStats(0.95f, 60); + Resources.redstonia.builder.setExtraStats(50); + + Resources.void_crystal.builder.setTrait(Traits.void_trait); + Resources.void_crystal.builder.setHeadStats(304, 9.5f, 6, HarvestLevels.DIAMOND); + Resources.void_crystal.builder.setHandleStats(0.95f, 60); + Resources.void_crystal.builder.setExtraStats(50); + + Resources.diamantine.builder.setTrait(Traits.carbon); + Resources.diamantine.builder.setHeadStats(604, 6.9f, 6.1f, HarvestLevels.OBSIDIAN); + Resources.diamantine.builder.setHandleStats(0.95f, 60); + Resources.diamantine.builder.setExtraStats(50); + + Resources.emeradic.builder.setTrait(Traits.villager_love, MaterialTypes.HEAD); + Resources.emeradic.builder.setTrait(Traits.curse); + Resources.emeradic.builder.setHeadStats(604, 6.9f, 6.1f, HarvestLevels.OBSIDIAN); + Resources.emeradic.builder.setHandleStats(0.95f, 60); + Resources.emeradic.builder.setExtraStats(50); + + Resources.palis.builder.setTrait(Traits.rose); + Resources.palis.builder.setHeadStats(304, 9.5f, 6, HarvestLevels.DIAMOND); + Resources.palis.builder.setHandleStats(0.95f, 60); + Resources.palis.builder.setExtraStats(50); + } + + @Override + public void preInit(FMLPreInitializationEvent e) { + Resources.blackquartz.registerFluid(); + Resources.enori.registerFluid(); + Resources.void_crystal.registerFluid(); + Resources.emeradic.registerFluid(); + Resources.palis.registerFluid(); + Resources.palis.registerFluid(); + Resources.redstonia.registerFluid(); + Resources.diamantine.registerFluid(); + + if(ConfigMaterials.blackquartz) + { + Resources.blackquartz.builder.addGem("QuartzBlack"); + Resources.blackquartz.builder.preInit("QuartzBlack", "gem", FluidRegistry.getFluid("black_quartz")); + Resources.materials.add(Resources.blackquartz); + } + + if(ConfigMaterials.enori) + { + Resources.enori.builder.addItem("gemEnori", Material.VALUE_Ingot); + Resources.enori.builder.preInit("Enori", "gem", FluidRegistry.getFluid("enori")); + Resources.materials.add(Resources.enori); + } + + if(ConfigMaterials.void_crystal) + { + Resources.void_crystal.builder.preInit("Void", "gem", FluidRegistry.getFluid("void")); + Resources.materials.add(Resources.void_crystal); + } + + if(ConfigMaterials.emeradic) + { + Resources.emeradic.builder.preInit("Emeradic", "gem", FluidRegistry.getFluid("emeradic")); + Resources.materials.add(Resources.emeradic); + } + + if(ConfigMaterials.palis) + { + Resources.palis.builder.preInit("Palis", "gem", FluidRegistry.getFluid("palis")); + Resources.materials.add(Resources.palis); + } + + if(ConfigMaterials.redstonia) + { + Resources.redstonia.builder.preInit("Redstonia", "gem", FluidRegistry.getFluid("redstonia")); + Resources.materials.add(Resources.redstonia); + } + + if(ConfigMaterials.diamantine) + { + Resources.diamantine.builder.preInit("Diamantine", "gem", FluidRegistry.getFluid("diamantine")); + Resources.materials.add(Resources.diamantine); + } + + if(Loader.isModLoaded("conarm")) + { + if(ConfigMaterials.blackquartz) armorUtils.setArmorStats(Resources.blackquartz.builder, 0); + if(ConfigMaterials.enori) armorUtils.setArmorStats(Resources.enori.builder, 0); + if(ConfigMaterials.void_crystal) armorUtils.setArmorStats(Resources.void_crystal.builder, 0); + if(ConfigMaterials.emeradic) armorUtils.setArmorStats(Resources.emeradic.builder, 0); + if(ConfigMaterials.palis) armorUtils.setArmorStats(Resources.palis.builder, 0); + if(ConfigMaterials.redstonia) armorUtils.setArmorStats(Resources.redstonia.builder, 0); + if(ConfigMaterials.diamantine) armorUtils.setArmorStats(Resources.diamantine.builder, 0); + } + } + @Override + public void init(FMLInitializationEvent e) { + OredictHelper.RegisterGemItem("Redstonia", new ItemStack(InitItems.itemCrystal, 1, 0)); + OredictHelper.RegisterGemItem("Palis", new ItemStack(InitItems.itemCrystal, 1, 1)); + OredictHelper.RegisterGemItem("Diamantine", new ItemStack(InitItems.itemCrystal, 1, 2)); + OredictHelper.RegisterGemItem("Void", new ItemStack(InitItems.itemCrystal, 1, 3)); + OredictHelper.RegisterGemItem("Emeradic", new ItemStack(InitItems.itemCrystal, 1, 4)); + OredictHelper.RegisterGemItem("Enori", new ItemStack(InitItems.itemCrystal, 1, 5)); + + OredictHelper.RegisterNuggetItem("Redstonia", new ItemStack(InitItems.itemCrystalShard, 1, 0)); + OredictHelper.RegisterNuggetItem("Palis", new ItemStack(InitItems.itemCrystalShard, 1, 1)); + OredictHelper.RegisterNuggetItem("Diamantine", new ItemStack(InitItems.itemCrystalShard, 1, 2)); + OredictHelper.RegisterNuggetItem("Void", new ItemStack(InitItems.itemCrystalShard, 1, 3)); + OredictHelper.RegisterNuggetItem("Emeradic", new ItemStack(InitItems.itemCrystalShard, 1, 4)); + OredictHelper.RegisterNuggetItem("Enori", new ItemStack(InitItems.itemCrystalShard, 1, 5)); + + OredictHelper.RegisterBlock("Redstonia", new ItemStack(InitBlocks.blockCrystal, 1, 0)); + OredictHelper.RegisterBlock("Palis", new ItemStack(InitBlocks.blockCrystal, 1, 1)); + OredictHelper.RegisterBlock("Diamantine", new ItemStack(InitBlocks.blockCrystal, 1, 2)); + OredictHelper.RegisterBlock("Void", new ItemStack(InitBlocks.blockCrystal, 1, 3)); + OredictHelper.RegisterBlock("Emeradic", new ItemStack(InitBlocks.blockCrystal, 1, 4)); + OredictHelper.RegisterBlock("Enori", new ItemStack(InitBlocks.blockCrystal, 1, 5)); + Resources.blackquartz.builder.setRepresentativeItem("gemQuartzBlack"); + Resources.blackquartz.builder.addItem("gemQuartzBlack", Material.VALUE_Ingot); + Resources.enori.builder.setRepresentativeItem("gemEnori"); + Resources.enori.builder.addItem("gemEnori", Material.VALUE_Ingot); + Resources.void_crystal.builder.setRepresentativeItem("gemVoid"); + Resources.void_crystal.builder.addItem("gemVoid", Material.VALUE_Ingot); + Resources.emeradic.builder.setRepresentativeItem("gemEmeradic"); + Resources.emeradic.builder.addItem("gemEmeradic", Material.VALUE_Ingot); + Resources.redstonia.builder.setRepresentativeItem("gemRedstonia"); + Resources.redstonia.builder.addItem("gemRedstonia", Material.VALUE_Ingot); + Resources.diamantine.builder.setRepresentativeItem("gemDiamantine"); + Resources.diamantine.builder.addItem("gemDiamantine", Material.VALUE_Ingot); + Resources.palis.builder.setRepresentativeItem("gemPalis"); + Resources.palis.builder.addItem("gemPalis", Material.VALUE_Ingot); + + registerGems("QuartzBlack", "blackquartz", true); + registerGems("Enori", "enori", false); + registerGems("Void", "void", false); + registerGems("Emeradic", "emeradic", false); + registerGems("Palis", "palis", false); + } + @Override + public void postInit(FMLPostInitializationEvent e) { + + } + private void registerGems(String ore, String fluid, boolean small) { + SmelteryUtils.registerCasting("nugget"+ore, castNugget, FluidRegistry.getFluid(fluid), Material.VALUE_Nugget); + SmelteryUtils.registerCasting("gem"+ore, castIngot, FluidRegistry.getFluid(fluid), Material.VALUE_Ingot); + SmelteryUtils.registerMelting("gem"+ore, FluidRegistry.getFluid(fluid), Material.VALUE_Ingot); + SmelteryUtils.registerMelting("block"+ore, FluidRegistry.getFluid(fluid), Material.VALUE_Block); + if(small) { + SmelteryUtils.registerSmallBlockCasting(ore, FluidRegistry.getFluid(fluid)); + } + else { + SmelteryUtils.registerBlockCasting(ore, FluidRegistry.getFluid(fluid)); + } + } +} \ No newline at end of file diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAe.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAe.java new file mode 100644 index 00000000..6342cdfb --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAe.java @@ -0,0 +1,64 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleAe implements ModuleBase { + + public ModuleAe() { + Resources.certus_quartz.builder.setTrait(TinkerTraits.jagged, MaterialTypes.HEAD); + Resources.certus_quartz.builder.setTrait(TinkerTraits.fractured); + Resources.certus_quartz.builder.setHeadStats(230, 4.2f, 3f, HarvestLevels.IRON); + Resources.certus_quartz.builder.setHandleStats(0.8f, 90); + Resources.certus_quartz.builder.setExtraStats(70); + + Resources.fluix_crystal.builder.setTrait(Traits.flux, MaterialTypes.HEAD); + Resources.fluix_crystal.builder.setTrait(Traits.signal); + Resources.fluix_crystal.builder.setHeadStats(230, 4.2f, 3f, HarvestLevels.IRON); + Resources.fluix_crystal.builder.setHandleStats(0.8f, 90); + Resources.fluix_crystal.builder.setExtraStats(70); + } + @Override + public void preInit(FMLPreInitializationEvent e) { + + if(ConfigMaterials.certus_quartz) { + Resources.certus_quartz.builder.preInit("crystalCertusQuartz"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.certus_quartz.builder, 0); + } + Resources.materials.add(Resources.certus_quartz); + } + if(ConfigMaterials.fluix_crystal) { + Resources.fluix_crystal.builder.preInit("crystalFluix"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.fluix_crystal.builder, 0); + } + Resources.materials.add(Resources.fluix_crystal); + } + + } + @Override + public void init(FMLInitializationEvent e) { + Resources.certus_quartz.builder.addItem("crystalPureCertusQuartz", Material.VALUE_Ingot); + Resources.fluix_crystal.builder.addItem("crystalFluix", Material.VALUE_Ingot); + Resources.fluix_crystal.builder.addItem("crystalPureFluix", Material.VALUE_Ingot); + Resources.certus_quartz.builder.setRepresentativeItem("crystalCertusQuartz"); + Resources.fluix_crystal.builder.setRepresentativeItem("crystalFluix"); + } + @Override + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAstralSorcery.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAstralSorcery.java new file mode 100644 index 00000000..cdf0b82c --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAstralSorcery.java @@ -0,0 +1,50 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleAstralSorcery implements ModuleBase { + + + public ModuleAstralSorcery() { + Resources.starmetal.builder.setCraftable(false).setCastable(true); + Resources.starmetal.builder.setTrait(Traits.astral, MaterialTypes.HEAD); + Resources.starmetal.builder.setTrait(TinkerTraits.alien); + Resources.starmetal.builder.setHeadStats(200, 5.2f, 3.2f, HarvestLevels.IRON); + Resources.starmetal.builder.setHandleStats(0.9f, 70); + Resources.starmetal.builder.setExtraStats(50); + Resources.starmetal.builder.setBowStats(3.0f, 3f, 3f); + } + @Override + public void preInit(FMLPreInitializationEvent e) { + Resources.starmetal.registerFluid(); + if(ConfigMaterials.starmetal) + { + Resources.starmetal.builder.addCommonItems("AstralStarmetal"); + Resources.starmetal.builder.addIngot("dustAstralStarmetal"); + Resources.starmetal.builder.preInit("AstralStarmetal", FluidRegistry.getFluid("starmetal")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.starmetal.builder, 1f); + } + Resources.materials.add(Resources.starmetal); + } + } + @Override + public void init(FMLInitializationEvent e) { + + } + @Override + public void postInit(FMLPostInitializationEvent e) { } +} \ No newline at end of file diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAtum.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAtum.java new file mode 100644 index 00000000..caa7d266 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleAtum.java @@ -0,0 +1,63 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.common.OredictHelper; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import com.teammetallurgy.atum.init.AtumBlocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleAtum implements ModuleBase { + + public ModuleAtum() { + Resources.limestone.builder.setTrait(TinkerTraits.cheapskate, MaterialTypes.HEAD); + Resources.limestone.builder.setTrait(TinkerTraits.cheap); + Resources.limestone.builder.setHeadStats(180, 3.1f, 2.2f, HarvestLevels.STONE); + Resources.limestone.builder.setHandleStats(0.9f, 50); + Resources.limestone.builder.setExtraStats(30); + + Resources.khnumite.builder.setTrait(TinkerTraits.jagged, MaterialTypes.HEAD); + Resources.khnumite.builder.setTrait(TinkerTraits.poisonous); + Resources.khnumite.builder.setHeadStats(200, 3.4f, 3.1f, HarvestLevels.IRON); + Resources.khnumite.builder.setHandleStats(0.9f, 70); + Resources.khnumite.builder.setExtraStats(50); + } + public void preInit(FMLPreInitializationEvent e) { + if(ConfigMaterials.limestone) { + Resources.limestone.builder.addIngot("stoneLimestone"); + Resources.limestone.builder.preInit("stoneLimestone"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.limestone.builder, 0); + } + Resources.materials.add(Resources.limestone); + } + if (ConfigMaterials.khnumite) { + Resources.khnumite.builder.addIngot("ingotKhnumite"); + Resources.khnumite.builder.preInit("Khnumite"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.khnumite.builder, 0); + } + Resources.materials.add(Resources.khnumite); + } + } + public void init(FMLInitializationEvent e) { + if(ConfigMaterials.khnumite) { + Resources.khnumite.builder.setRepresentativeItem("ingotKhnumite"); + } + } + + public void postInit(FMLPostInitializationEvent e) { + // compat to make limestone work + OredictHelper.removeOredict(new ItemStack(AtumBlocks.LIMESTONE), "stone"); + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBlueSkies.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBlueSkies.java new file mode 100644 index 00000000..530c1473 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBlueSkies.java @@ -0,0 +1,119 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.common.SmelteryUtils; +import mrthomas20121.biolib.common.OredictHelper; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import com.legacy.blue_skies.items.ItemsSkies; +import com.legacy.blue_skies.blocks.BlocksSkies; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleBlueSkies implements ModuleBase { + + public ModuleBlueSkies() { + Resources.ventium.builder.setTrait(TinkerTraits.cheap); + Resources.ventium.builder.setHeadStats(150, 3, 3.2f, HarvestLevels.IRON); + Resources.ventium.builder.setHandleStats(1f, 30); + Resources.ventium.builder.setExtraStats(-1); + Resources.ventium.builder.setBowStats(0.5f, 7, 10); + + Resources.horizonite.builder.setTrait(TinkerTraits.autosmelt, MaterialTypes.HEAD); + Resources.horizonite.builder.setTrait(Traits.pyromancy); + Resources.horizonite.builder.setHeadStats(200, 6.3f, 4f, HarvestLevels.DIAMOND); + Resources.horizonite.builder.setHandleStats(0.9f, 90); + Resources.horizonite.builder.setExtraStats(70); + Resources.horizonite.builder.setBowStats(2, 1.5f, 7); + + Resources.pyrope.builder.setCraftable(false).setCastable(true); + Resources.pyrope.builder.setTrait(TinkerTraits.lightweight); + Resources.pyrope.builder.setHeadStats(100, 8, 7, HarvestLevels.DIAMOND); + Resources.pyrope.builder.setHandleStats(1, 5); + Resources.pyrope.builder.setExtraStats(-5); + + Resources.turquoise.builder.setCraftable(false).setCastable(true); + Resources.turquoise.builder.setTrait(TinkerTraits.magnetic2); + Resources.turquoise.builder.setHeadStats(200, 6.3f, 4f, HarvestLevels.DIAMOND); + Resources.turquoise.builder.setHandleStats(0.9f, 90); + Resources.turquoise.builder.setExtraStats(70); + Resources.turquoise.builder.setBowStats(1.0f, 1.5f, 3); + } + + public void preInit(FMLPreInitializationEvent e) { + Resources.pyrope.registerFluid(); + Resources.ventium.registerFluid(); + Resources.horizonite.registerFluid(); + + if(ConfigMaterials.ventium) { + Resources.ventium.builder.addCommonItems("Ventium"); + Resources.ventium.builder.preInit("Ventium", FluidUtils.getFluid("ventium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.ventium.builder, 0); + } + Resources.materials.add(Resources.ventium); + } + if(ConfigMaterials.horizonite) { + Resources.horizonite.builder.addCommonItems("Horizonite"); + Resources.horizonite.builder.preInit("Horizonite", FluidUtils.getFluid("horizonite")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.horizonite.builder, 0); + } + Resources.materials.add(Resources.horizonite); + } + if(ConfigMaterials.pyrope) { + Resources.pyrope.builder.addCommonItems("Pyrope"); + Resources.pyrope.builder.addGem("Pyrope"); + Resources.pyrope.builder.preInit("Pyrope", FluidUtils.getFluid("pyrope")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.pyrope.builder, 0); + } + Resources.materials.add(Resources.pyrope); + } + } + public void init(FMLInitializationEvent e) { + OredictHelper.RegisterIngotItem("Ventium", ItemsSkies.ventium_ingot); + OredictHelper.RegisterBucketItem("Ventium", ItemsSkies.ventium_bucket); + OredictHelper.RegisterOreBlock("Ventium", BlocksSkies.ventium_ore); + OredictHelper.RegisterIngotItem("Horizonite", ItemsSkies.horizonite_ingot); + OredictHelper.RegisterOreBlock("Horizonite", BlocksSkies.horizonite_ore); + OredictHelper.RegisterBlock("Horizonnite", BlocksSkies.horizonite_block); + OredictHelper.RegisterIngotItem("Falsite", ItemsSkies.falsite_ingot); + OredictHelper.RegisterOreBlock("Falsite", BlocksSkies.falsite_ore); + OredictHelper.RegisterGemItem("Pyrope", ItemsSkies.pyrope_gem); + OredictHelper.RegisterOreBlock("Pyrope", BlocksSkies.everbright_pyrope_ore); + OredictHelper.RegisterOreBlock("Pyrope", BlocksSkies.everdawn_pyrope_ore); + OredictHelper.RegisterBlock("Pyrope", BlocksSkies.pyrope_block); + OredictHelper.RegisterGemItem("Turquoise", ItemsSkies.turquoise_gem); + OredictHelper.RegisterOreBlock("Turquoise", BlocksSkies.everbright_turquoise_ore); + OredictHelper.RegisterOreBlock("Turquoise", BlocksSkies.everdawn_turquoise_ore); + OredictHelper.RegisterBlock("Turquoise", BlocksSkies.turquoise_block); + OredictHelper.RegisterGemItem("Chartoite", ItemsSkies.charoite); + OredictHelper.RegisterOreBlock("Chartoite", BlocksSkies.everbright_charoite_ore); + OredictHelper.RegisterOreBlock("Chartoite", BlocksSkies.everdawn_charoite_ore); + OredictHelper.RegisterGemItem("Diopside", ItemsSkies.diopside_gem); + OredictHelper.RegisterOreBlock("Diopside", BlocksSkies.everbright_diopside_ore); + OredictHelper.RegisterOreBlock("Diopside", BlocksSkies.everdawn_diopside_ore); + + if(ConfigMaterials.pyrope) { + Resources.pyrope.builder.setRepresentativeItem("gemPyrope"); + SmelteryUtils.registerGemCasting("Pyrope", FluidRegistry.getFluid("pyrope")); + } + } + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBotania.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBotania.java new file mode 100644 index 00000000..4de17e40 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleBotania.java @@ -0,0 +1,101 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.config.ConfigReforged; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.oredict.OreDictionary; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.tools.IToolPart; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerMaterials; +import slimeknights.tconstruct.tools.TinkerTraits; +import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.api.recipe.RecipeManaInfusion; +import vazkii.botania.common.block.ModBlocks; + +public class ModuleBotania implements ModuleBase { + + public ModuleBotania() + { + Resources.manasteel.builder.setCastable(false); + Resources.manasteel.builder.setTrait(Traits.traitManaInfusion, MaterialTypes.HEAD); + Resources.manasteel.builder.setTrait(Traits.traitManaBoost); + Resources.manasteel.builder.setHeadStats(204, 6f, 4f, HarvestLevels.DIAMOND); + Resources.manasteel.builder.setHandleStats(1.20f, 0); + Resources.manasteel.builder.setExtraStats(50); + + Resources.livingwood.builder.setCraftable(false); + Resources.livingwood.builder.setTrait(Traits.traitLiving, MaterialTypes.HEAD); + Resources.livingwood.builder.setTrait(TinkerTraits.ecological); + Resources.livingwood.builder.setHeadStats(200, 4f, 3f, HarvestLevels.STONE); + Resources.livingwood.builder.setHandleStats(1f, 0); + Resources.livingwood.builder.setExtraStats(50); + + Resources.livingrock.builder.setCraftable(false); + Resources.livingrock.builder.setTrait(Traits.traitLiving, MaterialTypes.HEAD); + Resources.livingrock.builder.setTrait(TinkerTraits.cheap); + Resources.livingrock.builder.setHeadStats(199, 5f, 3f, HarvestLevels.IRON); + Resources.livingrock.builder.setHandleStats(1.4f, 0); + Resources.livingrock.builder.setExtraStats(0); + } + + @Override + public void preInit(FMLPreInitializationEvent event) { + if(ConfigMaterials.manasteel) + { + Resources.manasteel.builder.setRepresentativeItem("ingotManaSteel"); + Resources.manasteel.builder.addCommonItems("Manasteel"); + Resources.manasteel.builder.addBlock("Manasteel"); + Resources.manasteel.builder.preInit("Manasteel"); + } + if(ConfigMaterials.livingwood) + { + Resources.livingwood.builder.addItem("livingwood", 1); + Resources.livingwood.builder.setRepresentativeItem("livingwood"); + Resources.livingwood.builder.preInit("livingwood"); + } + if(ConfigMaterials.livingrock) + { + Resources.livingrock.builder.addItem("livingrock", 1); + Resources.livingrock.builder.setRepresentativeItem("livingrock"); + Resources.livingrock.builder.preInit("livingrock"); + } + } + + @Override + public void init(FMLInitializationEvent event) { + + OreDictionary.registerOre("blockManasteel", new ItemStack(ModBlocks.storage, 1, 0)); + OreDictionary.registerOre("blockTerrasteel", new ItemStack(ModBlocks.storage, 1, 1)); + OreDictionary.registerOre("blockElementium", new ItemStack(ModBlocks.storage, 1, 2)); + + for(IToolPart part : TinkerRegistry.getToolParts()) + { + if(part.canUseMaterial(Resources.manasteel.builder.getMat()) && ConfigMaterials.manasteel) + { + BotaniaAPI.manaInfusionRecipes.add(new RecipeManaInfusion(part.getItemstackWithMaterial(Resources.manasteel.builder.getMat()), part.getItemstackWithMaterial(TinkerMaterials.iron), ConfigReforged.mana)); + } + if(part.canUseMaterial(Resources.livingrock.builder.getMat()) && ConfigMaterials.livingrock) + { + BotaniaAPI.manaInfusionRecipes.add(new RecipeManaInfusion(part.getItemstackWithMaterial(Resources.livingrock.builder.getMat()), part.getItemstackWithMaterial(TinkerMaterials.stone), ConfigReforged.mana)); + } + if(part.canUseMaterial(Resources.livingwood.builder.getMat()) && ConfigMaterials.livingwood) + { + BotaniaAPI.manaInfusionRecipes.add(new RecipeManaInfusion(part.getItemstackWithMaterial(Resources.livingwood.builder.getMat()), part.getItemstackWithMaterial(TinkerMaterials.wood), ConfigReforged.mana)); + } + } + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCavern.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCavern.java new file mode 100644 index 00000000..3a4a92ab --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCavern.java @@ -0,0 +1,68 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.MaterialBuilder; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.tools.TinkerTraits; +import slimeknights.tconstruct.library.utils.HarvestLevels; + +public class ModuleCavern implements ModuleBase +{ + + public ModuleCavern() + { + Resources.aquamarine.builder.setTrait(TinkerTraits.aquadynamic); + Resources.aquamarine.builder.setHeadStats(204, 6f, 4f, HarvestLevels.IRON); + Resources.aquamarine.builder.setHandleStats(1.20f, 0); + Resources.aquamarine.builder.setExtraStats(50); + + Resources.magnite.builder.setTrait(TinkerTraits.aridiculous); + Resources.magnite.builder.setHeadStats(150, 5f, 5f, HarvestLevels.DIAMOND); + Resources.magnite.builder.setHandleStats(1.4f, 0); + Resources.magnite.builder.setExtraStats(50); + + Resources.hexcite.builder.setTrait(Traits.refined); + Resources.hexcite.builder.setHeadStats(150, 5f, 5f, HarvestLevels.DIAMOND); + Resources.hexcite.builder.setHandleStats(1.4f, 0); + Resources.hexcite.builder.setExtraStats(50); + } + + @Override + public void preInit(FMLPreInitializationEvent e) + { + Resources.aquamarine.registerFluid(); + Resources.magnite.registerFluid(); + Resources.hexcite.registerFluid(); + + if(ConfigMaterials.aquamarine) + { + Resources.aquamarine.builder.addCommonItems("Aquamarine"); + Resources.aquamarine.builder.addGem("Aquamarine"); + Resources.aquamarine.builder.preInit("Aquamarine", FluidUtils.getFluid("aquamarine")); + } + if(ConfigMaterials.magnite) + { + Resources.magnite.builder.addCommonItems("Magnite"); + Resources.magnite.builder.preInit("Magnite", FluidUtils.getFluid("magnite")); + } + if(ConfigMaterials.hexcite) + { + Resources.hexcite.builder.addCommonItems("Hexcite"); + Resources.hexcite.builder.preInit("Hexcite", FluidUtils.getFluid("hexcite")); + } + } + + @Override + public void init(FMLInitializationEvent e) + { + } + + @Override + public void postInit(FMLPostInitializationEvent event) { } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCommonMaterials.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCommonMaterials.java new file mode 100644 index 00000000..087894b6 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleCommonMaterials.java @@ -0,0 +1,152 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleCommonMaterials implements ModuleBase { + + public ModuleCommonMaterials() { + + Resources.sapphire.builder.setTrait(Traits.carbon, MaterialTypes.HEAD); + Resources.sapphire.builder.setTrait(TinkerTraits.sharp); + Resources.sapphire.builder.setHeadStats(300, 5f, 5f, HarvestLevels.DIAMOND); + Resources.sapphire.builder.setHandleStats(1.2f, 5); + Resources.sapphire.builder.setExtraStats(30); + + Resources.ruby.builder.setTrait(TinkerTraits.jagged, MaterialTypes.HEAD); + Resources.ruby.builder.setTrait(TinkerTraits.sharp); + Resources.ruby.builder.setHeadStats(300, 5f, 5f, HarvestLevels.DIAMOND); + Resources.ruby.builder.setHandleStats(1.2f, 5); + Resources.ruby.builder.setExtraStats(30); + + Resources.amethyst.builder.setTrait(TinkerTraits.jagged, MaterialTypes.HEAD); + Resources.amethyst.builder.setTrait(TinkerTraits.sharp); + Resources.amethyst.builder.setHeadStats(300, 6f, 5f, HarvestLevels.DIAMOND); + Resources.amethyst.builder.setHandleStats(1, 200); + Resources.amethyst.builder.setExtraStats(30); + + Resources.platinum.builder.setTrait(TinkerTraits.dense); + Resources.platinum.builder.setHeadStats(500, 7.0f, 6.5f, HarvestLevels.OBSIDIAN); + Resources.platinum.builder.setHandleStats(0.9f, 90); + Resources.platinum.builder.setExtraStats(10); + Resources.platinum.builder.setBowStats(2, 1.5f, 7); + + Resources.iridium.builder.setHeadStats(500, 7.1f, 6.4f, HarvestLevels.OBSIDIAN); + Resources.iridium.builder.setHandleStats(1f, 90); + Resources.iridium.builder.setExtraStats(15); + Resources.iridium.builder.setTrait(TinkerTraits.dense); + Resources.iridium.builder.setBowStats(2, 1.5f, 7); + + Resources.invar.builder.setHeadStats(500, 5.7f, 6.3f, HarvestLevels.OBSIDIAN); + Resources.invar.builder.setHandleStats(1f, 90); + Resources.invar.builder.setExtraStats(15); + Resources.invar.builder.setTrait(TinkerTraits.hellish); + Resources.invar.builder.setBowStats(2, 1.5f, 7); + + Resources.aluminium.builder.setHeadStats(450, 6.1f, 6f, HarvestLevels.OBSIDIAN); + Resources.aluminium.builder.setHandleStats(1f, 70); + Resources.aluminium.builder.setExtraStats(30); + Resources.aluminium.builder.setTrait(TinkerTraits.dense); + Resources.aluminium.builder.setBowStats(2, 1.5f, 7); + + Resources.titanium.builder.setHeadStats(480, 6.1f, 6f, HarvestLevels.OBSIDIAN); + Resources.titanium.builder.setHandleStats(1.2f, 0); + Resources.titanium.builder.setExtraStats(5); + Resources.titanium.builder.setTrait(TinkerTraits.lightweight); + Resources.titanium.builder.setBowStats(2, 1.5f, 7); + } + + @Override + public void preInit(FMLPreInitializationEvent e) { + + Resources.ruby.registerFluid(); + Resources.platinum.registerFluid(); + Resources.iridium.registerFluid(); + Resources.aluminium.registerFluid(); + Resources.invar.registerFluid(); + Resources.amethyst.registerFluid(); + Resources.sapphire.registerFluid(); + Resources.titanium.registerFluid(); + + if(ConfigMaterials.platinum) + { + Resources.platinum.builder.addCommonItems("Platinum"); + Resources.platinum.builder.preInit("Platinum", FluidUtils.getFluid("platinum")); + Resources.materials.add(Resources.platinum); + } + if(ConfigMaterials.iridium) + { + Resources.iridium.builder.addCommonItems("Iridium"); + Resources.iridium.builder.preInit("iridium", FluidUtils.getFluid("iridium")); + Resources.materials.add(Resources.iridium); + } + if(ConfigMaterials.invar) + { + Resources.invar.builder.addCommonItems("Invar"); + Resources.invar.builder.preInit("Invar", FluidUtils.getFluid("invar")); + Resources.materials.add(Resources.invar); + } + if(ConfigMaterials.aluminium) + { + Resources.aluminium.builder.addCommonItems("Aluminium"); + Resources.aluminium.builder.preInit("Aluminium", FluidUtils.getFluid("aluminium")); + Resources.materials.add(Resources.aluminium); + } + if(ConfigMaterials.titanium) + { + Resources.titanium.builder.addCommonItems("Titanium"); + Resources.titanium.builder.preInit("Titanium", FluidUtils.getFluid("titanium")); + Resources.materials.add(Resources.titanium); + } + if(ConfigMaterials.amethyst) + { + Resources.amethyst.builder.addItem("Amethyst", Material.VALUE_Ingot); + Resources.amethyst.builder.setRepresentativeItem("gemAmethyst"); + Resources.amethyst.builder.preInit("Amethyst", FluidUtils.getFluid("amethyst")); + Resources.materials.add(Resources.amethyst); + } + if(ConfigMaterials.sapphire) + { + Resources.sapphire.builder.addItem("Sapphire", Material.VALUE_Ingot); + Resources.sapphire.builder.setRepresentativeItem("gemSapphire"); + Resources.sapphire.builder.preInit("Sapphire",FluidUtils.getFluid("sapphire")); + Resources.materials.add(Resources.sapphire); + } + if(ConfigMaterials.ruby) + { + Resources.ruby.builder.addItem("Ruby", Material.VALUE_Ingot); + Resources.ruby.builder.addCommonItems("Ruby"); + Resources.ruby.builder.setRepresentativeItem("gemRuby"); + Resources.ruby.builder.preInit("Ruby", FluidUtils.getFluid("ruby")); + Resources.materials.add(Resources.ruby); + } + + if(Loader.isModLoaded("conarm")) + { + if(ConfigMaterials.titanium) armorUtils.setArmorStats(Resources.titanium.builder, 1); + if(ConfigMaterials.invar) armorUtils.setArmorStats(Resources.invar.builder, 1); + if(ConfigMaterials.platinum) armorUtils.setArmorStats(Resources.platinum.builder, 1); + if(ConfigMaterials.iridium) armorUtils.setArmorStats(Resources.iridium.builder, 1); + if(ConfigMaterials.aluminium) armorUtils.setArmorStats(Resources.aluminium.builder, 1); + if(ConfigMaterials.amethyst) armorUtils.setArmorStats(Resources.amethyst.builder, 2); + if(ConfigMaterials.ruby) armorUtils.setArmorStats(Resources.ruby.builder, 0); + if(ConfigMaterials.sapphire) armorUtils.setArmorStats(Resources.sapphire.builder, 0); + } + } + + @Override + public void init(FMLInitializationEvent e) {} + @Override + public void postInit(FMLPostInitializationEvent e) {} +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleExtremeReactor.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleExtremeReactor.java new file mode 100644 index 00000000..ec25964e --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleExtremeReactor.java @@ -0,0 +1,108 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.biolib.common.MaterialBuilder; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import net.minecraftforge.fluids.FluidRegistry; + +public class ModuleExtremeReactor implements ModuleBase { + + public ModuleExtremeReactor() { + + Resources.yellorium.builder.setHeadStats(200, 5f, 5f, HarvestLevels.OBSIDIAN); + Resources.yellorium.builder.setHandleStats(1f, 100); + Resources.yellorium.builder.setExtraStats(20); + Resources.yellorium.builder.setTrait(Traits.radioactive); + + Resources.blutonium.builder.setHeadStats(200, 6f, 6f, HarvestLevels.OBSIDIAN); + Resources.blutonium.builder.setHandleStats(1f, 120); + Resources.blutonium.builder.setExtraStats(20); + Resources.blutonium.builder.setTrait(Traits.nuclearwaste); + + Resources.ludicrite.builder.setHeadStats(200, 7f, 7f, HarvestLevels.COBALT); + Resources.ludicrite.builder.setHandleStats(1f, 140); + Resources.ludicrite.builder.setExtraStats(20); + Resources.ludicrite.builder.setTrait(Traits.nuclearwaste); + Resources.ludicrite.builder.setTrait(Traits.radioactive, MaterialTypes.HEAD); + + Resources.cyanite.builder.setHeadStats(200, 5f, 5f, HarvestLevels.OBSIDIAN); + Resources.cyanite.builder.setHandleStats(1f, 100); + Resources.cyanite.builder.setExtraStats(20); + Resources.cyanite.builder.setTrait(Traits.nuclearwaste); + } + + @Override + public void preInit(FMLPreInitializationEvent e) { + //Resources.yellorium.registerFluid(); + Resources.blutonium.registerFluid(); + Resources.ludicrite.registerFluid(); + + if(ConfigMaterials.yellorium) + { + Resources.yellorium.builder.addCommonItems("Yellorium"); + Resources.yellorium.builder.setFluid(FluidRegistry.getFluid("yellorium")); + Resources.yellorium.builder.preInit("Yellorium", FluidRegistry.getFluid("yellorium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.yellorium.builder, 1f); + } + Resources.materials.add(Resources.yellorium); + } + + if(ConfigMaterials.blutonium) + { + Resources.blutonium.builder.addCommonItems("Blutonium"); + Resources.blutonium.builder.setFluid(FluidRegistry.getFluid("blutonium")); + Resources.blutonium.builder.preInit("Blutonium", FluidRegistry.getFluid("blutonium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.blutonium.builder, 1f); + } + Resources.materials.add(Resources.blutonium); + } + + if(ConfigMaterials.ludicrite) + { + Resources.ludicrite.builder.addCommonItems("Ludicrite"); + Resources.ludicrite.builder.setFluid(FluidRegistry.getFluid("ludicrite")); + Resources.ludicrite.builder.preInit("Ludicrite", FluidRegistry.getFluid("ludicrite")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.ludicrite.builder, 1.5f); + } + Resources.materials.add(Resources.ludicrite); + } + + //Resources.cyanite.registerFluid(); + if(ConfigMaterials.cyanite) + { + Resources.cyanite.builder.addCommonItems("Cyanite"); + Resources.cyanite.builder.setFluid(FluidRegistry.getFluid("cyanite")); + Resources.cyanite.builder.preInit("Cyanite", FluidRegistry.getFluid("cyanite")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.cyanite.builder, 0); + } + Resources.materials.add(Resources.cyanite); + } + } + @Override + public void init(FMLInitializationEvent e) { + if(ConfigMaterials.yellorium) Resources.yellorium.builder.registerInitFluid(FluidRegistry.getFluid("yellorium"), "Yellorium"); + if(ConfigMaterials.cyanite) Resources.cyanite.builder.registerInitFluid(FluidRegistry.getFluid("cyanite"), "Cyanite"); + } + @Override + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleFluids.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleFluids.java new file mode 100644 index 00000000..027d79af --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleFluids.java @@ -0,0 +1,44 @@ +package mrthomas20121.tinkers_reforged.modules; + +import java.util.ArrayList; + +import mrthomas20121.biolib.block.BlockFluid; +import mrthomas20121.tinkers_reforged.TinkersReforged; +import mrthomas20121.tinkers_reforged.resources.Resource; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.registries.IForgeRegistry; + +@Mod.EventBusSubscriber(modid = TinkersReforged.MODID) +public class ModuleFluids { + public static ArrayList blockFluids = new ArrayList<>(); + + @SubscribeEvent + public static void registerBlocks(RegistryEvent.Register event) { + IForgeRegistry r = event.getRegistry(); + + for(Resource resource: Resources.materials) + { + if(FluidRegistry.isFluidRegistered(resource.getFluid())) + { + registerFluidBlock(r, resource.getFluid()); + } + } + } + + public static void registerFluidBlock(IForgeRegistry r, Fluid f) { + BlockFluid fluidBlock = new BlockFluid(f); + fluidBlock.setRegistryName(TinkersReforged.MODID, "molten_"+f.getName()); + f.setUnlocalizedName(f.getName()); + ItemBlock itemBlock = new ItemBlock(fluidBlock); + itemBlock.setRegistryName(fluidBlock.getRegistryName()); + blockFluids.add(itemBlock); + r.register(fluidBlock); + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleItems.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleItems.java new file mode 100644 index 00000000..84eb87be --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleItems.java @@ -0,0 +1,198 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.block.BlockGlassCustom; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.common.SmelteryUtils; +import mrthomas20121.biolib.item.ItemBase; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.TinkersReforged; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.biolib.common.OredictHelper; +import mrthomas20121.tinkers_reforged.config.ConfigReforged; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.block.Block; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.registries.IForgeRegistry; +import slimeknights.mantle.client.CreativeTab; +import slimeknights.mantle.util.RecipeMatch; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.smeltery.CastingRecipe; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +import java.util.ArrayList; + +@Mod.EventBusSubscriber(modid = TinkersReforged.MODID) +public class ModuleItems implements ModuleBase { + public static ItemBase laviumNugget = new ItemBase(TinkersReforged.MODID, "lavium_nugget"); + public static ItemBase laviumIngot = new ItemBase(TinkersReforged.MODID, "lavium_ingot"); + public static ItemBase laviumDust = new ItemBase(TinkersReforged.MODID, "lavium_dust"); + public static ItemBase laviumPlate = new ItemBase(TinkersReforged.MODID, "lavium_plate"); + public static ItemBase laviumGear = new ItemBase(TinkersReforged.MODID, "lavium_gear"); + + public static ItemBase qiviumNugget = new ItemBase(TinkersReforged.MODID, "qivium_nugget"); + public static ItemBase qiviumIngot = new ItemBase(TinkersReforged.MODID, "qivium_ingot"); + public static ItemBase qiviumDust = new ItemBase(TinkersReforged.MODID, "qivium_dust"); + public static ItemBase qiviumPlate = new ItemBase(TinkersReforged.MODID, "qivium_plate"); + public static ItemBase qiviumGear = new ItemBase(TinkersReforged.MODID, "qivium_gear"); + + public static ItemBase KovarNugget = new ItemBase(TinkersReforged.MODID, "kovar_nugget"); + public static ItemBase KovarIngot = new ItemBase(TinkersReforged.MODID, "kovar_ingot"); + public static ItemBase KovarDust = new ItemBase(TinkersReforged.MODID, "kovar_dust"); + public static ItemBase KovarPlate = new ItemBase(TinkersReforged.MODID, "kovar_plate"); + public static ItemBase KovarGear = new ItemBase(TinkersReforged.MODID, "kovar_gear"); + + public static BlockGlassCustom kovar_glass = new BlockGlassCustom(TinkersReforged.MODID, "kovar"); + public static final CreativeTabs creativetab = new CreativeTab("tinkers_reforged",new ItemStack(laviumIngot, 1)); + + private static int level = HarvestLevels.COBALT; + + public ModuleItems() { + Resources.lavium.builder.setTrait(TinkerTraits.momentum); + Resources.lavium.builder.setTrait(Traits.life_steal, MaterialTypes.HEAD); + Resources.lavium.builder.setHeadStats(1000, 14, 5.1f, level); + Resources.lavium.builder.setHandleStats(0.9f, 120); + Resources.lavium.builder.setExtraStats(400); + + Resources.qivium.builder.setTrait(TinkerTraits.momentum); + Resources.qivium.builder.setTrait(Traits.pyromancy, MaterialTypes.HEAD); + Resources.qivium.builder.setHeadStats(1000, 11, 7f, level); + Resources.qivium.builder.setHandleStats(0.9f, 120); + Resources.qivium.builder.setExtraStats(350); + } + + public void preInit(FMLPreInitializationEvent e) { + + Resources.kovar.registerFluid(); + Resources.materials.add(Resources.kovar); + + Resources.qivium.registerFluid(); + Resources.qivium.builder.addCommonItems("Qivium"); + Resources.qivium.builder.setRepresentativeItem("ingotQivium"); + Resources.qivium.builder.preInit("Qivium", FluidUtils.getFluid("qivium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.qivium.builder, 0); + } + Resources.materials.add(Resources.qivium); + + Resources.lavium.registerFluid(); + Resources.lavium.builder.addCommonItems("Lavium"); + Resources.lavium.builder.setRepresentativeItem("ingotLavium"); + Resources.lavium.builder.preInit("Lavium", FluidUtils.getFluid("lavium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.lavium.builder, 0); + } + Resources.materials.add(Resources.lavium); + } + public void init(FMLInitializationEvent e) { + if(ConfigReforged.alloyrecipes) + { + FluidStack ardite = new FluidStack(FluidRegistry.getFluid("ardite"), 288); + FluidStack purpleslime = new FluidStack(FluidRegistry.getFluid("purpleslime"), 144); + FluidStack laviumStack = new FluidStack(FluidRegistry.getFluid("lavium"), 144); + FluidStack glass = new FluidStack(FluidRegistry.getFluid("glass"), 1000); + FluidStack qiviumStack = new FluidStack(FluidRegistry.getFluid("qivium"), 144); + FluidStack kovarStack = new FluidStack(FluidRegistry.getFluid("kovar"), 144); + SmelteryUtils.registerAlloy(laviumStack, glass, new FluidStack(FluidRegistry.getFluid("cobalt"), 288), purpleslime); + SmelteryUtils.registerAlloy(qiviumStack, glass, ardite, purpleslime); + SmelteryUtils.registerAlloy(kovarStack, laviumStack, qiviumStack); + } + SmelteryUtils.registerDefaultMelting("Kovar", FluidRegistry.getFluid("kovar"), true); + } + public void postInit(FMLPostInitializationEvent e) { + ItemStack glass_kovar = new ItemStack(kovar_glass); + TinkerRegistry.registerBasinCasting(new CastingRecipe(glass_kovar, + RecipeMatch.of(Blocks.GLASS), + new FluidStack(FluidUtils.getFluid("kovar"), Material.VALUE_Block), + true, true)); + + for(String fuel : ConfigReforged.fuels) + { + String[] entries = fuel.split(":"); + if(Loader.isModLoaded(entries[0])) + { + if(FluidRegistry.isFluidRegistered(entries[1])) + { + TinkerRegistry.registerSmelteryFuel(new FluidStack(FluidUtils.getFluid(entries[1]).setTemperature(Integer.getInteger(entries[2])), Integer.getInteger(entries[3])), Integer.getInteger(entries[4])); + } + } + } + } + @SubscribeEvent + public static void registerItems(RegistryEvent.Register event) { + RegisterCreativeTab(genArrayList()); + IForgeRegistry r = event.getRegistry(); + r.registerAll(laviumNugget, laviumIngot, laviumDust, laviumPlate, laviumGear); + r.registerAll(qiviumNugget, qiviumIngot, qiviumDust, qiviumPlate, qiviumGear); + r.registerAll(KovarNugget, KovarIngot, KovarDust, KovarPlate, KovarGear); + + r.register(new ItemBlock(kovar_glass).setRegistryName(kovar_glass.getRegistryName())); + + oredictRegistry("Lavium", laviumIngot, laviumDust, laviumPlate, laviumGear, laviumNugget); + oredictRegistry("Qivium", qiviumIngot, qiviumDust, qiviumPlate, qiviumGear, qiviumNugget); + oredictRegistry("Kovar", KovarIngot, KovarDust, KovarPlate, KovarGear, KovarNugget); + } + @SubscribeEvent + public static void registerBlocks(RegistryEvent.Register event) { + IForgeRegistry r = event.getRegistry(); + r.register(kovar_glass); + } + + private static void oredictRegistry(String ore, Item... items) { + for(Item item : items) { + if(item.getRegistryName().toString().contains("gear")) OreDictionary.registerOre("gear"+ore, item); + else if(item.getRegistryName().toString().contains("ingot")) OredictHelper.RegisterIngotItem(ore, item); + else if(item.getRegistryName().toString().contains("dust")) OreDictionary.registerOre("dust"+ore, item); + else if(item.getRegistryName().toString().contains("plate")) OreDictionary.registerOre("plate"+ore, item); + else if(item.getRegistryName().toString().contains("nugget")) OreDictionary.registerOre("nugget"+ore, item); + } + } + + public static ArrayList genArrayList() { + ArrayList items = new ArrayList<>(); + items.add(laviumPlate); + items.add(laviumDust); + items.add(laviumGear); + items.add(laviumIngot); + items.add(laviumNugget); + items.add(qiviumPlate); + items.add(qiviumDust); + items.add(qiviumGear); + items.add(qiviumIngot); + items.add(qiviumNugget); + items.add(KovarNugget); + items.add(KovarIngot); + items.add(KovarDust); + items.add(KovarPlate); + items.add(KovarGear); + return items; + } + public static void InitModels() { + kovar_glass.initModels(); + } + + private static void RegisterCreativeTab(ArrayList items) { + for(Item item : items) { + item.setCreativeTab(creativetab); + } + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleMekanism.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleMekanism.java new file mode 100644 index 00000000..98a6a5de --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleMekanism.java @@ -0,0 +1,85 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.MaterialBuilder; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.Traits.Traits; + +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleMekanism implements ModuleBase { + + public ModuleMekanism() { + Resources.osmium.builder.setTrait(TinkerTraits.established, MaterialTypes.HEAD); + Resources.osmium.builder.setTrait(TinkerTraits.dense); + Resources.osmium.builder.setHeadStats(220, 5.5f, 5.5f, HarvestLevels.IRON); + Resources.osmium.builder.setHandleStats(0.9f, 90); + Resources.osmium.builder.setExtraStats(50); + Resources.osmium.builder.setBowStats(2.5f, 3, 2.5f); + + Resources.refined_obsidian.builder.setTrait(Traits.refined, MaterialTypes.HEAD); + Resources.refined_obsidian.builder.setTrait(TinkerTraits.duritos); + Resources.refined_obsidian.builder.setHeadStats(550, 6.5f, 6.5f, HarvestLevels.OBSIDIAN); + Resources.refined_obsidian.builder.setHandleStats(1, 100); + Resources.refined_obsidian.builder.setExtraStats(50); + Resources.refined_obsidian.builder.setBowStats(2, 1.9f, 2.7f); + + Resources.refined_glowstone.builder.setCraftable(false).setCastable(true); + Resources.refined_glowstone.builder.setTrait(Traits.refined, MaterialTypes.HEAD); + Resources.refined_glowstone.builder.setTrait(Traits.light); + Resources.refined_glowstone.builder.setHeadStats(540, 5f, 6.9f, HarvestLevels.OBSIDIAN); + Resources.refined_glowstone.builder.setHandleStats(1, 100); + Resources.refined_glowstone.builder.setExtraStats(50); + Resources.refined_glowstone.builder.setBowStats(2.7f, 5, 2.1f); + } + + public void preInit(FMLPreInitializationEvent e) { + + Resources.osmium.registerFluid(); + Resources.refined_glowstone.registerFluid(); + Resources.refined_obsidian.registerFluid(); + + if(ConfigMaterials.refined_obsidian) { + Resources.refined_obsidian.builder.addCommonItems("RefinedObsidian"); + Resources.refined_obsidian.builder.setFluid(FluidRegistry.getFluid("refined_obsidian")); + Resources.refined_obsidian.builder.preInit("RefinedObsidian", FluidRegistry.getFluid("refined_obsidian")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.refined_obsidian.builder, 1f); + } + Resources.materials.add(Resources.refined_obsidian); + } + if(ConfigMaterials.refined_glowstone) { + Resources.refined_glowstone.builder.addCommonItems("RefinedGlowstone"); + Resources.refined_glowstone.builder.setFluid(FluidRegistry.getFluid("refined_glowstone")); + Resources.refined_glowstone.builder.preInit("RefinedGlowstone", FluidRegistry.getFluid("refined_glowstone")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.refined_glowstone.builder, 0); + } + Resources.materials.add(Resources.refined_glowstone); + } + if(ConfigMaterials.osmium) { + Resources.osmium.builder.addCommonItems("Osmium"); + Resources.osmium.builder.preInit("Osmium", FluidRegistry.getFluid("osmium")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.osmium.builder, 0); + } + Resources.materials.add(Resources.osmium); + } + } + public void init(FMLInitializationEvent e) {} + public void postInit(FMLPostInitializationEvent e) { } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleNatureAura.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleNatureAura.java new file mode 100644 index 00000000..6de7d2f9 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleNatureAura.java @@ -0,0 +1,100 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.MaterialBuilder; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.Traits.Traits; + +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; +import de.ellpeck.naturesaura.items.ModItems; +import de.ellpeck.naturesaura.blocks.ModBlocks; +import net.minecraftforge.oredict.OreDictionary; + +public class ModuleNatureAura implements ModuleBase { + + + public ModuleNatureAura() { + Resources.ingot_of_the_sky.builder.setTrait(Traits.AURA_INFUSION, MaterialTypes.HEAD); + Resources.ingot_of_the_sky.builder.setTrait(TinkerTraits.alien); + Resources.ingot_of_the_sky.builder.setHeadStats(230, 6.3f, 4f, HarvestLevels.OBSIDIAN); + Resources.ingot_of_the_sky.builder.setHandleStats(1f, 90); + Resources.ingot_of_the_sky.builder.setExtraStats(75); + Resources.ingot_of_the_sky.builder.setBowStats(1.0f, 1.7f, 3.5f); + + Resources.infused_iron.builder.setTrait(Traits.AURA_INFUSION, MaterialTypes.HEAD); + Resources.infused_iron.builder.setTrait(TinkerTraits.magnetic2); + Resources.infused_iron.builder.setHeadStats(200, 6.3f, 4f, HarvestLevels.DIAMOND); + Resources.infused_iron.builder.setHandleStats(0.9f, 90); + Resources.infused_iron.builder.setExtraStats(70); + Resources.infused_iron.builder.setBowStats(2, 1.5f, 7); + + Resources.ancient_wood.builder.setTrait(TinkerTraits.ecological); + Resources.ancient_wood.builder.setHeadStats(100, 2.3f, 1.2f, HarvestLevels.STONE); + Resources.ancient_wood.builder.setHandleStats(1.9f, 10); + Resources.ancient_wood.builder.setExtraStats(-10); + Resources.ancient_wood.builder.setBowStats(0.9f, 1.0f, 1); + Resources.ancient_wood.builder.addFletchingStats(0.1f, 0.5f); + } + + @Override + public void preInit(FMLPreInitializationEvent e) { + + Resources.ingot_of_the_sky.registerFluid(); + Resources.infused_iron.registerFluid(); + + if(ConfigMaterials.material_of_the_sky) { + Resources.ingot_of_the_sky.builder.addIngot(ModItems.SKY_INGOT); + Resources.ingot_of_the_sky.builder.preInit("Sky", FluidRegistry.getFluid("molten_of_the_sky")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.ingot_of_the_sky.builder, 1f); + } + Resources.materials.add(Resources.ingot_of_the_sky); + } + if (ConfigMaterials.infused_iron) { + Resources.infused_iron.builder.addCommonItems("InfusedIron"); + Resources.infused_iron.builder.addIngot(ModItems.INFUSED_IRON); + Resources.infused_iron.builder.addBlock(ModBlocks.INFUSED_IRON); + Resources.infused_iron.builder.preInit("InfusedIron", FluidRegistry.getFluid("infused_iron")); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.infused_iron.builder, 0); + } + Resources.materials.add(Resources.infused_iron); + } + if (ConfigMaterials.ancient_wood) { + // ancient_wood.addCommonItems("plankAncient"); + Resources.ancient_wood.builder.addIngot(new ItemStack(ModBlocks.ANCIENT_PLANKS, 1)); + Resources.ancient_wood.builder.preInit("plankAncient"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.ancient_wood.builder, 0); + } + Resources.materials.add(Resources.ancient_wood); + } + } + @Override + public void init(FMLInitializationEvent e) { + OreDictionary.registerOre("ingotInfusedIron", ModItems.INFUSED_IRON); + OreDictionary.registerOre("blockInfusedIron", ModBlocks.INFUSED_IRON); + + OreDictionary.registerOre("plankAncient", ModBlocks.ANCIENT_PLANKS); + OreDictionary.registerOre("logAncient", ModBlocks.ANCIENT_LOG); + + OreDictionary.registerOre("ingotSky", ModItems.SKY_INGOT); + + } + @Override + public void postInit(FMLPostInitializationEvent e) { } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleRoots.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleRoots.java new file mode 100644 index 00000000..b02548e3 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleRoots.java @@ -0,0 +1,70 @@ +package mrthomas20121.tinkers_reforged.modules; + +import epicsquid.roots.recipe.FeyCraftingRecipe; +import mrthomas20121.biolib.common.MaterialBuilder; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.TinkersReforged; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.*; +import slimeknights.tconstruct.library.tinkering.MaterialItem; +import slimeknights.tconstruct.library.tools.IToolPart; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerMaterials; +import slimeknights.tconstruct.tools.TinkerTraits; +import epicsquid.roots.init.ModRecipes; + +public class ModuleRoots implements ModuleBase { + + public ModuleRoots() { + Resources.runestone.builder.setHeadStats(280, 5.5f, 3f, HarvestLevels.STONE); + Resources.runestone.builder.setHandleStats(1f, 100); + Resources.runestone.builder.setExtraStats(-10); + Resources.runestone.builder.setTrait(TinkerTraits.cheap, MaterialTypes.HEAD); + Resources.runestone.builder.setTrait(Traits.fey); + } + + public void preInit(FMLPreInitializationEvent e) { + if(ConfigMaterials.runestone) { + Resources.runestone.builder.preInit("runestone"); + if(Loader.isModLoaded("conarm")) + { + armorUtils.setArmorStats(Resources.runestone.builder, 0); + } + Resources.materials.add(Resources.runestone); + } + } + public void init(FMLInitializationEvent e) { + Resources.runestone.builder.setRepresentativeItem("runestone"); + + for (IToolPart part : TinkerRegistry.getToolParts()) { + if(part.canUseMaterial(Resources.runestone.builder.getMat())) + { + FeyCraftingRecipe recipe = new FeyCraftingRecipe(part.getItemstackWithMaterial(Resources.runestone.builder.getMat())); + recipe.addIngredients( + new ItemStack(Items.DYE, 1, 4), + part.getItemstackWithMaterial(TinkerMaterials.stone), + new ItemStack(Blocks.STONE, 1), + new ItemStack(Blocks.STONE, 1), + new ItemStack(Blocks.STONE, 1) + ); + ModRecipes.addFeyCraftingRecipe(new ResourceLocation(TinkersReforged.MODID, "runestone_toolpart_"+ ((MaterialItem) part).getRegistryName()), recipe); + } + } + } + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleThermal.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleThermal.java new file mode 100644 index 00000000..c368c2fa --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleThermal.java @@ -0,0 +1,83 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.biolib.util.FluidUtils; +import mrthomas20121.biolib.util.armorUtils; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.Traits.Traits; +import mrthomas20121.tinkers_reforged.config.ConfigMaterials; +import mrthomas20121.tinkers_reforged.resources.Resources; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.MaterialTypes; +import slimeknights.tconstruct.library.utils.HarvestLevels; +import slimeknights.tconstruct.tools.TinkerTraits; + +public class ModuleThermal implements ModuleBase { + + public ModuleThermal() { + Resources.enderium.builder.setTrait(Traits.enderfestation); + Resources.enderium.builder.setTrait(Traits.ender, MaterialTypes.HEAD); + Resources.enderium.builder.setHeadStats(750, 9.0f, 8.5f, HarvestLevels.COBALT); + Resources.enderium.builder.setHandleStats(0.9f, 170); + Resources.enderium.builder.setExtraStats(90); + Resources.enderium.builder.setBowStats(2, 1.5f, 7); + + Resources.signalum.builder.setTrait(Traits.signal); + Resources.signalum.builder.setTrait(Traits.flux); + Resources.signalum.builder.setHeadStats(540, 7.3f, 6.9f, HarvestLevels.OBSIDIAN); + Resources.signalum.builder.setHandleStats(1.3f, 90); + Resources.signalum.builder.setExtraStats(80); + Resources.signalum.builder.setBowStats(4.5f, 1, 6); + + Resources.lumium.builder.setTrait(Traits.light); + Resources.lumium.builder.setHeadStats(470, 7f, 5.1f, HarvestLevels.OBSIDIAN); + Resources.lumium.builder.setHandleStats(1.2f, 90); + Resources.lumium.builder.setExtraStats(80); + Resources.lumium.builder.setBowStats(2, 1, 9); + } + @Override + public void preInit(FMLPreInitializationEvent e) { + + if(ConfigMaterials.enderium) + { + Resources.enderium.builder.addCommonItems("Enderium"); + Resources.enderium.builder.preInit("Enderium", FluidUtils.getFluid("enderium")); + Resources.materials.add(Resources.enderium); + } + if(ConfigMaterials.signalum) + { + Resources.signalum.builder.addCommonItems("Signalum"); + Resources.signalum.builder.preInit("Signalum", FluidUtils.getFluid("signalum")); + Resources.materials.add(Resources.signalum); + } + + if(ConfigMaterials.lumium) + { + Resources.lumium.builder.addCommonItems("Lumium"); + Resources.lumium.builder.preInit("Lumium", FluidUtils.getFluid("Lumium")); + Resources.materials.add(Resources.lumium); + } + + if(Loader.isModLoaded("conarm")) + { + if(ConfigMaterials.lumium) armorUtils.setArmorStats(Resources.lumium.builder, 1); + if(ConfigMaterials.signalum) armorUtils.setArmorStats(Resources.signalum.builder, 1); + if(ConfigMaterials.enderium) armorUtils.setArmorStats(Resources.enderium.builder, 2); + } + } + @Override + public void init(FMLInitializationEvent e) { + + } + @Override + public void postInit(FMLPostInitializationEvent e) { + + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleTools.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleTools.java new file mode 100644 index 00000000..6659507e --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/ModuleTools.java @@ -0,0 +1,191 @@ +package mrthomas20121.tinkers_reforged.modules; + +import com.google.common.collect.Lists; +import mrthomas20121.biolib.common.ModuleBase; +import mrthomas20121.tinkers_reforged.config.Config; +import mrthomas20121.tinkers_reforged.config.ConfigModule; +import mrthomas20121.tinkers_reforged.TinkersReforged; +import mrthomas20121.tinkers_reforged.config.ConfigReforged; +import mrthomas20121.tinkers_reforged.tools.*; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.registries.IForgeRegistry; +import slimeknights.tconstruct.library.TinkerRegistry; +import slimeknights.tconstruct.library.materials.Material; +import slimeknights.tconstruct.library.modifiers.IModifier; +import slimeknights.tconstruct.library.tools.Pattern; +import slimeknights.tconstruct.library.tools.ToolPart; +import slimeknights.tconstruct.tools.TinkerModifiers; +import slimeknights.tconstruct.tools.TinkerTools; + +import java.util.ArrayList; + +@Mod.EventBusSubscriber(modid = TinkersReforged.MODID) +public class ModuleTools implements ModuleBase { + + // tool parts + public static ToolPart clubHead; + public static ToolPart greatBlade; + public static ToolPart CurvedBlade; + + // tools + public static SwordGladius gladius = null; + public static ToolClub club = null; + public static SwordGreatSword greatsword = null; + public static SwordKhopesh khopesh = null; + public static ToolRunicKnife knife = null; + + public void preInit(FMLPreInitializationEvent e) + { + } + public void init(FMLInitializationEvent e) + { + for(IModifier modifier : getTinkerModifiers()) + { + TinkersReforged.proxy.registerModifierModel(modifier, + new ResourceLocation(TinkersReforged.MODID, "models/item/modifiers/" + modifier.getIdentifier())); + } + } + + public void postInit(FMLPostInitializationEvent event) { } + + @SubscribeEvent + public void registerRecipes(RegistryEvent.Register event) { + IForgeRegistry registry = event.getRegistry(); + + TinkerTools.registerToolForgeBlock(registry, "blockTitanium"); + TinkerTools.registerToolForgeBlock(registry, "blockAluminium"); + TinkerTools.registerToolForgeBlock(registry, "blockIridium"); + TinkerTools.registerToolForgeBlock(registry, "blockRuby"); + TinkerTools.registerToolForgeBlock(registry, "blockAmethyst"); + TinkerTools.registerToolForgeBlock(registry, "blockSapphire"); + + if(ConfigModule.naturesaura) { + TinkerTools.registerToolForgeBlock(registry, "blockInfusedIron"); + } + + if(ConfigModule.thermalfoundation) { + TinkerTools.registerToolForgeBlock(registry, "blockConstantan"); + TinkerTools.registerToolForgeBlock(registry, "blockLumium"); + TinkerTools.registerToolForgeBlock(registry, "blockSignalum"); + TinkerTools.registerToolForgeBlock(registry, "blockEnderium"); + } + if(ConfigModule.botania) { + TinkerTools.registerToolForgeBlock(registry, "blockManasteel"); + TinkerTools.registerToolForgeBlock(registry, "blockElementium"); + TinkerTools.registerToolForgeBlock(registry, "blockTerrasteel"); + } + } + + @SubscribeEvent + public static void registerItems(RegistryEvent.Register event) { + IForgeRegistry r = event.getRegistry(); + + if(ConfigReforged.tools) + { + if(ConfigReforged.gladius) { + + gladius = new SwordGladius(); + gladius.setRegistryName(TinkersReforged.MODID, "gladius"); + gladius.setTranslationKey(TinkersReforged.MODID + ".gladius"); + r.register(gladius); + TinkersReforged.proxy.registerToolModel(gladius); + TinkerRegistry.registerToolForgeCrafting(gladius); + } + + if(ConfigReforged.runedKnife && Loader.isModLoaded("roots")) { + knife = new ToolRunicKnife(); + knife.setRegistryName(TinkersReforged.MODID, "runic_knife"); + knife.setTranslationKey(TinkersReforged.MODID + ".runic_knife"); + r.register(knife); + TinkersReforged.proxy.registerToolModel(knife); + TinkerRegistry.registerToolForgeCrafting(knife); + } + + if(ConfigReforged.club && Loader.isModLoaded("atum")) { + clubHead = new ToolPart(Material.VALUE_Ingot*3); + clubHead.setRegistryName(TinkersReforged.MODID,"club_head"); + clubHead.setTranslationKey(TinkersReforged.MODID + ".club_head"); + r.register(clubHead); + TinkersReforged.proxy.registerToolPartModel(clubHead); + registerStencil(clubHead); + + club = new ToolClub(); + club.setRegistryName(TinkersReforged.MODID, "club"); + club.setTranslationKey(TinkersReforged.MODID + ".club"); + r.register(club); + TinkersReforged.proxy.registerToolModel(club); + TinkerRegistry.registerToolForgeCrafting(club); + } + + if(ConfigReforged.greatsword && Loader.isModLoaded("atum")) { + greatBlade = new ToolPart(Material.VALUE_Ingot*4); + greatBlade.setRegistryName(TinkersReforged.MODID,"great_blade"); + greatBlade.setTranslationKey(TinkersReforged.MODID + ".great_blade"); + r.register(greatBlade); + TinkersReforged.proxy.registerToolPartModel(greatBlade); + registerStencil(greatBlade); + + greatsword = new SwordGreatSword(); + greatsword.setRegistryName(TinkersReforged.MODID, "greatsword"); + greatsword.setTranslationKey(TinkersReforged.MODID + ".greatsword"); + TinkersReforged.proxy.registerToolModel(greatsword); + r.register(greatsword); + TinkerRegistry.registerToolForgeCrafting(greatsword); + } + + if(ConfigReforged.khopesh && Loader.isModLoaded("atum")) { + CurvedBlade = new ToolPart(Material.VALUE_Ingot*3); + CurvedBlade.setRegistryName(TinkersReforged.MODID,"curved_blade"); + CurvedBlade.setTranslationKey(TinkersReforged.MODID + ".curved_blade"); + TinkersReforged.proxy.registerToolPartModel(CurvedBlade); + r.register(CurvedBlade); + registerStencil(CurvedBlade); + + khopesh = new SwordKhopesh(); + khopesh.setRegistryName(TinkersReforged.MODID, "khopesh"); + khopesh.setTranslationKey(TinkersReforged.MODID + ".khopesh"); + TinkersReforged.proxy.registerToolModel(khopesh); + r.register(khopesh); + TinkerRegistry.registerToolForgeCrafting(khopesh); + } + } + } + private static void registerStencil(ToolPart part) { + TinkerRegistry.registerStencilTableCrafting(Pattern.setTagForPart(new ItemStack(TinkerTools.pattern), part)); + } + private static ArrayList getTinkerModifiers() + { + ArrayList modifiers = Lists.newArrayList( + TinkerModifiers.modBaneOfArthopods, + TinkerModifiers.modBeheading, + TinkerModifiers.modDiamond, + TinkerModifiers.modEmerald, + TinkerModifiers.modGlowing, + TinkerModifiers.modHaste, + TinkerModifiers.modFiery, + TinkerModifiers.modKnockback, + TinkerModifiers.modLuck, + TinkerModifiers.modMendingMoss, + TinkerModifiers.modNecrotic, + TinkerModifiers.modReinforced, + TinkerModifiers.modSharpness, + TinkerModifiers.modShulking, + TinkerModifiers.modSilktouch, + TinkerModifiers.modSmite, + TinkerModifiers.modSoulbound, + TinkerModifiers.modWebbed, + TinkerModifiers.modBlasting + ); + return modifiers; + } +} diff --git a/src/main/java/mrthomas20121/tinkers_reforged/modules/Modules.java b/src/main/java/mrthomas20121/tinkers_reforged/modules/Modules.java new file mode 100644 index 00000000..305af318 --- /dev/null +++ b/src/main/java/mrthomas20121/tinkers_reforged/modules/Modules.java @@ -0,0 +1,114 @@ +package mrthomas20121.tinkers_reforged.modules; + +import mrthomas20121.tinkers_reforged.config.ConfigModule; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.fml.common.event.FMLInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; +import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; + +public class Modules { + + public static final ModuleThermal thermal = new ModuleThermal(); + public static final ModuleNatureAura natureAura = new ModuleNatureAura();; + public static final ModuleAe ae = new ModuleAe(); + public static final ModuleAA aa = new ModuleAA(); + public static final ModuleAstralSorcery astral = new ModuleAstralSorcery(); + public static final ModuleAtum atum = new ModuleAtum(); + public static final ModuleBotania botania = new ModuleBotania(); + public static final ModuleBlueSkies blueskies = new ModuleBlueSkies(); + public static final ModuleCavern cavernII = new ModuleCavern(); + public static final ModuleCommonMaterials common_materials_module = new ModuleCommonMaterials(); + public static final ModuleRoots roots = new ModuleRoots(); + public static final ModuleExtremeReactor extreme = new ModuleExtremeReactor(); + public static final ModuleMekanism mekanism = new ModuleMekanism(); + public static final ModuleItems moduleItems = new ModuleItems(); + // tool module + public static final ModuleTools tools = new ModuleTools(); + + public static void preInit(FMLPreInitializationEvent event) { + moduleItems.preInit(event); + common_materials_module.preInit(event); + + if(Loader.isModLoaded("actuallyadditions") && ConfigModule.actuallyadditions) { + aa.preInit(event); + } + if(Loader.isModLoaded("botania") && ConfigModule.botania) + { + botania.preInit(event); + } + if(Loader.isModLoaded("cavern") && ConfigModule.cavernII) + { + cavernII.preInit(event); + } + if(Loader.isModLoaded("thermalfoundation") && ConfigModule.thermalfoundation) { + thermal.preInit(event); + } + if(Loader.isModLoaded("naturesaura") && ConfigModule.naturesaura) { + natureAura.preInit(event); + } + if(Loader.isModLoaded("appliedenergistics2") && ConfigModule.appliedenergistics) { + ae.preInit(event); + } + if(Loader.isModLoaded("astralsorcery") && ConfigModule.astralsorcery) { + astral.preInit(event); + } + if(Loader.isModLoaded("atum") && ConfigModule.atum) { + atum.preInit(event); + } + if(Loader.isModLoaded("roots") && ConfigModule.roots) { + roots.preInit(event); + } + if(Loader.isModLoaded("bigreactors") && ConfigModule.bigreactors) { + extreme.preInit(event); + } + if(Loader.isModLoaded("mekanism") && ConfigModule.mekanism) { + mekanism.preInit(event); + } + if(Loader.isModLoaded("blue_skies") && ConfigModule.blueskies) { + blueskies.preInit(event); + } + } + + public static void init(FMLInitializationEvent event) { + moduleItems.init(event); + common_materials_module.init(event); + + if(Loader.isModLoaded("actuallyadditions") && ConfigModule.actuallyadditions) { + aa.init(event); + } + if(Loader.isModLoaded("thermalfoundation") && ConfigModule.thermalfoundation) { + thermal.init(event); + } + if(Loader.isModLoaded("naturesaura") && ConfigModule.thermalfoundation) { + natureAura.init(event); + } + if(Loader.isModLoaded("appliedenergistics2") && ConfigModule.appliedenergistics) { + ae.init(event); + } + if(Loader.isModLoaded("astralsorcery") && ConfigModule.astralsorcery) { + astral.init(event); + } + if(Loader.isModLoaded("atum") && ConfigModule.atum) { + atum.init(event); + } + if(Loader.isModLoaded("bigreactors") && ConfigModule.bigreactors) { + extreme.init(event); + } + if(Loader.isModLoaded("roots") && ConfigModule.roots) { + roots.init(event); + } + if(Loader.isModLoaded("blue_skies") && ConfigModule.blueskies) { + blueskies.init(event); + } + if(Loader.isModLoaded("botania") && ConfigModule.botania) { + botania.init(event); + } + } + + public static void postInit(FMLPostInitializationEvent event) { + if(Loader.isModLoaded("atum") && ConfigModule.atum) { + atum.postInit(event); + } + moduleItems.postInit(event); + } +}