diff --git a/build.gradle b/build.gradle index 235bd1e86..fc92d7292 100644 --- a/build.gradle +++ b/build.gradle @@ -81,6 +81,10 @@ repositories { name "OpenComputer" url "http://maven.cil.li/" } + maven { + name "CurseForge" + url "https://minecraft.curseforge.com/api/maven/" + } } configurations { @@ -112,15 +116,12 @@ license { group = 'TechReborn' dependencies { - //Some dep we use wants the older jei, so this ingores it. We grab the latest anyway, so it shoudnt cause any issues. - def withoutOldJEI = { exclude module: 'jei_1.12.2' } - deobfCompile('RebornCore:RebornCore-1.12.2:+:universal') { transitive = false } compile "mcp.mobius.waila:Hwyla:+" compile "CraftTweaker2:CraftTweaker2-MC1120-Main:1.12-4.0.12.323" - compile name: 'buildcraft', version: '7.99.17', ext: 'jar' + compile name: 'buildcraft', version: '7.99.19', ext: 'jar' deobfCompile "mezz.jei:jei_1.12.2:+" deobfCompile "mcjty.theoneprobe:TheOneProbe-1.12:1.12-1.4.19-11" @@ -135,6 +136,9 @@ dependencies { deobfCompile 'MCMultiPart2:MCMultiPart:2.4.1' deobfCompile "li.cil.oc:OpenComputers:MC1.12.2-1.7.2+" deobfCompile "blusunrize:ImmersiveEngineering:0.12-+" + deobfCompile "mekanism:Mekanism:1.12.2:9.4.13.349" + deobfCompile "mekanism-generators:MekanismGenerators:1.12.2:9.4.13.349" + deobfCompile "mekanism-tools:MekanismTools:1.12.2:9.4.13.349" } diff --git a/src/main/java/techreborn/compat/CompatManager.java b/src/main/java/techreborn/compat/CompatManager.java index c584a6406..807d39cc9 100644 --- a/src/main/java/techreborn/compat/CompatManager.java +++ b/src/main/java/techreborn/compat/CompatManager.java @@ -37,6 +37,7 @@ import techreborn.compat.buildcraft.BuildcraftCompat; import techreborn.compat.crafttweaker.CraftTweakerCompat; import techreborn.compat.ic2.RecipesIC2; import techreborn.compat.immersiveengineering.RecipeImmersiveEngineering; +import techreborn.compat.mekanism.MekanismCompat; import techreborn.compat.opencomputers.CompatOpenComputers; import techreborn.compat.theoneprobe.TheOneProbeCompat; import techreborn.compat.thermalexpansion.RecipeThermalExpansion; @@ -59,13 +60,13 @@ public class CompatManager { register(CraftTweakerCompat.class, "crafttweaker"); register(CompatModuleTinkers.class, "tconstruct"); register(TheOneProbeCompat.class, "theoneprobe"); - //register(CompatModulePsi.class, "Psi"); register(RecipesIC2.class, "ic2"); register(BuildcraftBuildersCompat.class, "buildcraftbuilders"); register(BuildcraftCompat.class, "buildcraftcore"); register(RecipeThermalExpansion.class, "thermalexpansion"); register(CompatOpenComputers.class, "opencomputers"); register(RecipeImmersiveEngineering.class, "immersiveengineering"); + register(MekanismCompat.class, "mekanism"); } public void register(Class moduleClass, Object... objs) { diff --git a/src/main/java/techreborn/compat/mekanism/MekanismCompat.java b/src/main/java/techreborn/compat/mekanism/MekanismCompat.java new file mode 100644 index 000000000..27d1cd3bb --- /dev/null +++ b/src/main/java/techreborn/compat/mekanism/MekanismCompat.java @@ -0,0 +1,44 @@ +package techreborn.compat.mekanism; + +import mekanism.api.gas.Gas; +import mekanism.api.gas.GasRegistry; +import mekanism.common.FuelHandler; +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.event.FMLServerStartingEvent; +import reborncore.common.RebornCoreConfig; +import techreborn.api.generator.EFluidGenerator; +import techreborn.api.generator.GeneratorRecipeHelper; +import techreborn.compat.ICompatModule; + +import java.util.function.Consumer; + +public class MekanismCompat implements ICompatModule { + @Override + public void preInit(FMLPreInitializationEvent event) { + + } + + @Override + public void init(FMLInitializationEvent event) { + + } + + @Override + public void postInit(FMLPostInitializationEvent event) { + GasRegistry.getRegisteredGasses().stream().filter(gas -> FuelHandler.getFuel(gas) != null).forEach(new Consumer() { + @Override + public void accept(Gas gas) { + FuelHandler.FuelGas fuel = FuelHandler.getFuel(gas); + GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.GAS, gas.getFluid(), (int) fuel.energyPerTick / RebornCoreConfig.euPerFU); + } + }); + + } + + @Override + public void serverStarting(FMLServerStartingEvent event) { + + } +} diff --git a/src/main/java/techreborn/compat/psi/CompatModulePsi.java b/src/main/java/techreborn/compat/psi/CompatModulePsi.java deleted file mode 100644 index 208b805e4..000000000 --- a/src/main/java/techreborn/compat/psi/CompatModulePsi.java +++ /dev/null @@ -1,78 +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.psi; -// -//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.event.FMLServerStartingEvent; -//import techreborn.compat.ICompatModule; -//import techreborn.compat.psi.spell.trick.block.PieceTrickBlockTap; -//import vazkii.psi.api.PsiAPI; -//import vazkii.psi.api.spell.Spell; -//import vazkii.psi.api.spell.SpellPiece; -//import vazkii.psi.common.lib.LibPieceGroups; -// -//public class CompatModulePsi implements ICompatModule { -// public static PieceContainer trickTreetap; -// public static final String TRICK_TAP_BLOCK = "trickTapBlock"; -// -// @Override -// public void preInit(FMLPreInitializationEvent event) { -// trickTreetap = register(PieceTrickBlockTap.class, TRICK_TAP_BLOCK, LibPieceGroups.BLOCK_WORKS); -// } -// -// @Override -// public void init(FMLInitializationEvent event) { -// -// } -// -// @Override -// public void postInit(FMLPostInitializationEvent event) { -// -// } -// -// @Override -// public void serverStarting(FMLServerStartingEvent event) { -// -// } -// -// public static PieceContainer register(Class clazz, String name, String group) { -// return register(clazz, name, group, false); -// } -// -// public static PieceContainer register(Class clazz, String name, String group, boolean main) { -// PsiAPI.registerSpellPieceAndTexture(name, clazz); -// PsiAPI.addPieceToGroup(clazz, group, main); -// return (Spell s) -> { -// return SpellPiece.create(clazz, s); -// }; -// } -// -// public static interface PieceContainer { -// public SpellPiece get(Spell s); -// } -// -//} diff --git a/src/main/java/techreborn/compat/psi/spell/trick/block/PieceTrickBlockTap.java b/src/main/java/techreborn/compat/psi/spell/trick/block/PieceTrickBlockTap.java deleted file mode 100644 index b322b7fe0..000000000 --- a/src/main/java/techreborn/compat/psi/spell/trick/block/PieceTrickBlockTap.java +++ /dev/null @@ -1,126 +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.psi.spell.trick.block; -// -//import java.util.Random; -// -//import net.minecraft.block.state.IBlockState; -//import net.minecraft.entity.item.EntityItem; -//import net.minecraft.util.EnumFacing; -//import net.minecraft.util.math.BlockPos; -//import techreborn.blocks.BlockRubberLog; -//import techreborn.items.ItemParts; -//import vazkii.psi.api.internal.Vector3; -//import vazkii.psi.api.spell.EnumSpellStat; -//import vazkii.psi.api.spell.Spell; -//import vazkii.psi.api.spell.SpellCompilationException; -//import vazkii.psi.api.spell.SpellContext; -//import vazkii.psi.api.spell.SpellMetadata; -//import vazkii.psi.api.spell.SpellParam; -//import vazkii.psi.api.spell.SpellRuntimeException; -//import vazkii.psi.api.spell.param.ParamVector; -//import vazkii.psi.api.spell.piece.PieceTrick; -// -//public class PieceTrickBlockTap extends PieceTrick { -// -// SpellParam position; -// SpellParam side; -// -// public PieceTrickBlockTap(Spell spell) { -// super(spell); -// } -// -// @Override -// public void initParams() { -// addParam(position = new ParamVector(SpellParam.GENERIC_NAME_POSITION, SpellParam.BLUE, false, false)); -// addParam(side = new ParamVector("Side", SpellParam.GREEN, false, false)); -// } -// -// @Override -// public void addToMetadata(SpellMetadata meta) throws SpellCompilationException { -// super.addToMetadata(meta); -// -// meta.addStat(EnumSpellStat.POTENCY, 20); -// meta.addStat(EnumSpellStat.COST, 25); -// } -// -// @Override -// public Object execute(SpellContext context) throws SpellRuntimeException { -// if (context.caster.worldObj.isRemote) -// return null; -// -// Vector3 positionVal = this. getParamValue(context, position); -// Vector3 sideVal = this. getParamValue(context, side); -// -// if (positionVal == null) -// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR); -// if (!context.isInRadius(positionVal)) -// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS); -// -// if (sideVal == null) -// throw new SpellRuntimeException(SpellRuntimeException.NULL_VECTOR); -// if (!context.isInRadius(sideVal)) -// throw new SpellRuntimeException(SpellRuntimeException.OUTSIDE_RADIUS); -// -// if(!sideVal.isAxial()){ -// return null; -// } -// -// BlockPos pos = new BlockPos(positionVal.x, positionVal.y, positionVal.z); -// IBlockState state = context.caster.worldObj.getBlockState(pos); -// if (state.getBlock() instanceof BlockRubberLog) { -// System.out.println("Is rubber log"); -// if (state.getValue(BlockRubberLog.HAS_SAP)) { -// System.out.println("Has sap"); -// if (state.getValue(BlockRubberLog.SAP_SIDE) == null) { -// System.out.println("got this far"); -// context.caster.worldObj.setBlockState(pos, state.withProperty(BlockRubberLog.HAS_SAP, false) -// .withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(0))); -// // TODO 1.9 sounds -// // worldIn.playSoundAtEntity(playerIn, -// // "techreborn:sap_extract", 0.8F, 1F); -// if (!context.caster.worldObj.isRemote) { -// System.out.println("doing stuff"); -// Random rand = new Random(); -// BlockPos itemPos = pos.offset(context.positionBroken.sideHit); -// EntityItem item = new EntityItem(context.caster.worldObj, itemPos.getX(), itemPos.getY(), -// itemPos.getZ(), ItemParts.getPartByName("rubberSap").copy()); -// float factor = 0.05F; -// item.motionX = rand.nextGaussian() * factor; -// item.motionY = rand.nextGaussian() * factor + 0.2F; -// item.motionZ = rand.nextGaussian() * factor; -// context.caster.worldObj.spawnEntityInWorld(item); -// } -// } else { -// return null; -// } -// } else { -// return null; -// } -// } -// return null; -// -// } -//}