Cleanup ic2 support

This commit is contained in:
modmuss50 2018-12-09 00:24:52 +00:00
parent cb292205dd
commit 0d9e98b370
5 changed files with 0 additions and 302 deletions

View file

@ -47,11 +47,6 @@ repositories {
name "JEI" name "JEI"
url "http://dvs1.progwml6.com/files/maven" url "http://dvs1.progwml6.com/files/maven"
} }
maven {
// IC2
name = "ic2"
url = "http://maven.ic2.player.to/"
}
} }
configurations { configurations {
@ -91,7 +86,6 @@ dependencies {
} }
deobfCompile "mezz.jei:jei_1.12.2:+" deobfCompile "mezz.jei:jei_1.12.2:+"
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+'
} }

View file

@ -1,160 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.compat.ic2;
import ic2.core.block.BlockIC2Fence;
import ic2.core.block.BlockTexGlass;
import ic2.core.block.type.ResourceBlock;
import ic2.core.block.wiring.CableType;
import ic2.core.item.block.ItemCable;
import ic2.core.item.type.CraftingItemType;
import ic2.core.item.type.MiscResourceType;
import ic2.core.item.type.NuclearResourceType;
import ic2.core.ref.BlockName;
import ic2.core.ref.ItemName;
import ic2.core.ref.TeBlock;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.OreUtil;
import techreborn.Core;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.init.IC2Duplicates;
import techreborn.items.ingredients.ItemParts;
/**
* Created by modmuss50 on 16/07/2016.
*/
public class IC2Dict {
public static void init() {
IC2Duplicates.GRINDER.setIc2Stack(BlockName.te.getItemStack(TeBlock.macerator.getName()));
IC2Duplicates.ELECTRICAL_FURNACE.setIc2Stack(BlockName.te.getItemStack(TeBlock.electric_furnace.getName()));
IC2Duplicates.IRON_FURNACE.setIc2Stack(BlockName.te.getItemStack(TeBlock.iron_furnace.getName()));
IC2Duplicates.GENERATOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.generator.getName()));
IC2Duplicates.WATER_MILL.setIc2Stack(BlockName.te.getItemStack(TeBlock.water_generator.getName()));
IC2Duplicates.EXTRACTOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.extractor.getName()));
IC2Duplicates.RECYCLER.setIc2Stack(BlockName.te.getItemStack(TeBlock.recycler.getName()));
IC2Duplicates.COMPRESSOR.setIc2Stack(BlockName.te.getItemStack(TeBlock.compressor.getName()));
IC2Duplicates.BAT_BOX.setIc2Stack(BlockName.te.getItemStack(TeBlock.batbox.getName()));
IC2Duplicates.MFE.setIc2Stack(BlockName.te.getItemStack(TeBlock.mfe.getName()));
IC2Duplicates.MFSU.setIc2Stack(BlockName.te.getItemStack(TeBlock.mfsu.getName()));
IC2Duplicates.LVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.lv_transformer.getName()));
IC2Duplicates.MVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.mv_transformer.getName()));
IC2Duplicates.HVT.setIc2Stack(BlockName.te.getItemStack(TeBlock.hv_transformer.getName()));
IC2Duplicates.CABLE_COPPER.setIc2Stack(getIC2Cable(CableType.copper, 0));
IC2Duplicates.CABLE_GOLD.setIc2Stack(getIC2Cable(CableType.gold, 0));
IC2Duplicates.CABLE_ICOPPER.setIc2Stack(getIC2Cable(CableType.copper, 1));
IC2Duplicates.CABLE_IGOLD.setIc2Stack(getIC2Cable(CableType.gold, 1));
IC2Duplicates.CABLE_HV.setIc2Stack(getIC2Cable(CableType.tin, 0));
IC2Duplicates.CABLE_IHV.setIc2Stack(getIC2Cable(CableType.tin, 1));
IC2Duplicates.CABLE_IIHV.setIc2Stack(getIC2Cable(CableType.tin, 2));
IC2Duplicates.CABLE_GLASSFIBER.setIc2Stack(getIC2Cable(CableType.glass, 0));
IC2Duplicates.MIXED_METAL.setIc2Stack(ItemName.ingot.getItemStack("alloy"));
IC2Duplicates.CARBON_FIBER.setIc2Stack(ItemName.crafting.getItemStack("carbon_fibre"));
IC2Duplicates.CARBON_MESH.setIc2Stack(ItemName.crafting.getItemStack("carbon_mesh"));
IC2Duplicates.REFINED_IRON.setIc2Stack(ItemName.plate.getItemStack("iron"));
IC2Duplicates.SCRAP.setIc2Stack(ItemName.crafting.getItemStack(CraftingItemType.scrap));
IC2Duplicates.FREQ_TRANSMITTER.setIc2Stack(ItemName.frequency_transmitter.getItemStack());
IC2Duplicates.NEUTRON_REFLECTOR.setIc2Stack(ItemName.neutron_reflector.getItemStack());
IC2Duplicates.THICK_NEUTRON_REFLECTOR.setIc2Stack(ItemName.thick_neutron_reflector.getItemStack());
IC2Duplicates.IRIDIUM_NEUTRON_REFLECTOR.setIc2Stack(ItemName.iridium_reflector.getItemStack());
//Rubber - ore dic: itemRubber, hidden from JEI
//Rubber Sap - only used to make rubber, hidden from JEI
//Rubber tree blocks, hidden when deduplication is on, and rubber tress are not set to gen, includes tree taps
//Circuits are hidden in JEI
RecipeHandler.addRecipe(
new ExtractorRecipe(ItemName.misc_resource.getItemStack("resin"),
ItemParts.getPartByName("rubber", 3), 400, 2));
try {
CraftingItemType.circuit.getName();
OreUtil.registerOre("reBattery", ItemName.re_battery.getItemStack());
OreUtil.registerOre("circuitBasic", ItemName.crafting.getItemStack(CraftingItemType.circuit));
OreUtil.registerOre("circuitAdvanced", ItemName.crafting.getItemStack(CraftingItemType.advanced_circuit));
OreUtil.registerOre("machineBlockBasic", BlockName.resource.getItemStack(ResourceBlock.machine));
OreUtil.registerOre("machineBlockAdvanced", BlockName.resource.getItemStack(ResourceBlock.advanced_machine));
OreUtil.registerOre("lapotronCrystal", ItemName.lapotron_crystal.getItemStack());
OreUtil.registerOre("energyCrystal", ItemName.energy_crystal.getItemStack());
OreUtil.registerOre("drillBasic", ItemName.drill.getItemStack());
OreUtil.registerOre("drillDiamond", ItemName.diamond_drill.getItemStack());
OreUtil.registerOre("drillAdvanced", ItemName.iridium_drill.getItemStack());
OreUtil.registerOre("reflectorBasic", ItemName.neutron_reflector.getItemStack());
OreUtil.registerOre("reflectorThick", ItemName.thick_neutron_reflector.getItemStack());
OreUtil.registerOre("reflectorIridium", ItemName.iridium_reflector.getItemStack());
ItemStack industrialTnt = BlockName.te.getItemStack(TeBlock.itnt);
industrialTnt.setItemDamage(1);
OreUtil.registerOre("industrialTnt", industrialTnt);
OreUtil.registerOre("craftingIndustrialDiamond", ItemName.crafting.getItemStack(CraftingItemType.industrial_diamond));
OreUtil.registerOre("fertilizer", ItemName.crafting.getItemStack(CraftingItemType.bio_chaff));
OreUtil.registerOre("hvTransformer", BlockName.te.getItemStack(TeBlock.hv_transformer));
OreUtil.registerOre("uran235", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_235));
OreUtil.registerOre("uran238", ItemName.nuclear.getItemStack(NuclearResourceType.uranium_238));
OreUtil.registerOre("smallUran238", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_238));
OreUtil.registerOre("smallUran235", ItemName.nuclear.getItemStack(NuclearResourceType.small_uranium_235));
OreUtil.registerOre("fenceIron", BlockName.fence.getItemStack(BlockIC2Fence.IC2FenceType.iron));
OreUtil.registerOre("rubberWood", BlockName.rubber_wood.getItemStack());
OreUtil.registerOre("glassReinforced", BlockName.glass.getItemStack(BlockTexGlass.GlassType.reinforced));
OreUtil.registerOre("oreIridium", ItemName.misc_resource.getItemStack(MiscResourceType.iridium_ore));
OreUtil.registerOre("plateIridiumAlloy", ItemName.crafting.getItemStack(CraftingItemType.iridium));
} catch (NoClassDefFoundError notFound) {
Core.logHelper.warn(
"Can't enable integration: IC2 installed but cannot be hooked\n" +
"Do you use incompatible IC2 version?\n" +
"Please create issue on github and provide FULL LOG and mod list");
} catch (Throwable error) {
Core.logHelper.warn(
"Exception thrown during IC2 integration init\n" +
"Do you use incompatible IC2 version?\n" +
"Please create issue on github and provide FULL LOG and mod list.\n" +
"Error stack trace: ");
error.printStackTrace();
}
}
public static ItemStack getIC2Cable(CableType type, int insulation) {
if (insulation > type.maxInsulation) {
return null;
}
return ItemCable.getCable(type, insulation);
}
}

View file

@ -1,132 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.compat.ic2;
import ic2.api.item.IC2Items;
import ic2.core.item.tool.ItemTreetap;
import ic2.core.ref.ItemName;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.util.RebornCraftingHelper;
import techreborn.api.IC2Helper;
import techreborn.api.TechRebornAPI;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.api.recipe.machines.ExtractorRecipe;
import techreborn.api.recipe.machines.GrinderRecipe;
import techreborn.compat.ICompatModule;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.init.recipes.ChemicalReactorRecipes;
import techreborn.init.recipes.RecipeMethods;
import techreborn.items.ingredients.ItemParts;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Mark on 06/06/2016.
*/
@RebornRegistry(modOnly = "ic2,!ic2-classic-spmod", modID = ModInfo.MOD_ID)
public class IC2Module implements ICompatModule, IC2Helper {
List<RecipeDuplicate> recipeDuplicateList = new ArrayList<>();
@Override
public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
TechRebornAPI.ic2Helper = this;
}
// LOW is used as we want it to load as late as possible, but before crafttweaker
@SubscribeEvent(priority = EventPriority.LOW)
public void registerRecipes(RegistryEvent.Register<IRecipe> event) {
recipeDuplicateList.add(new RecipeDuplicate(new ItemStack(ModBlocks.MACHINE_FRAMES, 1, 0),
IC2Items.getItem("resource", "machine")));
for (RecipeDuplicate duplicate : recipeDuplicateList) {
duplicate.add();
}
RebornCraftingHelper.addShapelessRecipe(ItemParts.getPartByName("rubber"),
IC2Items.getItem("crafting", "rubber"));
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("crafting", "rubber"),
ItemParts.getPartByName("rubber"));
RebornCraftingHelper.addShapelessRecipe(IC2Items.getItem("electric_wrench"), new ItemStack(ModItems.WRENCH),
IC2Items.getItem("crafting", "small_power_unit"));
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "carbon_mesh"),
IC2Items.getItem("crafting", "carbon_plate"), 300, 4));
RecipeHandler.addRecipe(new CompressorRecipe(IC2Items.getItem("crafting", "coal_ball"),
IC2Items.getItem("crafting", "coal_block"), 300, 4));
RecipeHandler.addRecipe(new GrinderRecipe(ItemName.crafting.getItemStack("tin_can"),
RecipeMethods.getOre("dustTin", 2), 300, 16));
RecipeHandler.addRecipe(new ExtractorRecipe(ItemName.filled_tin_can.getItemStack(),
ItemName.crafting.getItemStack("tin_can"), 300, 16));
ItemStack f = IC2Items.getItem("crop_res", "fertilizer");
ChemicalReactorRecipes.register(RecipeMethods.getMaterial("calcite", RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sulfur", RecipeMethods.Type.DUST), f, 40);
}
@Override
public void initDuplicates() {
IC2Dict.init();
}
@Override
public boolean extractSap(EntityPlayer player, World world, BlockPos pos, EnumFacing side, IBlockState state, List<ItemStack> stacks) {
return ItemTreetap.attemptExtract(player, world, pos, side, state, null);
}
public class RecipeDuplicate {
ItemStack stack1;
ItemStack stack2;
public RecipeDuplicate(ItemStack stack1, ItemStack stack2) {
this.stack1 = stack1;
this.stack2 = stack2;
}
public void add() {
RebornCraftingHelper.addShapelessRecipe(stack2, stack1);
RebornCraftingHelper.addShapelessRecipe(stack1, stack2);
}
}
}

View file

@ -36,12 +36,10 @@ import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.common.registration.RebornRegistry; import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry; import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.ic2.IC2ItemCharger;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
import reborncore.client.containerBuilder.IContainerProvider; import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer; import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder; import reborncore.client.containerBuilder.builder.ContainerBuilder;
import techreborn.compat.CompatManager;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;

View file

@ -36,10 +36,8 @@ import reborncore.api.tile.IInventoryProvider;
import reborncore.common.RebornCoreConfig; import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.ExternalPowerSystems; import reborncore.common.powerSystem.ExternalPowerSystems;
import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import reborncore.ic2.IC2ItemCharger;
import reborncore.common.util.Inventory; import reborncore.common.util.Inventory;
import techreborn.blocks.storage.BlockEnergyStorage; import techreborn.blocks.storage.BlockEnergyStorage;
import techreborn.compat.CompatManager;
/** /**
* Created by Rushmead * Created by Rushmead