Stage one of moving compat code out into a separate project

This commit is contained in:
modmuss50 2018-11-16 15:44:33 +00:00
parent 891e2ea13b
commit aa0ffe7559
41 changed files with 92 additions and 3125 deletions

View file

@ -37,58 +37,15 @@ repositories {
url = "http://maven.modmuss50.me/"
}
maven {
// JEI, TiC
name "TiC"
// JEI
name "JEI"
url "http://dvs1.progwml6.com/files/maven"
}
maven {
name = "Amadornes"
url "http://maven.amadornes.com/"
}
maven {
// CraftTweaker2
name "Jared"
url "http://maven.blamejared.com/"
}
maven {
// TheOneProbe
url "http://maven.tterrag.com/"
}
maven {
// IC2
name = "ic2"
url = "http://maven.ic2.player.to/"
}
maven {
// HWYLA
name "TehNut"
url "http://tehnut.info/maven/"
}
maven {
name 'CB Repo'
url "http://chickenbones.net/maven/"
}
maven {
// CoFH
name 'Covers'
url "http://maven.covers1624.net/"
}
ivy {
name "BuildCraft"
artifactPattern "http://www.mod-buildcraft.com/releases/BuildCraft/[revision]/[module]-[revision].[ext]"
}
maven {
name "OpenComputer"
url "http://maven.cil.li/"
}
maven {
name "CurseForge"
url "https://minecraft.curseforge.com/api/maven/"
}
ivy {
name "AE2"
artifactPattern "http://ae-mod.info/builds/[module]-[revision](-[classifier])(.[ext])"
}
}
configurations {
@ -123,28 +80,9 @@ dependencies {
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.19', ext: 'jar'
deobfCompile "mezz.jei:jei_1.12.2:+"
deobfCompile "mcjty.theoneprobe:TheOneProbe-1.12:1.12-1.4.19-11"
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+'
deobfCompile 'cofh:ThermalDynamics:1.12.2-+:universal'
deobfCompile 'cofh:ThermalExpansion:1.12.2-+:universal'
deobfCompile "cofh:CoFHCore:1.12.2-+:universal"
deobfCompile "cofh:ThermalFoundation:1.12.2-+:universal"
deobfCompile "cofh:RedstoneFlux:1.12-2.1+:universal"
deobfCompile "cofh:CoFHWorld:1.12.2-+:universal"
deobfCompile "codechicken:CodeChickenLib:1.12.2-+:universal"
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"
deobfCompile "mekanism-tools:MekanismTools:1.12.2:9.4.13.349"
deobfCompile name: "appliedenergistics2", version: "rv6-stable-4", classifier: 'api', ext:"jar" //Required to fix odd crash with mekanism
}
@ -185,13 +123,6 @@ task deobfJar(type: Jar) {
jar {
exclude "**/*.psd"
classifier = 'universal'
// configurations.shade.each { dep ->
// from(project.zipTree(dep)){
// include 'ic2/api/'
// include 'forestry/api/fuels/'
// exclude 'META-INF', 'META-INF/**', '**/*.java'
// }
// }
manifest {
attributes 'FMLAT': 'techreborn_at.cfg'
}

View file

@ -26,22 +26,10 @@ package techreborn.compat;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.relauncher.Side;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.impl.ConfigRegistry;
import reborncore.common.registration.impl.ConfigRegistryFactory;
import techreborn.compat.buildcraft.BuildcraftBuildersCompat;
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;
import techreborn.compat.tinkers.CompatModuleTinkers;
import techreborn.lib.ModInfo;
import java.lang.annotation.Annotation;
@ -57,65 +45,11 @@ public class CompatManager {
public CompatManager() {
isIC2Loaded = Loader.isModLoaded("ic2");
isQuantumStorageLoaded = Loader.isModLoaded("quantumstorage");
register(CraftTweakerCompat.class, "crafttweaker");
register(CompatModuleTinkers.class, "tconstruct");
register(TheOneProbeCompat.class, "theoneprobe");
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<? extends ICompatModule> moduleClass, Object... objs) {
registerCompact(moduleClass, true, objs);
}
public void registerCompact(Class<? extends ICompatModule> moduleClass, boolean config, Object... objs) {
if(config){
if(!shouldLoad(moduleClass.getSimpleName())){
return;
}
}
for (Object obj : objs) {
if (obj instanceof String) {
String modid = (String) obj;
if (modid.startsWith("@")) {
if (modid.equals("@client")) {
if (FMLCommonHandler.instance().getSide() != Side.CLIENT) {
return;
}
}
} else if (modid.startsWith("!")) {
if (Loader.isModLoaded(modid.replaceAll("!", ""))) {
return;
}
} else {
if (!Loader.isModLoaded(modid)) {
return;
}
}
} else if (obj instanceof Boolean) {
Boolean boo = (Boolean) obj;
if (!boo) {
}
return;
}
}
try {
compatModules.add(moduleClass.newInstance());
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
//This is a hack, and is bad. Dont do this.
public boolean shouldLoad(String name){
ConfigRegistry configRegistry = new ConfigRegistry(){
public boolean checkConfig(String name) {
ConfigRegistry configRegistry = new ConfigRegistry() {
@Override
public Class<? extends Annotation> annotationType() {
return null;
@ -142,7 +76,7 @@ public class CompatManager {
}
};
RebornRegistry rebornRegistry = new RebornRegistry(){
RebornRegistry rebornRegistry = new RebornRegistry() {
@Override
public Class<? extends Annotation> annotationType() {
@ -163,6 +97,11 @@ public class CompatManager {
public boolean earlyReg() {
return false;
}
@Override
public String modOnly() {
return "";
}
};
Configuration configuration = ConfigRegistryFactory.getOrCreateConfig(configRegistry, rebornRegistry);
Property property = ConfigRegistryFactory.get(configRegistry.category(), configRegistry.key(), true, configRegistry.comment(), boolean.class, configuration);

View file

@ -0,0 +1,78 @@
/*
* 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;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLStateEvent;
import reborncore.RebornCore;
import reborncore.common.registration.IRegistryFactory;
import reborncore.common.registration.RebornRegistry;
import reborncore.common.registration.RegistryTarget;
import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.List;
@IRegistryFactory.RegistryFactory
public class CompatRegistryFactory implements IRegistryFactory {
@Override
public Class<? extends Annotation> getAnnotation() {
return RebornRegistry.class;
}
@Override
public void handleClass(Class clazz) {
if(isCompatModule(clazz)){
if(CompatManager.INSTANCE.checkConfig(clazz.getSimpleName())){
try {
ICompatModule compatModule = (ICompatModule) clazz.newInstance();
CompatManager.INSTANCE.compatModules.add(compatModule);
RebornCore.logHelper.info("Loaded module: " + compatModule.getClass().getSimpleName());
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException("Failed to register compat module", e);
}
}
}
}
private boolean isCompatModule(Class clazz){
for(Class iface : clazz.getInterfaces()){
if(iface == ICompatModule.class){
return true;
}
}
return false;
}
@Override
public List<RegistryTarget> getTargets() {
return Collections.singletonList(RegistryTarget.CLASS);
}
@Override
public Class<? extends FMLStateEvent> getProcessSate() {
return FMLPreInitializationEvent.class;
}
}

View file

@ -1,58 +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.buildcraft;
import buildcraft.builders.BCBuildersBlocks;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import reborncore.common.util.RebornCraftingHelper;
import reborncore.common.util.RecipeRemover;
import techreborn.Core;
import techreborn.compat.CompatConfigs;
import techreborn.compat.ICompatModule;
import techreborn.init.ModItems;
/**
* Created by Mark on 02/06/2017.
*/
public class BuildcraftBuildersCompat implements ICompatModule {
@Override
public void postInit(FMLPostInitializationEvent event) {
if (CompatConfigs.expensiveQuarry) {
RecipeRemover.removeAnyRecipe(new ItemStack(BCBuildersBlocks.quarry));
RebornCraftingHelper.addShapedOreRecipe(new ItemStack(BCBuildersBlocks.quarry),
"IAI", "GIG", "DED",
'I', "gearIron",
'G', "gearGold",
'D', "gearDiamond",
'A', "circuitAdvanced",
'E', new ItemStack(ModItems.DIAMOND_DRILL));
}
//The recipebook still knows about the old recipe so crashes, this should update it to have it replaced by the new recipe
Core.proxy.rebuildRecipeBook();
}
}

View file

@ -1,68 +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.buildcraft;
import buildcraft.api.fuels.IFuel;
import buildcraft.lib.fluid.FuelRegistry;
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.CompatConfigs;
import techreborn.compat.ICompatModule;
/**
* Created by Mark on 02/06/2017.
*/
public class BuildcraftCompat implements ICompatModule {
@Override
public void preInit(FMLPreInitializationEvent event) {
}
@Override
public void init(FMLInitializationEvent event) {
}
@Override
public void postInit(FMLPostInitializationEvent event) {
if (CompatConfigs.allowBCFuels) {
for (IFuel fuel : FuelRegistry.INSTANCE.getFuels()) {
// getPowerPerCycle returns micro mj values
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, fuel.getFluid().getFluid(), (int) (fuel.getPowerPerCycle() / RebornCoreConfig.euPerFU * 1000));
}
}
}
@Override
public void serverStarting(FMLServerStartingEvent event) {
}
}

View file

@ -1,75 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AlloySmelterRecipe;
/**
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100);
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100).setUseOreDict(false);
*/
@ZenClass("mods.techreborn.alloySmelter")
public class CTAlloySmelter extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick)")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.ALLOY_SMELTER_RECIPE;
}
}

View file

@ -1,71 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
@ZenClass("mods.techreborn.assemblingMachine")
public class CTAssemblingMachine extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.ASSEMBLING_MACHINE_RECIPE;
}
}

View file

@ -1,70 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
@ZenClass("mods.techreborn.blastFurnace")
public class CTBlastFurnace extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick, neededHeat);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.BLAST_FURNACE_RECIPE;
}
}

View file

@ -1,70 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.CentrifugeRecipe;
@ZenClass("mods.techreborn.centrifuge")
public class CTCentrifuge extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.CENTRIFUGE_RECIPE;
}
}

View file

@ -1,70 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
@ZenClass("mods.techreborn.chemicalReactorRecipe")
public class CTChemicalReactor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.CHEMICAL_REACTOR_RECIPE;
}
}

View file

@ -1,71 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.CompressorRecipe;
/*
* mods.techreborn.compressor.addRecipe(<minecraft:clay>,<minecraft:clay_ball>, 40,100);
*/
@ZenClass("mods.techreborn.compressor")
public class CTCompressor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
CompressorRecipe r = new CompressorRecipe(oInput1, CraftTweakerCompat.toStack(output1), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.COMPRESSOR_RECIPE;
}
}

View file

@ -1,75 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.DistillationTowerRecipe;
/**
* @author drcrazy
*
*/
@ZenClass("mods.techreborn.distillationTower")
public class CTDistillationTower extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
DistillationTowerRecipe r = new DistillationTowerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.DISTILLATION_TOWER_RECIPE;
}
}

View file

@ -1,72 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ExtractorRecipe;
/**
* mods.techreborn.extractor.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
*/
@ZenClass("mods.techreborn.extractor")
public class CTExtractor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
ExtractorRecipe r = new ExtractorRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.EXTRACTOR_RECIPE;
}
}

View file

@ -1,103 +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.crafttweaker;
import crafttweaker.api.liquid.ILiquidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
@ZenClass("mods.techreborn.fluidGen")
public class CTFluidGen {
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addThermalFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.THERMAL, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addGasFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.GAS, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addSemiFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.SEMIFLUID, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addDieselFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.DIESEL, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid, int energyPerMb")
public static void addPlasmaFluid(ILiquidStack fluid, int energyPerMb) {
addFluid(EFluidGenerator.PLASMA, fluid, energyPerMb);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeThermalFluid(ILiquidStack fluid) {
removeFluid(EFluidGenerator.THERMAL, fluid);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeGasFluid(ILiquidStack fluid) {
removeFluid(EFluidGenerator.GAS, fluid);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeSemiFluid(ILiquidStack fluid) {
removeFluid(EFluidGenerator.SEMIFLUID, fluid);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeDieselFluid(ILiquidStack fluid) {
removeFluid(EFluidGenerator.DIESEL, fluid);
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removePlasmaFluid(ILiquidStack fluid) {
removeFluid(EFluidGenerator.PLASMA, fluid);
}
private static void addFluid(EFluidGenerator type, ILiquidStack fluid, int energyPerMb) {
GeneratorRecipeHelper.registerFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid(), energyPerMb);
}
private static void removeFluid(EFluidGenerator type, ILiquidStack fluid) {
GeneratorRecipeHelper.removeFluidRecipe(type, CraftTweakerCompat.toFluidStack(fluid).getFluid());
}
}

View file

@ -1,60 +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.crafttweaker;
import crafttweaker.api.liquid.ILiquidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
import java.util.Optional;
/**
* @author drcrazy
*
*/
@ZenClass("mods.techreborn.fluidReplicator")
public class CTFluidReplicator {
@ZenMethod
@ZenDocumentation("int input, ILiquidStack output, int ticks, int euPerTick")
public static void addRecipe(int input, ILiquidStack output, int ticks, int euPerTick) {
if (input > 0 || ticks > 0 || euPerTick > 0) {
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(input,
CraftTweakerCompat.toFluidStack(output).getFluid(), ticks, euPerTick));
}
}
@ZenMethod
@ZenDocumentation("ILiquidStack fluid")
public static void removeRecipe(ILiquidStack output) {
Optional<FluidReplicatorRecipe> recipe = FluidReplicatorRecipeList
.getRecipeForFluid(CraftTweakerCompat.toFluidStack(output).getFluid());
if (recipe.isPresent()) {
FluidReplicatorRecipeList.removeRecipe(recipe.get());
}
}
}

View file

@ -1,182 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.IAction;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import net.minecraft.item.ItemStack;
import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.reactor.FusionReactorRecipe;
import techreborn.api.reactor.FusionReactorRecipeHelper;
import java.util.ArrayList;
import java.util.List;
@ZenClass("mods.techreborn.fusionReactor")
public class CTFusionReactor {
@ZenMethod
@ZenDocumentation("IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime")
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) CraftTweakerCompat.toObject(topInput), (ItemStack) CraftTweakerCompat.toObject(bottomInput), CraftTweakerCompat.toStack(output), startEU, euTick, tickTime);
CraftTweakerAPI.apply(new Add(reactorRecipe));
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeTopInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveTopInput(iIngredient));
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeBottomInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveBottomInput(iIngredient));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output)));
}
@ZenMethod
public static void removeAll() {
CraftTweakerAPI.apply(new RemoveAll());
}
private static class Add implements IAction {
private final FusionReactorRecipe recipe;
public Add(FusionReactorRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
FusionReactorRecipeHelper.registerRecipe(recipe);
}
@Override
public String describe() {
return "Adding Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
}
}
private static class Remove implements IAction {
private final ItemStack output;
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
public Remove(ItemStack output) {
this.output = output;
}
@Override
public void apply() {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
boolean matchNBT = output.hasTagCompound();
if (ItemUtils.isItemEqual(recipeType.getOutput(), output, true, matchNBT)) {
removedRecipes.add(recipeType);
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
break;
}
}
}
@Override
public String describe() {
return "Removing Fusion Reactor recipe for " + output.getDisplayName();
}
}
private static class RemoveTopInput implements IAction {
private final IIngredient output;
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
public RemoveTopInput(IIngredient output) {
this.output = output;
}
@Override
public void apply() {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getTopInput()))) {
removedRecipes.add(recipeType);
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
break;
}
}
}
@Override
public String describe() {
return "Removing Fusion Reactor recipe";
}
}
private static class RemoveBottomInput implements IAction {
private final IIngredient output;
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();
public RemoveBottomInput(IIngredient output) {
this.output = output;
}
@Override
public void apply() {
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
if (output.matches(CraftTweakerMC.getIItemStack(recipeType.getBottomInput()))) {
removedRecipes.add(recipeType);
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
break;
}
}
}
@Override
public String describe() {
return "Removing Fusion Reactor recipe";
}
}
private static class RemoveAll implements IAction {
@Override
public void apply() {
FusionReactorRecipeHelper.reactorRecipes.clear();
}
@Override
public String describe() {
return "Removing all Fusion Reactor recipes";
}
}
}

View file

@ -1,154 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.IAction;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.minecraft.CraftTweakerMC;
import net.minecraft.item.ItemStack;
import reborncore.api.recipe.IBaseRecipeType;
import reborncore.api.recipe.RecipeHandler;
import reborncore.common.util.ItemUtils;
import techreborn.api.recipe.BaseRecipe;
import java.util.ArrayList;
import java.util.List;
public class CTGeneric {
public static void addRecipe(BaseRecipe recipe) {
CraftTweakerAPI.apply(new Add(recipe));
}
private static class Add implements IAction {
private final BaseRecipe recipe;
public Add(BaseRecipe recipe) {
this.recipe = recipe;
}
@Override
public void apply() {
RecipeHandler.addRecipe(recipe);
}
@Override
public String describe() {
return "Adding " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
}
}
public static class Remove implements IAction {
private final ItemStack output;
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
private final String name;
public Remove(ItemStack output, String machineName) {
this.output = output;
this.name = machineName;
}
@Override
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
for (ItemStack stack : recipeType.getOutputs()) {
boolean matchNBT = output.hasTagCompound();
if (ItemUtils.isItemEqual(stack, output, true, matchNBT)) {
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public String describe() {
return "Removing " + name + " recipe for " + output.getDisplayName();
}
}
public static class RemoveInput implements IAction {
private final IIngredient ingredient;
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
private final String name;
public RemoveInput(IIngredient ingredient, String machineName) {
this.ingredient = ingredient;
this.name = machineName;
}
@Override
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
for (Object recipeInput : recipeType.getInputs()) {
ItemStack ingredientStack = CraftTweakerMC.getItemStack(ingredient);
if (!ingredientStack.isEmpty()) {
boolean matchNBT = ingredientStack.hasTagCompound();
if (ItemUtils.isInputEqual(recipeInput, ingredientStack, true, matchNBT, true)) {
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
//Old method of checking, just in case
} else if(recipeInput instanceof ItemStack && ingredient.matches(CraftTweakerMC.getIItemStack((ItemStack) recipeInput))){
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
break;
}
}
}
}
@Override
public String describe() {
return "Removing " + name + " recipe";
}
}
public static class RemoveAll implements IAction {
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
private final String name;
public RemoveAll(String machineName) {
this.name = machineName;
}
@Override
public void apply() {
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
removedRecipes.add((BaseRecipe) recipeType);
RecipeHandler.recipeList.remove(recipeType);
}
}
@Override
public String describe() {
return "Removing all recipes from " + name;
}
}
}

View file

@ -1,73 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.GrinderRecipe;
/**
* mods.techreborn.grinder.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, 20, 100);
*/
@ZenClass("mods.techreborn.grinder")
public class CTGrinder extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
GrinderRecipe r = new GrinderRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.GRINDER_RECIPE;
}
}

View file

@ -1,70 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
@ZenClass("mods.techreborn.implosionCompressor")
public class CTImplosionCompressor extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
Object oInput2 = CraftTweakerCompat.toObject(input2);
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.IMPLOSION_COMPRESSOR_RECIPE;
}
}

View file

@ -1,70 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
@ZenClass("mods.techreborn.industrialElectrolyzer")
public class CTIndustrialElectrolyzer extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(cells);
Object oInput2 = CraftTweakerCompat.toObject(input2);
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.INDUSTRIAL_ELECTROLYZER_RECIPE;
}
}

View file

@ -1,122 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.liquid.ILiquidStack;
import net.minecraftforge.fluids.FluidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.IndustrialGrinderRecipe;
/**
* Craftweaker class to change Industrial Grinder recipes.
*/
@ZenClass("mods.techreborn.industrialGrinder")
public class CTIndustrialGrinder extends CTGeneric {
/**
* Add recipe for Industrial Grinder
* @param output1 ItemStack First recipe output
* @param output2 ItemStack Second recipe output
* @param output3 ItemStack Third recipe output
* @param output4 ItemStack Fourth recipe output
* @param input1 First recipe input
* @param input2 Second recipe input. Not used )
* @param ticktime Amount of ticks to complete crafting
* @param euTick Amount of EU per tick consumed during crafting
* @return RecipeSettings RecipeSettings for this recipe
*/
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
}
/**
* Add recipe for Industrial Grinder
* @param output1 ItemStack First recipe output
* @param output2 ItemStack Second recipe output
* @param output3 ItemStack Third recipe output
* @param output4 ItemStack Fourth recipe output
* @param input1 First recipe input
* @param input2 Second recipe input. Not used )
* @param fluid LiquidStack Liquid used for grinding
* @param ticktime Amount of ticks to complete crafting
* @param euTick Amount of EU per tick consumed during crafting
* @return RecipeSettings RecipeSettings for this recipe
*/
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
// There is only one input slot in Industrial Grinder
//ItemStack oInput2 = (ItemStack) CraftTweakerCompat.toObject(input2);
FluidStack fluidStack = null;
if (fluid != null) {
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
}
IndustrialGrinderRecipe r = new IndustrialGrinderRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), CraftTweakerCompat.toStack(output4), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
/**
* Remove recipe for Industrial Grinder based on input ingredient
* @param iIngredient Recipe input for which we should remove recipe
*/
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) { CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName())); }
/**
* Remove recipe for Industrial Grinder based on output
* @param output Recipe output for which we should remove recipe
*/
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
/**
* Get reference machine name
* @return String Reference name for Industrial Grinder
*/
public static String getMachineName() {
return Reference.INDUSTRIAL_GRINDER_RECIPE;
}
}

View file

@ -1,94 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.liquid.ILiquidStack;
import net.minecraftforge.fluids.FluidStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
@ZenClass("mods.techreborn.industrialSawmill")
public class CTIndustrialSawmill extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, input1, fluid, ticktime, euTick, true);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick) {
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, true);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, int ticktime, int euTick, boolean useOreDic) {
return addRecipe(output1, output2, output3, input1, null, ticktime, euTick, useOreDic);
}
@ZenMethod
@ZenDocumentation("IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic")
public static RecipeSettings addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
Object oInput1 = CraftTweakerCompat.toObject(input1);
FluidStack fluidStack = null;
if (fluid != null) {
fluidStack = CraftTweakerCompat.toFluidStack(fluid);
}
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, fluidStack, CraftTweakerCompat.toStack(output1), CraftTweakerCompat.toStack(output2), CraftTweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.INDUSTRIAL_SAWMILL_RECIPE;
}
}

View file

@ -1,150 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.IAction;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import gnu.trove.set.TCharSet;
import gnu.trove.set.hash.TCharHashSet;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import reborncore.common.util.ItemUtils;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.RollingMachineRecipe;
import techreborn.api.TechRebornAPI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ZenClass("mods.techreborn.rollingMachine")
public class CTRollingMachine {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient[][] ingredients")
public static void addShaped(IItemStack output, IIngredient[][] ingredients) {
TechRebornAPI.addRollingOreMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toShapedObjects(ingredients));
}
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient[] ingredients")
public static void addShapeless(IItemStack output, IIngredient[] ingredients) {
TechRebornAPI.addShapelessOreRollingMachinceRecipe(RollingMachineRecipe.getNameForRecipe(CraftTweakerCompat.toStack(output)), CraftTweakerCompat.toStack(output), toObjects(ingredients));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
List<ResourceLocation> toRemove = new ArrayList<>();
for (Map.Entry<ResourceLocation, IRecipe> recipe : RollingMachineRecipe.instance.getRecipeList().entrySet()) {
if (ItemUtils.isItemEqual(recipe.getValue().getRecipeOutput(), CraftTweakerCompat.toStack(output), true, false)) {
toRemove.add(recipe.getKey());
}
}
for (ResourceLocation resourceLocation : toRemove) {
RollingMachineRecipe.instance.getRecipeList().remove(resourceLocation);
}
}
@ZenMethod
public static void removeAll() {
CraftTweakerAPI.apply(new RemoveAll());
}
private static class RemoveAll implements IAction{
@Override
public void apply() {
RollingMachineRecipe.instance.getRecipeList().clear();
}
@Override
public String describe() {
return "Removing all Rolling Machine recipes";
}
}
//Stolen from https://github.com/jaredlll08/MTLib/blob/1.12/src/main/java/com/blamejared/mtlib/helpers/InputHelper.java#L170-L213
//License as seen here: https://github.com/jaredlll08/MTLib/blob/1.12/LICENSE.md (MIT at time of writing)
public static Object[] toShapedObjects(IIngredient[][] ingredients) {
if (ingredients == null)
return null;
else {
ArrayList<Object> prep = new ArrayList<>();
TCharSet usedCharSet = new TCharHashSet();
prep.add("abc");
prep.add("def");
prep.add("ghi");
char[][] map = new char[][] { { 'a', 'b', 'c' }, { 'd', 'e', 'f' }, { 'g', 'h', 'i' } };
for (int x = 0; x < ingredients.length; x++) {
if (ingredients[x] != null) {
for (int y = 0; y < ingredients[x].length; y++) {
if (ingredients[x][y] != null && x < map.length && y < map[x].length) {
prep.add(map[x][y]);
usedCharSet.add(map[x][y]);
prep.add(CraftTweakerCompat.toObject(ingredients[x][y]));
}
}
}
}
for (int i = 0; i < 3; i++) {
StringBuilder sb = new StringBuilder();
if (prep.get(i) instanceof String) {
String s = (String) prep.get(i);
for (int j = 0; j < 3; j++) {
char c = s.charAt(j);
if (usedCharSet.contains(c)) {
sb.append(c);
} else {
sb.append(" ");
}
}
prep.set(i, sb.toString());
}
}
return prep.toArray();
}
}
public static Object[] toObjects(IIngredient[] ingredient) {
if (ingredient == null)
return null;
else {
Object[] output = new Object[ingredient.length];
for (int i = 0; i < ingredient.length; i++) {
if (ingredient[i] != null) {
output[i] = CraftTweakerCompat.toObject(ingredient[i]);
} else
output[i] = "";
}
return output;
}
}
}

View file

@ -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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.IAction;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.minecraft.CraftTweakerMC;
import reborncore.api.recipe.RecipeHandler;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.ScrapboxRecipe;
import techreborn.compat.crafttweaker.CTGeneric.Remove;
/**
* Created by Mark on 02/06/2017.
*/
@ZenClass("mods.techreborn.scrapbox")
public class CTScrapbox {
@ZenMethod
@ZenDocumentation("IIngredient input")
public static void addScrapboxDrop(IIngredient input) {
RecipeHandler.addRecipe(new ScrapboxRecipe(CraftTweakerMC.getItemStack(input), 20, 2));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll() {
CraftTweakerAPI.apply(new RemoveAll());
}
public static String getMachineName() {
return Reference.SCRAPBOX_RECIPE;
}
public static class RemoveAll implements IAction {
@Override
public void apply() {
RecipeHandler.recipeList.removeAll(RecipeHandler.getRecipeClassFromName(Reference.SCRAPBOX_RECIPE));
}
@Override
public String describe() {
return "Removing all Scrapbox recipies";
}
}
}

View file

@ -1,68 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.Reference;
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
@ZenClass("mods.techreborn.vacuumFreezer")
public class CTVacuumFreezer extends CTGeneric {
@ZenMethod
@ZenDocumentation("IItemStack output, IIngredient input, int ticktime, int euTick")
public static RecipeSettings addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
Object oInput1 = CraftTweakerCompat.toObject(input);
VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, CraftTweakerCompat.toStack(output), ticktime, euTick);
addRecipe(r);
return new RecipeSettings(r);
}
@ZenMethod
@ZenDocumentation("IIngredient iIngredient")
public static void removeInputRecipe(IIngredient iIngredient) {
CraftTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
}
@ZenMethod
@ZenDocumentation("IItemStack output")
public static void removeRecipe(IItemStack output) {
CraftTweakerAPI.apply(new Remove(CraftTweakerCompat.toStack(output), getMachineName()));
}
@ZenMethod
public static void removeAll(){
CraftTweakerAPI.apply(new RemoveAll(getMachineName()));
}
public static String getMachineName() {
return Reference.VACUUM_FREEZER_RECIPE;
}
}

View file

@ -1,93 +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.crafttweaker;
import crafttweaker.CraftTweakerAPI;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import crafttweaker.api.item.IngredientStack;
import crafttweaker.api.liquid.ILiquidStack;
import crafttweaker.api.oredict.IOreDictEntry;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.relauncher.ReflectionHelper;
import techreborn.compat.ICompatModule;
import static crafttweaker.api.minecraft.CraftTweakerMC.getItemStack;
import static crafttweaker.api.minecraft.CraftTweakerMC.getLiquidStack;
public class CraftTweakerCompat implements ICompatModule {
public static ItemStack toStack(IItemStack iStack) {
if (iStack == null){
return null;
}
return getItemStack(iStack);
}
public static Object toObject(IIngredient iStack) {
if (iStack == null)
return null;
else {
if (iStack instanceof IOreDictEntry)
return ((IOreDictEntry) iStack).getName();
else if (iStack instanceof IItemStack)
return getItemStack((IItemStack) iStack);
else if (iStack instanceof IngredientStack) {
IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
return toObject(ingr);
} else
return null;
}
}
public static FluidStack toFluidStack(ILiquidStack iStack) {
return getLiquidStack(iStack);
}
@Override
public void preInit(FMLPreInitializationEvent event) {
CraftTweakerAPI.registerClass(CTAlloySmelter.class);
CraftTweakerAPI.registerClass(CTAssemblingMachine.class);
CraftTweakerAPI.registerClass(CTBlastFurnace.class);
CraftTweakerAPI.registerClass(CTCentrifuge.class);
CraftTweakerAPI.registerClass(CTChemicalReactor.class);
CraftTweakerAPI.registerClass(CTCompressor.class);
CraftTweakerAPI.registerClass(CTIndustrialGrinder.class);
CraftTweakerAPI.registerClass(CTImplosionCompressor.class);
CraftTweakerAPI.registerClass(CTIndustrialElectrolyzer.class);
CraftTweakerAPI.registerClass(CTIndustrialSawmill.class);
CraftTweakerAPI.registerClass(CTFusionReactor.class);
CraftTweakerAPI.registerClass(CTVacuumFreezer.class);
CraftTweakerAPI.registerClass(CTFluidGen.class);
CraftTweakerAPI.registerClass(CTRollingMachine.class);
CraftTweakerAPI.registerClass(CTScrapbox.class);
CraftTweakerAPI.registerClass(CTDistillationTower.class);
CraftTweakerAPI.registerClass(CTGrinder.class);
CraftTweakerAPI.registerClass(CTExtractor.class);
CraftTweakerAPI.registerClass(CTFluidReplicator.class);
}
}

View file

@ -1,45 +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.crafttweaker;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import techreborn.api.recipe.BaseRecipe;
@ZenClass("mods.techreborn.RecipeSettings")
public class RecipeSettings {
private BaseRecipe baseRecipe;
public RecipeSettings(BaseRecipe baseRecipe) {
this.baseRecipe = baseRecipe;
}
@ZenMethod
@ZenDocumentation("boolean useOreDict")
public void setUseOreDict(boolean useOreDict){
baseRecipe.setOreDict(useOreDict);
}
}

View file

@ -1,41 +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.crafttweaker;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This is used to give better detail for a method's parameters when generating the crafttweaker documentation.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ZenDocumentation {
String value();
}

View file

@ -34,6 +34,7 @@ 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.recipe.machines.CompressorRecipe;
import techreborn.api.recipe.machines.ExtractorRecipe;
@ -43,6 +44,7 @@ import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.init.recipes.RecipeMethods;
import techreborn.items.ingredients.ItemParts;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.List;
@ -50,6 +52,7 @@ import java.util.List;
/**
* Created by Mark on 06/06/2016.
*/
@RebornRegistry(modOnly = "ic2", modID = ModInfo.MOD_ID)
public class RecipesIC2 implements ICompatModule {
List<RecipeDuplicate> recipeDuplicateList = new ArrayList<>();

View file

@ -1,63 +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.immersiveengineering;
import blusunrize.immersiveengineering.common.IEContent;
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.fml.common.event.FMLServerStartingEvent;
import reborncore.api.recipe.RecipeHandler;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.api.recipe.machines.CompressorRecipe;
import techreborn.compat.ICompatModule;
public class RecipeImmersiveEngineering implements ICompatModule {
@Override
public void preInit(FMLPreInitializationEvent event) {
}
@Override
public void init(FMLInitializationEvent event) {
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, IEContent.fluidCreosote, 40);
// dust_coke to dust_hop_graphite
RecipeHandler.addRecipe(new CompressorRecipe(new ItemStack(IEContent.itemMaterial, 8, 17),
new ItemStack(IEContent.itemMaterial, 1, 18), 300, 4));
}
@Override
public void postInit(FMLPostInitializationEvent event) {
}
@Override
public void serverStarting(FMLServerStartingEvent event) {
}
}

View file

@ -1,47 +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.mekanism;
import mekanism.api.gas.GasRegistry;
import mekanism.common.FuelHandler;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import reborncore.common.RebornCoreConfig;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.compat.ICompatModule;
public class MekanismCompat implements ICompatModule {
@Override
public void postInit(FMLPostInitializationEvent event) {
GasRegistry.getRegisteredGasses().stream().filter(gas -> FuelHandler.getFuel(gas) != null).forEach(gas -> {
FuelHandler.FuelGas fuel = FuelHandler.getFuel(gas);
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.GAS, gas.getFluid(), (int) fuel.energyPerTick / RebornCoreConfig.euPerFU);
});
}
}

View file

@ -1,38 +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.opencomputers;
import li.cil.oc.api.Driver;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import techreborn.compat.ICompatModule;
public class CompatOpenComputers implements ICompatModule {
@Override
public void init(FMLInitializationEvent event) {
Driver.add(new DriverMachine());
}
}

View file

@ -1,153 +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.opencomputers;
import li.cil.oc.api.Network;
import li.cil.oc.api.driver.DriverBlock;
import li.cil.oc.api.driver.NamedBlock;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.ManagedEnvironment;
import li.cil.oc.api.network.Visibility;
import li.cil.oc.api.prefab.AbstractManagedEnvironment;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.recipe.IRecipeCrafterProvider;
import reborncore.api.tile.IUpgradeable;
import reborncore.common.powerSystem.TilePowerAcceptor;
import java.util.Arrays;
import java.util.function.IntFunction;
public class DriverMachine implements DriverBlock {
@Override
public boolean worksWith(World world, BlockPos blockPos, EnumFacing enumFacing) {
return world.getTileEntity(blockPos) instanceof TilePowerAcceptor;
}
@Override
public ManagedEnvironment createEnvironment(World world, BlockPos blockPos, EnumFacing enumFacing) {
return new MachineEnvironment((TilePowerAcceptor) world.getTileEntity(blockPos));
}
public static class MachineEnvironment extends AbstractManagedEnvironment implements NamedBlock {
TilePowerAcceptor machine;
public MachineEnvironment(TilePowerAcceptor machine) {
this.machine = machine;
setNode(Network.newNode(this, Visibility.Network).withComponent("tr_machine", Visibility.Network).create());
}
@Callback(value = "getTeir", getter = true, doc = "Gets the current teir of the machine, this changes with upgrades")
public Object[] getTeir(Context context, Arguments arguments) throws Exception {
return getObjects(machine.getTier().name());
}
@Callback(value = "getEnergy", getter = true, doc = "Gets the currentally stored energy of the machine. in EU")
public Object[] getEnergy(Context context, Arguments arguments) throws Exception {
return getObjects(machine.getEnergy());
}
@Callback(value = "getMaxPower", getter = true, doc = "Gets the maximum energy that can be stored in the machine. in EU")
public Object[] getMaxPower(Context context, Arguments arguments) throws Exception {
return getObjects(machine.getMaxPower());
}
@Callback(value = "getMaxInput", getter = true, doc = "Gets the maximum energy that can be inputted in to the machine. in EU")
public Object[] getMaxInput(Context context, Arguments arguments) throws Exception {
return getObjects(machine.getMaxInput());
}
@Callback(value = "getMaxOutput", getter = true, doc = "Gets the maximum energy that can be extracted from the machine. in EU")
public Object[] getMaxOutput(Context context, Arguments arguments) throws Exception {
return getObjects(machine.getMaxOutput());
}
@Callback(value = "canBeUprgraded", getter = true, doc = "Returns true if the machine can be upgraded")
public Object[] canBeUprgraded(Context context, Arguments arguments) throws Exception {
return getObjects(machine instanceof IUpgradeable && machine.canBeUpgraded());
}
@Callback(value = "hasRecipeCrafter", getter = true, doc = "Returns true if the machine has a recipe crafter")
public Object[] hasRecipeCrafter(Context context, Arguments arguments) throws Exception{
return getObjects(machine instanceof IRecipeCrafterProvider);
}
@Callback(value = "getRecipeName", getter = true, doc = "Gets the name of the recipe that the machine crafts")
public Object[] getRecipeName(Context context, Arguments arguments) throws Exception{
if(!(machine instanceof IRecipeCrafterProvider)){
return null;
}
return getObjects(((IRecipeCrafterProvider) machine).getRecipeCrafter().recipeName);
}
@Callback(value = "getInputSlots", getter = true, doc = "Gets the slot ids that the crafter uses to look for inputs")
public Object[] getInputSlots(Context context, Arguments arguments) throws Exception{
if(!(machine instanceof IRecipeCrafterProvider)){
return null;
}
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().inputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
}
@Callback(value = "getOutputSlots", getter = true, doc = "Gets the slot ids that the crafter uses for outputs")
public Object[] getOutputSlots(Context context, Arguments arguments) throws Exception{
if(!(machine instanceof IRecipeCrafterProvider)){
return null;
}
return Arrays.stream(((IRecipeCrafterProvider) machine).getRecipeCrafter().outputSlots).mapToObj((IntFunction<Object>) value -> value).toArray();
}
@Callback(value = "isActive", getter = true, doc = "Returns a boolean if the machine is actice")
public Object[] isActive(Context context, Arguments arguments) throws Exception{
return getObjects(machine.isActive());
}
@Callback(value = "getFacing", getter = true, doc = "Gets the facing for the machine")
public Object[] getFacing(Context context, Arguments arguments) throws Exception{
EnumFacing facing = machine.getFacing();
if(facing == null){
return null;
}
return getObjects(facing.getName());
}
private Object[] getObjects(Object... objects){
return objects;
}
@Override
public String preferredName() {
return "tr_machine";
}
@Override
public int priority() {
return 10;
}
}
}

View file

@ -1,54 +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.theoneprobe;
import mcjty.theoneprobe.api.IProbeConfig;
import mcjty.theoneprobe.api.IProbeConfigProvider;
import mcjty.theoneprobe.api.IProbeHitData;
import mcjty.theoneprobe.api.IProbeHitEntityData;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.common.powerSystem.TilePowerAcceptor;
/**
* Created by Mark on 04/06/2016.
*/
public class ProbeConfig implements IProbeConfigProvider {
@Override
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, Entity entity, IProbeHitEntityData data) {
}
@Override
public void getProbeConfig(IProbeConfig config, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
TileEntity tile = world.getTileEntity(data.getPos());
if (tile instanceof TilePowerAcceptor) {
config.setRFMode(0);
}
}
}

View file

@ -1,130 +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.theoneprobe;
import mcjty.theoneprobe.api.*;
import mcjty.theoneprobe.apiimpl.providers.ChestInfoTools;
import mcjty.theoneprobe.apiimpl.styles.ProgressStyle;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.IListInfoProvider;
import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.common.RebornCoreConfig;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.tile.TileLegacyMachineBase;
import reborncore.common.util.Inventory;
import reborncore.common.util.StringUtils;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created by Mark on 04/06/2016.
*/
public class ProbeProvider implements IProbeInfoProvider {
ProgressStyle euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
MethodHandle methodHandle_addStacks;
public ProbeProvider() {
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
euStyle.numberFormat(NumberFormat.COMMAS);
try {
//Can we just all agree to make things that might be useful to others public, thanks.
MethodHandles.Lookup lookup = MethodHandles.lookup();
Method pm = ChestInfoTools.class.getDeclaredMethod("showChestContents", IProbeInfo.class, World.class, BlockPos.class, List.class, boolean.class);
pm.setAccessible(true);
methodHandle_addStacks = lookup.unreflect(pm);
} catch (NoSuchMethodException | IllegalAccessException e) {
e.printStackTrace();
}
}
@Override
public String getID() {
return "TechReborn";
}
@Override
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
euStyle = new ProgressStyle().backgroundColor(0xFF8B8B8B).borderColor(0xFF373737).alternateFilledColor(PowerSystem.getDisplayPower().altColour).filledColor(PowerSystem.getDisplayPower().colour);
euStyle.suffix(" " + PowerSystem.getDisplayPower().abbreviation);
TileEntity tile = world.getTileEntity(data.getPos());
if (tile instanceof IListInfoProvider) {
List<String> strs = new ArrayList<>();
((IListInfoProvider) tile).addInfo(strs, true);
for (String string : strs) {
probeInfo.text(string);
}
}
if (tile instanceof IEnergyInterfaceTile) {
IEnergyInterfaceTile energy = (IEnergyInterfaceTile) tile;
if (PowerSystem.getDisplayPower() != PowerSystem.EnergySystem.EU) {
probeInfo.progress((int) energy.getEnergy() * RebornCoreConfig.euPerFU, (int) energy.getMaxPower() * RebornCoreConfig.euPerFU, euStyle);
} else {
probeInfo.progress((int) energy.getEnergy(), (int) energy.getMaxPower(), euStyle);
}
}
if (tile instanceof TileLegacyMachineBase && methodHandle_addStacks != null) {
TileLegacyMachineBase legacyMachineBase = (TileLegacyMachineBase) tile;
if (legacyMachineBase.getInventoryForTile().isPresent()) {
if (player.isSneaking()) {
probeInfo.text(StringUtils.t("techreborn.tooltip.inventory"));
}
Inventory inventory = legacyMachineBase.getInventoryForTile().get();
if(!inventory.isEmpty()){
List<ItemStack> stacks = Arrays.stream(inventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
try {
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}
if (!legacyMachineBase.upgradeInventory.isEmpty() && player.isSneaking()) {
probeInfo.horizontal();
probeInfo.text(StringUtils.t("techreborn.tooltip.upgrades"));
List<ItemStack> stacks = Arrays.stream(legacyMachineBase.upgradeInventory.contents).filter(stack -> !stack.isEmpty()).collect(Collectors.toList());
try {
methodHandle_addStacks.invoke(probeInfo, world, null, stacks, player.isSneaking());
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}
}
}

View file

@ -1,46 +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.theoneprobe;
import mcjty.theoneprobe.TheOneProbe;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import techreborn.compat.ICompatModule;
import static techreborn.compat.CompatConfigs.enableTOP;
/**
* Created by Mark on 04/06/2016.
*/
public class TheOneProbeCompat implements ICompatModule {
@Override
public void postInit(FMLPostInitializationEvent event) {
if (enableTOP) {
TheOneProbe.theOneProbeImp.registerProvider(new ProbeProvider());
TheOneProbe.theOneProbeImp.registerProbeConfigProvider(new ProbeConfig());
}
}
}

View file

@ -1,82 +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.thermalexpansion;
import cofh.api.util.ThermalExpansionHelper;
import cofh.thermalfoundation.init.TFFluids;
import cofh.thermalfoundation.item.ItemMaterial;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import techreborn.api.fluidreplicator.FluidReplicatorRecipe;
import techreborn.api.fluidreplicator.FluidReplicatorRecipeList;
import techreborn.api.generator.EFluidGenerator;
import techreborn.api.generator.GeneratorRecipeHelper;
import techreborn.compat.ICompatModule;
import techreborn.init.ModItems;
import techreborn.init.recipes.RecipeMethods;
import techreborn.items.ingredients.ItemDusts;
import techreborn.items.ingredients.ItemPlates;
/**
* Created by modmuss50 on 06/07/2017.
*/
public class RecipeThermalExpansion implements ICompatModule {
@Override
public void init(FMLInitializationEvent event) {
ThermalExpansionHelper.addPulverizerRecipe(2000, new ItemStack(Items.ENDER_PEARL), RecipeMethods.getMaterial("ender_pearl", 1, RecipeMethods.Type.DUST));
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.ENDER_EYE), RecipeMethods.getMaterial("ender_eye", 2, RecipeMethods.Type.DUST));
ThermalExpansionHelper.addPulverizerRecipe(3000, new ItemStack(Items.FLINT), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.SMALL_DUST), RecipeMethods.getMaterial("flint", 2, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(ModItems.CELL), RecipeMethods.getMaterial("tin", 4, RecipeMethods.Type.SMALL_DUST));
ThermalExpansionHelper.addPulverizerRecipe(2500, new ItemStack(Blocks.END_STONE), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("endstone", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("galena", 1, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sulfur", 1, RecipeMethods.Type.DUST), 50);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("ruby", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("ruby", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("red_garnet", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sapphire", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sapphire", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("bauxite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("bauxite", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("pyrite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("pyrite", 5, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("iron", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("cinnabar", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("cinnabar", 3, RecipeMethods.Type.DUST), new ItemStack(Items.REDSTONE), 10);
ThermalExpansionHelper.addPulverizerRecipe(4000, RecipeMethods.getMaterial("sphalerite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sphalerite", 4, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("zinc", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial("tungsten", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("tungsten", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("manganese", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("peridot", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("peridot", 2, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("emerald", 1, RecipeMethods.Type.DUST), 10);
ThermalExpansionHelper.addPulverizerRecipe(3000, RecipeMethods.getMaterial("sodalite", 1, RecipeMethods.Type.ORE), RecipeMethods.getMaterial("sodalite", 12, RecipeMethods.Type.DUST), RecipeMethods.getMaterial("aluminum", 1, RecipeMethods.Type.DUST), 10);
for(String plate : ItemPlates.types){
if(!plate.equals(ModItems.META_PLACEHOLDER) && ItemDusts.hasDust(plate)){
ThermalExpansionHelper.addPulverizerRecipe(5000, RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.PLATE), RecipeMethods.getMaterial(plate, 1, RecipeMethods.Type.DUST));
}
}
ThermalExpansionHelper.addSmelterRecipe(4000, new ItemStack(Items.IRON_INGOT, 2), new ItemStack(Blocks.SAND), RecipeMethods.getMaterial("refined_iron", 2, RecipeMethods.Type.INGOT), ItemMaterial.crystalSlag.copy(), 25);
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.THERMAL, TFFluids.fluidPyrotheum, 80);
GeneratorRecipeHelper.registerFluidRecipe(EFluidGenerator.SEMIFLUID, TFFluids.fluidCreosote, 40);
FluidReplicatorRecipeList.addRecipe(new FluidReplicatorRecipe(4, TFFluids.fluidCoal, 100, 20));
}
}

View file

@ -1,62 +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.tinkers;
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;
/**
* @author Prospector on 08/05/16
*/
public class CompatModuleTinkers implements ICompatModule {
public CompatModuleTinkers() {
super();
}
@Override
public void preInit(FMLPreInitializationEvent event) {
// TinkersFluids.init();
}
@Override
public void init(FMLInitializationEvent event) {
}
@Override
public void postInit(FMLPostInitializationEvent event) {
}
@Override
public void serverStarting(FMLServerStartingEvent event) {
}
}

View file

@ -1,95 +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.tinkers;
//
//import net.minecraft.item.EnumRarity;
//import net.minecraft.nbt.NBTTagCompound;
//import net.minecraft.nbt.NBTTagList;
//import net.minecraft.util.ResourceLocation;
//import net.minecraftforge.fluids.Fluid;
//import net.minecraftforge.fluids.FluidRegistry;
//import net.minecraftforge.fml.common.event.FMLInterModComms;
//import slimeknights.tconstruct.library.fluid.FluidMolten;
//
///**
// * @author Prospector on 08/05/16
// */
//public class TinkersFluids {
// private static ResourceLocation moltenMetal = new ResourceLocation("tconstruct:blocks/fluids/molten_metal");
// private static ResourceLocation moltenMetalFlowing = new ResourceLocation(
// "tconstruct:blocks/fluids/molten_metal_flow");
//
// public static FluidMolten moltenChrome = new FluidMolten("chrome", 0x90C9C9, moltenMetal, moltenMetalFlowing);
// public static FluidMolten moltenInvar = new FluidMolten("invar", 0x7F907F, moltenMetal, moltenMetalFlowing);
// public static FluidMolten moltenIridium = new FluidMolten("iridium", 0xFFFFFF, moltenMetal, moltenMetalFlowing);
// public static FluidMolten moltenPlatinum = new FluidMolten("platinum", 0x34BFBF, moltenMetal, moltenMetalFlowing);
// public static FluidMolten moltenTitanium = new FluidMolten("titanium", 0x3C372F, moltenMetal, moltenMetalFlowing);
// public static FluidMolten moltenTungsten = new FluidMolten("tungsten", 0x3A464F, moltenMetal, moltenMetalFlowing);
//
// public static void init() {
// addFluidStuff(moltenChrome, "Chrome");
// moltenChrome.setTemperature(800);
// addFluidStuff(moltenInvar, "Invar");
// moltenInvar.setTemperature(580);
// addFluidStuff(moltenIridium, "Iridium");
// moltenIridium.setTemperature(4000);
// moltenIridium.setRarity(EnumRarity.EPIC);
// addFluidStuff(moltenPlatinum, "Platinum");
// moltenPlatinum.setTemperature(900);
// addFluidStuff(moltenTitanium, "Titanium");
// moltenTitanium.setTemperature(1000);
// addFluidStuff(moltenTungsten, "Tungsten");
// moltenTungsten.setTemperature(1200);
//
// //Invar Alloying
// NBTTagList tagList = new NBTTagList();
// NBTTagCompound fluid = new NBTTagCompound();
// fluid.setString("FluidName", "invar");
// fluid.setInteger("Amount", 144);
// tagList.appendTag(fluid);
// fluid = new NBTTagCompound();
// fluid.setString("FluidName", "iron");
// fluid.setInteger("Amount", 96);
// tagList.appendTag(fluid);
// fluid = new NBTTagCompound();
// fluid.setString("FluidName", "nickel");
// fluid.setInteger("Amount", 48);
// tagList.appendTag(fluid);
//
// NBTTagCompound message = new NBTTagCompound();
// message.setTag("alloy", tagList);
// FMLInterModComms.sendMessage("tconstruct", "alloy", message);
// }
//
// public static void addFluidStuff(Fluid fluid, String oreSuffix) {
// FluidRegistry.registerFluid(fluid);
// FluidRegistry.addBucketForFluid(fluid);
// NBTTagCompound tag = new NBTTagCompound();
// tag.setString("fluid", fluid.getName());
// tag.setString("ore", oreSuffix);
// tag.setBoolean("toolforge", true);
// FMLInterModComms.sendMessage("tconstruct", "integrateSmeltery", tag);
// }
//}

View file

@ -1,39 +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.waila;
import mcp.mobius.waila.api.IWailaPlugin;
import mcp.mobius.waila.api.IWailaRegistrar;
import mcp.mobius.waila.api.WailaPlugin;
import reborncore.common.BaseTileBlock;
@WailaPlugin
public class CompatModuleWaila implements IWailaPlugin {
@Override
public void register(IWailaRegistrar registrar) {
registrar.registerBodyProvider(new WailaProviderMachines(), BaseTileBlock.class);
}
}

View file

@ -1,72 +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.waila;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
import mcp.mobius.waila.api.IWailaDataProvider;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import reborncore.api.IListInfoProvider;
import java.util.List;
public class WailaProviderMachines implements IWailaDataProvider {
@Override
public List<String> getWailaBody(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
if (accessor.getTileEntity() instanceof IListInfoProvider) {
((IListInfoProvider) accessor.getTileEntity()).addInfo(tip, true);
}
return tip;
}
@Override
public List<String> getWailaHead(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
return tip;
}
@Override
public List<String> getWailaTail(ItemStack item, List<String> tip, IWailaDataAccessor accessor,
IWailaConfigHandler config) {
return tip;
}
@Override
public ItemStack getWailaStack(IWailaDataAccessor accessor, IWailaConfigHandler config) {
return ItemStack.EMPTY;
}
@Override
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te, NBTTagCompound tag, World w, BlockPos pos) {
return tag;
}
}