Start work on porting from the MT script
This commit is contained in:
parent
93f039c71b
commit
7ecdd27752
3 changed files with 81 additions and 0 deletions
|
@ -60,6 +60,10 @@ repositories {
|
|||
name "MineTweaker3"
|
||||
artifactPattern "http://minetweaker3.powerofbytes.com/download/[module]-[classifier]-[revision].[ext]"
|
||||
}
|
||||
ivy {
|
||||
name "OpenComputers"
|
||||
artifactPattern "http://maven.cil.li/li/cil/oc/[module]/[revision]/[module]-[revision]-[classifier].[ext]"
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
|
@ -122,7 +126,9 @@ dependencies {
|
|||
compile "com.github.azanor:baubles:1.0.1.10:deobf@jar"
|
||||
compile name: "MineTweaker3", version: "1.7.10-3.0.9C", classifier: "Dev"
|
||||
shade 'IC2-Classic-API-STANDALONE:IC2-Classic-API-STANDALONE:1.1.0.19-5:api'
|
||||
compile 'li.cil.oc:OpenComputers:MC1.7.10-1.6.0.840-dev:dev'
|
||||
compile 'RebornCore:RebornCore:1.1.0.+:dev'
|
||||
compile name: "OpenComputers", version: "MC1.7.10-1.6.0.840-dev", classifier: "dev"
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package techreborn.compat;
|
|||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import ic2.api.info.IC2Classic;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.ee3.EmcValues;
|
||||
import techreborn.compat.fmp.ForgeMultipartCompat;
|
||||
import techreborn.compat.minetweaker.MinetweakerCompat;
|
||||
|
@ -47,13 +48,16 @@ public class CompatManager {
|
|||
registerCompact(RecipesForestry.class, "Forestry", isForestry4());
|
||||
registerCompact(MinetweakerCompat.class, "MineTweaker3");
|
||||
registerCompact(ForgeMultipartCompat.class, "ForgeMultipart");
|
||||
registerCompact(RecipesBuildcraftOpenComputers.class, "BuildCraft|Core", "OpenComputers", "!IC2");
|
||||
}
|
||||
|
||||
public void registerCompact(Class<?> moduleClass, Object... objs) {
|
||||
Core.logHelper.info("Attempting to loading compat module " + moduleClass.getSimpleName());
|
||||
boolean shouldLoad = ConfigTechReborn.config.get(ConfigTechReborn.CATEGORY_INTEGRATION, "Compat:" + moduleClass.getSimpleName(), true, "Should the " + moduleClass.getSimpleName() + " be loaded?").getBoolean(true);
|
||||
if (ConfigTechReborn.config.hasChanged())
|
||||
ConfigTechReborn.config.save();
|
||||
if(!shouldLoad){
|
||||
Core.logHelper.info("Compat module " + moduleClass.getSimpleName() + " was not loaded because it has been disabled in the config file.");
|
||||
return;
|
||||
}
|
||||
for (Object obj : objs) {
|
||||
|
@ -61,10 +65,12 @@ public class CompatManager {
|
|||
String modid = (String) obj;
|
||||
if (modid.startsWith("!")) {
|
||||
if (Loader.isModLoaded(modid.replaceAll("!", ""))) {
|
||||
Core.logHelper.info("Compat module " + moduleClass.getSimpleName() + " has not been loaded because " + modid.replaceAll("!", "") + " is loaded!");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Loader.isModLoaded(modid)) {
|
||||
Core.logHelper.info("Compat module " + moduleClass.getSimpleName() + " has not been loaded because " + modid.replaceAll("!", "") + " is not loaded!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -72,9 +78,11 @@ public class CompatManager {
|
|||
Boolean boo = (Boolean) obj;
|
||||
if (boo == false) {
|
||||
}
|
||||
Core.logHelper.info("Compat module " + moduleClass.getSimpleName() + " has not been loaded because it was told not to");
|
||||
return;
|
||||
}
|
||||
}
|
||||
Core.logHelper.info("Compat module " + moduleClass.getSimpleName() + " has been loaded");
|
||||
try {
|
||||
compatModules.add((ICompatModule) moduleClass.newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import ic2.core.block.machine.BlockMachine;
|
||||
import ic2.core.item.resources.ItemIngot;
|
||||
import li.cil.oc.api.driver.Item;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
import reborncore.common.util.OreUtil;
|
||||
import techreborn.blocks.BlockMachineFrame;
|
||||
import techreborn.blocks.BlockOre;
|
||||
import techreborn.blocks.BlockStorage;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.events.OreUnifier;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.items.ItemDusts;
|
||||
import techreborn.items.ItemIngots;
|
||||
import techreborn.items.ItemPlates;
|
||||
|
||||
/**
|
||||
* The recipes in here are taken from https://gist.github.com/BBoldt/a29cc5e745856225423c
|
||||
*
|
||||
* Thanks @BBoldt
|
||||
*/
|
||||
public class RecipesBuildcraftOpenComputers implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
for(String plate : ItemPlates.types){
|
||||
if(OreUtil.hasBlock(plate)){
|
||||
CraftingHelper.addShapelessOreRecipe(ItemPlates.getPlateByName(plate, 16), Items.diamond_axe, "block" + OreUtil.capitalizeFirstLetter(plate));
|
||||
}
|
||||
}
|
||||
GameRegistry.addSmelting(BlockOre.getOreByName("iridium"), ItemIngots.getIngotByName("iridium"), 0F);
|
||||
GameRegistry.addSmelting(BlockOre.getOreByName("platinum"), ItemDusts.getDustByName("iridium"), 0F);
|
||||
|
||||
CraftingHelper.addShapelessOreRecipe(BlockMachineFrame.getFrameByName("iron", 1), "plateIron", "plateIron", "plateIron", "plateIron", "plateIron", "plateIron", "plateIron", "plateIron", "plateIron");
|
||||
|
||||
// CraftingHelper.addShapedOreRecipe(BlockMachineFrame.getFrameByName("steel", 1),
|
||||
// "SCS", "CFC", "SCS",
|
||||
// "S", "plateSteel",
|
||||
// "C", "plateCoal",
|
||||
// "F", BlockMachineFrame.getFrameByName("iron", 1));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue