2731
This commit is contained in:
parent
fa9cd98b5a
commit
abb9b5102f
65 changed files with 0 additions and 0 deletions
86
ToAddBack/compat/CompatManager.java
Normal file
86
ToAddBack/compat/CompatManager.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
package techreborn.compat;
|
||||
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import ic2.api.info.IC2Classic;
|
||||
import techreborn.compat.ee3.EmcValues;
|
||||
import techreborn.compat.minetweaker.MinetweakerCompat;
|
||||
import techreborn.compat.recipes.*;
|
||||
import techreborn.compat.waila.CompatModuleWaila;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CompatManager {
|
||||
|
||||
public ArrayList<ICompatModule> compatModules = new ArrayList<ICompatModule>();
|
||||
|
||||
public static CompatManager INSTANCE = new CompatManager();
|
||||
|
||||
public static boolean isIC2Loaded = false;
|
||||
public static boolean isIC2ClassicLoaded = false;
|
||||
public static boolean isClassicEnet = false;
|
||||
public static boolean isGregTechLoaded = false;
|
||||
|
||||
public CompatManager() {
|
||||
isIC2Loaded = Loader.isModLoaded("IC2");
|
||||
isIC2ClassicLoaded = IC2Classic.isIc2ClassicLoaded();
|
||||
if(isIC2ClassicLoaded){
|
||||
isClassicEnet = true;
|
||||
}
|
||||
if(Loader.isModLoaded("Uncomplication")){
|
||||
isClassicEnet = true;
|
||||
}
|
||||
if(Loader.isModLoaded("gregtech")){
|
||||
isGregTechLoaded = true;
|
||||
}
|
||||
|
||||
registerCompact(CompatModuleWaila.class, "Waila");
|
||||
registerCompact(RecipesIC2.class, "IC2");
|
||||
registerCompact(RecipesBuildcraft.class, "BuildCraft|Core", "IC2");
|
||||
registerCompact(RecipesThermalExpansion.class, "ThermalExpansion");
|
||||
registerCompact(EmcValues.class, "EE3");
|
||||
registerCompact(RecipesNatura.class, "Natura");
|
||||
registerCompact(RecipesBiomesOPlenty.class, "BiomesOPlenty");
|
||||
registerCompact(RecipesThaumcraft.class, "Thaumcraft");
|
||||
registerCompact(RecipesForestry.class, "Forestry", isForestry4());
|
||||
registerCompact(MinetweakerCompat.class, "MineTweaker3");
|
||||
}
|
||||
|
||||
public void registerCompact(Class<?> moduleClass, Object... objs) {
|
||||
for (Object obj : objs) {
|
||||
if (obj instanceof String) {
|
||||
String modid = (String) obj;
|
||||
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 == false) {
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
compatModules.add((ICompatModule) moduleClass.newInstance());
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isForestry4() {
|
||||
try {
|
||||
Class.forName("forestry.api.arboriculture.EnumWoodType");
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
17
ToAddBack/compat/ICompatModule.java
Normal file
17
ToAddBack/compat/ICompatModule.java
Normal file
|
@ -0,0 +1,17 @@
|
|||
package techreborn.compat;
|
||||
|
||||
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;
|
||||
|
||||
public interface ICompatModule {
|
||||
|
||||
public void preInit(FMLPreInitializationEvent event);
|
||||
|
||||
public void init(FMLInitializationEvent event);
|
||||
|
||||
public void postInit(FMLPostInitializationEvent event);
|
||||
|
||||
public void serverStarting(FMLServerStartingEvent event);
|
||||
}
|
4
ToAddBack/compat/ee3/CommandCustomLoad.java
Normal file
4
ToAddBack/compat/ee3/CommandCustomLoad.java
Normal file
|
@ -0,0 +1,4 @@
|
|||
package techreborn.compat.ee3;
|
||||
|
||||
public class CommandCustomLoad {
|
||||
}
|
59
ToAddBack/compat/ee3/CommandRegen.java
Normal file
59
ToAddBack/compat/ee3/CommandRegen.java
Normal file
|
@ -0,0 +1,59 @@
|
|||
package techreborn.compat.ee3;
|
||||
|
||||
import com.pahimar.ee3.command.CommandSyncEnergyValues;
|
||||
import com.pahimar.ee3.exchange.DynamicEnergyValueInitThread;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.reference.Reference;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CommandRegen extends CommandBase {
|
||||
|
||||
public static final String EE3_ENERGYVALUES_DIR =
|
||||
FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld().getSaveHandler().getWorldDirectory()
|
||||
+ File.separator + "data" + File.separator
|
||||
+ Reference.LOWERCASE_MOD_ID + File.separator
|
||||
+ "energyvalues";
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "eeregen";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRequiredPermissionLevel() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender commandSender) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender commandSender, String[] args) {
|
||||
commandSender.addChatMessage(new ChatComponentText("Regening EMC Values..."));
|
||||
File energyValuesDirectory = new File(EE3_ENERGYVALUES_DIR);
|
||||
|
||||
if (energyValuesDirectory.exists() && energyValuesDirectory.isDirectory()) {
|
||||
File[] files = energyValuesDirectory.listFiles();
|
||||
for (File f : files) {
|
||||
if (f.getName().toLowerCase().contains(".gz")) {
|
||||
f.delete();
|
||||
commandSender.addChatMessage(new ChatComponentText("Deleted " + f.getName()));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
commandSender.addChatMessage(new ChatComponentText("Regening EMC Values"));
|
||||
DynamicEnergyValueInitThread.initEnergyValueRegistry();
|
||||
EnergyValueRegistry.getInstance().setShouldRegenNextRestart(false);
|
||||
EnergyValueRegistry.getInstance().save();
|
||||
commandSender.addChatMessage(new ChatComponentText("Syncing all EMC Values"));
|
||||
new CommandSyncEnergyValues().processCommand(commandSender, args);
|
||||
}
|
||||
}
|
54
ToAddBack/compat/ee3/CommandReload.java
Normal file
54
ToAddBack/compat/ee3/CommandReload.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
package techreborn.compat.ee3;
|
||||
|
||||
import com.pahimar.ee3.exchange.DynamicEnergyValueInitThread;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.reference.Files;
|
||||
import com.pahimar.ee3.reference.Reference;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraft.command.CommandBase;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CommandReload extends CommandBase {
|
||||
|
||||
public static final String EE3_ENERGYVALUES_DIR =
|
||||
FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld().getSaveHandler().getWorldDirectory()
|
||||
+ File.separator + "data" + File.separator
|
||||
+ Reference.LOWERCASE_MOD_ID + File.separator
|
||||
+ "energyvalues";
|
||||
|
||||
@Override
|
||||
public String getCommandName() {
|
||||
return "eerelaod";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRequiredPermissionLevel() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommandUsage(ICommandSender commandSender) {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processCommand(ICommandSender commandSender, String[] args) {
|
||||
commandSender.addChatMessage(new ChatComponentText("Reloading EMC Values..."));
|
||||
File energyValuesDirectory = new File(EE3_ENERGYVALUES_DIR);
|
||||
|
||||
if (energyValuesDirectory.exists() && energyValuesDirectory.isDirectory()) {
|
||||
File staticValues = new File(energyValuesDirectory, Files.STATIC_ENERGY_VALUES_JSON);
|
||||
commandSender.addChatMessage(new ChatComponentText("Looking for " + staticValues.getName()));
|
||||
if (staticValues.exists()) {
|
||||
commandSender.addChatMessage(new ChatComponentText("Found static values, reloading from disk!"));
|
||||
} else {
|
||||
commandSender.addChatMessage(new ChatComponentText("Will now recompute all values!!"));
|
||||
}
|
||||
}
|
||||
DynamicEnergyValueInitThread.initEnergyValueRegistry();
|
||||
EnergyValueRegistry.getInstance().setShouldRegenNextRestart(false);
|
||||
}
|
||||
}
|
94
ToAddBack/compat/ee3/EmcValues.java
Normal file
94
ToAddBack/compat/ee3/EmcValues.java
Normal file
|
@ -0,0 +1,94 @@
|
|||
package techreborn.compat.ee3;
|
||||
|
||||
import com.pahimar.ee3.api.exchange.EnergyValue;
|
||||
import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||
import com.pahimar.ee3.exchange.EnergyValueRegistry;
|
||||
import com.pahimar.ee3.exchange.OreStack;
|
||||
import com.pahimar.ee3.exchange.WrappedStack;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.items.ItemParts;
|
||||
import techreborn.items.ItemPlates;
|
||||
|
||||
public class EmcValues implements ICompatModule {
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.recipeList) {
|
||||
if (recipeType.getOutputsSize() == 1) {
|
||||
RecipeRegistryProxy.addRecipe(recipeType.getOutput(0), recipeType.getInputs());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (!Loader.isModLoaded("EE3Compatibility")) {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
addOre("ingotCopper", 128);
|
||||
addOre("ingotSilver", 1024);
|
||||
addOre("ingotTin", 256);
|
||||
addOre("ingotLead", 256);
|
||||
addOre("dustSteel", 512);
|
||||
addOre("ingotRefinedIron", 512);
|
||||
addOre("dustCoal", 32);
|
||||
addOre("dustDiamond", 8192);
|
||||
addOre("dustSulfur", 32);
|
||||
addOre("dustLead", 256);
|
||||
addOre("ingotBronze", 256);
|
||||
addOre("ingotElectrum", 2052);
|
||||
addOre("dustLapis", 864);
|
||||
addOre("dustSilver", 1024);
|
||||
addOre("dustTin", 256);
|
||||
}
|
||||
|
||||
addStack(ItemPlates.getPlateByName("steel"), 512);
|
||||
addStack(ItemParts.getPartByName("lazuriteChunk"), 7776);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
event.registerServerCommand(new CommandRegen());
|
||||
event.registerServerCommand(new CommandReload());
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void serverTick(TickEvent.ServerTickEvent event) {
|
||||
//This should be a fix for the things not saving
|
||||
EnergyValueRegistry.getInstance().setShouldRegenNextRestart(false);
|
||||
}
|
||||
|
||||
private void addOre(String name, float value) {
|
||||
WrappedStack stack = WrappedStack.wrap(new OreStack(name));
|
||||
EnergyValue energyValue = new EnergyValue(value);
|
||||
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(stack, energyValue);
|
||||
}
|
||||
|
||||
|
||||
private void addStack(ItemStack itemStack, float value) {
|
||||
WrappedStack stack = WrappedStack.wrap(itemStack);
|
||||
EnergyValue energyValue = new EnergyValue(value);
|
||||
|
||||
EnergyValueRegistryProxy.addPreAssignedEnergyValue(stack, energyValue);
|
||||
}
|
||||
|
||||
|
||||
}
|
43
ToAddBack/compat/minetweaker/MTAlloySmelter.java
Normal file
43
ToAddBack/compat/minetweaker/MTAlloySmelter.java
Normal file
|
@ -0,0 +1,43 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.AlloySmelterRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
/**
|
||||
* mods.techreborn.alloySmelter.addRecipe(<minecraft:gold_ingot>, <minecraft:iron_ingot>, <minecraft:diamond>, 20, 100);
|
||||
*/
|
||||
|
||||
@ZenClass("mods.techreborn.alloySmelter")
|
||||
public class MTAlloySmelter extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
AlloySmelterRecipe r = new AlloySmelterRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.alloySmelteRecipe;
|
||||
}
|
||||
}
|
42
ToAddBack/compat/minetweaker/MTAssemblingMachine.java
Normal file
42
ToAddBack/compat/minetweaker/MTAssemblingMachine.java
Normal file
|
@ -0,0 +1,42 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.AssemblingMachineRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
|
||||
@ZenClass("mods.techreborn.assemblingMachine")
|
||||
public class MTAssemblingMachine extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
AssemblingMachineRecipe r = new AssemblingMachineRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.assemblingMachineRecipe;
|
||||
}
|
||||
|
||||
|
||||
}
|
38
ToAddBack/compat/minetweaker/MTBlastFurnace.java
Normal file
38
ToAddBack/compat/minetweaker/MTBlastFurnace.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.blastFurnace")
|
||||
public class MTBlastFurnace extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick, int neededHeat) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
BlastFurnaceRecipe r = new BlastFurnaceRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), ticktime, euTick, neededHeat);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.blastFurnaceRecipe;
|
||||
}
|
||||
}
|
38
ToAddBack/compat/minetweaker/MTCentrifuge.java
Normal file
38
ToAddBack/compat/minetweaker/MTCentrifuge.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.CentrifugeRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.centrifuge")
|
||||
public class MTCentrifuge extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
CentrifugeRecipe r = new CentrifugeRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.centrifugeRecipe;
|
||||
}
|
||||
}
|
38
ToAddBack/compat/minetweaker/MTChemicalReactor.java
Normal file
38
ToAddBack/compat/minetweaker/MTChemicalReactor.java
Normal file
|
@ -0,0 +1,38 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.ChemicalReactorRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.chemicalReactorRecipe")
|
||||
public class MTChemicalReactor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
ChemicalReactorRecipe r = new ChemicalReactorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.chemicalReactorRecipe;
|
||||
}
|
||||
}
|
237
ToAddBack/compat/minetweaker/MTFusionReactor.java
Normal file
237
ToAddBack/compat/minetweaker/MTFusionReactor.java
Normal file
|
@ -0,0 +1,237 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
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 MTFusionReactor {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IIngredient topInput, IIngredient bottomInput, IItemStack output, int startEU, int euTick, int tickTime) {
|
||||
FusionReactorRecipe reactorRecipe = new FusionReactorRecipe((ItemStack) MinetweakerCompat.toObject(topInput), (ItemStack) MinetweakerCompat.toObject(bottomInput), MinetweakerCompat.toStack(output), startEU, euTick, tickTime);
|
||||
MineTweakerAPI.apply(new Add(reactorRecipe));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeTopInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeBottomInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveTopInput(iIngredient));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
private final FusionReactorRecipe recipe;
|
||||
|
||||
public Add(FusionReactorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing Fusion Reactor recipe for " + recipe.getOutput().getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output)));
|
||||
}
|
||||
|
||||
private static class Remove implements IUndoableAction {
|
||||
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) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(), output, true, false)) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static class RemoveTopInput implements IUndoableAction {
|
||||
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(MineTweakerMC.getIItemStack(recipeType.getTopInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static class RemoveBottomInput implements IUndoableAction {
|
||||
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(MineTweakerMC.getIItemStack(recipeType.getBottomInput()))) {
|
||||
removedRecipes.add(recipeType);
|
||||
FusionReactorRecipeHelper.reactorRecipes.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (FusionReactorRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
FusionReactorRecipeHelper.registerRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding Fusion Reactor recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
175
ToAddBack/compat/minetweaker/MTGeneric.java
Normal file
175
ToAddBack/compat/minetweaker/MTGeneric.java
Normal file
|
@ -0,0 +1,175 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.IUndoableAction;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.minecraft.MineTweakerMC;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.BaseRecipe;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MTGeneric {
|
||||
public static String getMachineName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void addRecipe(BaseRecipe recipe) {
|
||||
MineTweakerAPI.apply(new Add(recipe));
|
||||
}
|
||||
|
||||
private static class Add implements IUndoableAction {
|
||||
private final BaseRecipe recipe;
|
||||
|
||||
public Add(BaseRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
RecipeHandler.recipeList.remove(recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Adding " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Removing " + recipe.getRecipeName() + " recipe for " + recipe.getOutput(0).getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Remove implements IUndoableAction {
|
||||
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()) {
|
||||
if (ItemUtils.isItemEqual(stack, output, true, false)) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (BaseRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name + " recipe for " + output.getDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class RemoveInput implements IUndoableAction {
|
||||
private final IIngredient output;
|
||||
List<BaseRecipe> removedRecipes = new ArrayList<BaseRecipe>();
|
||||
private final String name;
|
||||
|
||||
public RemoveInput(IIngredient output, String machineName) {
|
||||
this.output = output;
|
||||
this.name = machineName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void apply() {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(name)) {
|
||||
for (ItemStack stack : recipeType.getInputs()) {
|
||||
if (output.matches(MineTweakerMC.getIItemStack(stack))) {
|
||||
removedRecipes.add((BaseRecipe) recipeType);
|
||||
RecipeHandler.recipeList.remove(recipeType);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo() {
|
||||
if (removedRecipes != null) {
|
||||
for (BaseRecipe recipe : removedRecipes) {
|
||||
if (recipe != null) {
|
||||
RecipeHandler.addRecipe(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describe() {
|
||||
return "Removing " + name + " recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String describeUndo() {
|
||||
return "Re-Adding " + name + " recipe";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getOverrideKey() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUndo() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
52
ToAddBack/compat/minetweaker/MTGrinder.java
Normal file
52
ToAddBack/compat/minetweaker/MTGrinder.java
Normal file
|
@ -0,0 +1,52 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.grinder")
|
||||
public class MTGrinder extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, output4, input1, input2, null, ticktime, euTick);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = MinetweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
GrinderRecipe r = new GrinderRecipe(oInput1, oInput2, fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.grinderRecipe;
|
||||
}
|
||||
}
|
39
ToAddBack/compat/minetweaker/MTImplosionCompressor.java
Normal file
39
ToAddBack/compat/minetweaker/MTImplosionCompressor.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.ImplosionCompressorRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.implosionCompressor")
|
||||
public class MTImplosionCompressor extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
|
||||
ImplosionCompressorRecipe r = new ImplosionCompressorRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.implosionCompressorRecipe;
|
||||
}
|
||||
}
|
39
ToAddBack/compat/minetweaker/MTIndustrialElectrolyzer.java
Normal file
39
ToAddBack/compat/minetweaker/MTIndustrialElectrolyzer.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.IndustrialElectrolyzerRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialElectrolyzer")
|
||||
public class MTIndustrialElectrolyzer extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IItemStack output4, IIngredient cells, IIngredient input2, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(cells);
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
IndustrialElectrolyzerRecipe r = new IndustrialElectrolyzerRecipe(oInput1, oInput2, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), MinetweakerCompat.toStack(output4), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialElectrolyzerRecipe;
|
||||
}
|
||||
}
|
62
ToAddBack/compat/minetweaker/MTIndustrialSawmill.java
Normal file
62
ToAddBack/compat/minetweaker/MTIndustrialSawmill.java
Normal file
|
@ -0,0 +1,62 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.industrialSawmill")
|
||||
public class MTIndustrialSawmill extends MTGeneric {
|
||||
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, input1, input2, fluid, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick) {
|
||||
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, true);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, int ticktime, int euTick, boolean useOreDic) {
|
||||
addRecipe(output1, output2, output3, input1, input2, null, ticktime, euTick, useOreDic);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output1, IItemStack output2, IItemStack output3, IIngredient input1, IIngredient input2, ILiquidStack fluid, int ticktime, int euTick, boolean useOreDic) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
|
||||
ItemStack oInput2 = (ItemStack) MinetweakerCompat.toObject(input2);
|
||||
|
||||
FluidStack fluidStack = null;
|
||||
if (fluid != null) {
|
||||
fluidStack = MinetweakerCompat.toFluidStack(fluid);
|
||||
}
|
||||
|
||||
IndustrialSawmillRecipe r = new IndustrialSawmillRecipe(oInput1, oInput2, fluidStack, MinetweakerCompat.toStack(output1), MinetweakerCompat.toStack(output2), MinetweakerCompat.toStack(output3), ticktime, euTick, useOreDic);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.industrialSawmillRecipe;
|
||||
}
|
||||
}
|
36
ToAddBack/compat/minetweaker/MTPlateCuttingMachine.java
Normal file
36
ToAddBack/compat/minetweaker/MTPlateCuttingMachine.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.PlateCuttingMachineRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.plateCuttingMachine")
|
||||
public class MTPlateCuttingMachine extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input1, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input1);
|
||||
PlateCuttingMachineRecipe r = new PlateCuttingMachineRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.plateCuttingMachineRecipe;
|
||||
}
|
||||
}
|
36
ToAddBack/compat/minetweaker/MTVacuumFreezer.java
Normal file
36
ToAddBack/compat/minetweaker/MTVacuumFreezer.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import stanhebben.zenscript.annotations.ZenClass;
|
||||
import stanhebben.zenscript.annotations.ZenMethod;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
@ZenClass("mods.techreborn.vacuumFreezer")
|
||||
public class MTVacuumFreezer extends MTGeneric {
|
||||
|
||||
@ZenMethod
|
||||
public static void addRecipe(IItemStack output, IIngredient input, int ticktime, int euTick) {
|
||||
ItemStack oInput1 = (ItemStack) MinetweakerCompat.toObject(input);
|
||||
|
||||
VacuumFreezerRecipe r = new VacuumFreezerRecipe(oInput1, MinetweakerCompat.toStack(output), ticktime, euTick);
|
||||
addRecipe(r);
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeInputRecipe(IIngredient iIngredient) {
|
||||
MineTweakerAPI.apply(new RemoveInput(iIngredient, getMachineName()));
|
||||
}
|
||||
|
||||
@ZenMethod
|
||||
public static void removeRecipe(IItemStack output) {
|
||||
MineTweakerAPI.apply(new Remove(MinetweakerCompat.toStack(output), getMachineName()));
|
||||
}
|
||||
|
||||
public static String getMachineName() {
|
||||
return Reference.vacuumFreezerRecipe;
|
||||
}
|
||||
}
|
78
ToAddBack/compat/minetweaker/MinetweakerCompat.java
Normal file
78
ToAddBack/compat/minetweaker/MinetweakerCompat.java
Normal file
|
@ -0,0 +1,78 @@
|
|||
package techreborn.compat.minetweaker;
|
||||
|
||||
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 net.minecraftforge.fml.relauncher.ReflectionHelper;
|
||||
import minetweaker.MineTweakerAPI;
|
||||
import minetweaker.api.item.IIngredient;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.item.IngredientStack;
|
||||
import minetweaker.api.liquid.ILiquidStack;
|
||||
import minetweaker.api.oredict.IOreDictEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import techreborn.compat.ICompatModule;
|
||||
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getItemStack;
|
||||
import static minetweaker.api.minecraft.MineTweakerMC.getLiquidStack;
|
||||
|
||||
|
||||
public class MinetweakerCompat implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
MineTweakerAPI.registerClass(MTAlloySmelter.class);
|
||||
MineTweakerAPI.registerClass(MTAssemblingMachine.class);
|
||||
MineTweakerAPI.registerClass(MTBlastFurnace.class);
|
||||
MineTweakerAPI.registerClass(MTCentrifuge.class);
|
||||
MineTweakerAPI.registerClass(MTChemicalReactor.class);
|
||||
MineTweakerAPI.registerClass(MTGrinder.class);
|
||||
MineTweakerAPI.registerClass(MTImplosionCompressor.class);
|
||||
MineTweakerAPI.registerClass(MTIndustrialElectrolyzer.class);
|
||||
MineTweakerAPI.registerClass(MTIndustrialSawmill.class);
|
||||
MineTweakerAPI.registerClass(MTPlateCuttingMachine.class);
|
||||
MineTweakerAPI.registerClass(MTFusionReactor.class);
|
||||
MineTweakerAPI.registerClass(MTVacuumFreezer.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public static ItemStack toStack(IItemStack iStack) {
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
158
ToAddBack/compat/nei/FustionReacorRecipeHandler.java
Normal file
158
ToAddBack/compat/nei/FustionReacorRecipeHandler.java
Normal file
|
@ -0,0 +1,158 @@
|
|||
package techreborn.compat.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.reactor.FusionReactorRecipe;
|
||||
import techreborn.api.reactor.FusionReactorRecipeHelper;
|
||||
import techreborn.client.gui.GuiFusionReactor;
|
||||
|
||||
import java.awt.*;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class FustionReacorRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
public class CachedReactorRecipe extends CachedRecipe {
|
||||
|
||||
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
||||
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
||||
public Point focus;
|
||||
public FusionReactorRecipe recipe;
|
||||
|
||||
public CachedReactorRecipe(FusionReactorRecipe recipe) {
|
||||
this.recipe = recipe;
|
||||
addPositionedStacks(input, outputs, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return this.getCycledIngredients(cycleticks / 20, this.input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return this.outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
||||
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
||||
GuiDraw.drawString("Info:", 14, 84, -1);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedReactorRecipe) {
|
||||
CachedReactorRecipe genericRecipe = (CachedReactorRecipe) recipe;
|
||||
float scale = 0.9F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
|
||||
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
|
||||
symbols.setGroupingSeparator('.');
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
GuiDraw.drawString("Start: " + formatter.format(genericRecipe.recipe.getStartEU()) + "EU", 16, 105, -1);
|
||||
GuiDraw.drawString("EU/t: " + genericRecipe.recipe.getEuTick() , 16, 115, -1);
|
||||
GuiDraw.drawString("Ticks to process: " + genericRecipe.recipe.getTickTime(), 14, 125, -1);
|
||||
GuiDraw.drawString("Time to process: " + genericRecipe.recipe.getTickTime() / 20 + " seconds", 14, 135, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getRecipeName())) {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(), result, true, false, true)) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (FusionReactorRecipe recipeType : FusionReactorRecipeHelper.reactorRecipes) {
|
||||
if (ItemUtils.isItemEqual(ingredient, recipeType.getTopInput(), true, false, true)) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
if (ItemUtils.isItemEqual(ingredient, recipeType.getBottomInput(), true, false, true)) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addCached(FusionReactorRecipe recipie) {
|
||||
this.arecipes.add(new CachedReactorRecipe(recipie));
|
||||
}
|
||||
|
||||
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, FusionReactorRecipe recipeType) {
|
||||
int offset = 4;
|
||||
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getTopInput()), 88 - offset, 17 - offset, false);
|
||||
input.add(pStack);
|
||||
|
||||
if(recipeType.getBottomInput() != null){
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getBottomInput()), 88 - offset, 53 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(), 148 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Fustion Reactor";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/fusion_reactor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiFusionReactor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(82, 23, 52, 18), getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
}
|
82
ToAddBack/compat/nei/NEIConfig.java
Normal file
82
ToAddBack/compat/nei/NEIConfig.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
package techreborn.compat.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import techreborn.api.recipe.machines.VacuumFreezerRecipe;
|
||||
import techreborn.compat.nei.recipes.*;
|
||||
import techreborn.lib.ModInfo;
|
||||
|
||||
public class NEIConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ModInfo.MOD_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return ModInfo.MOD_VERSION;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadConfig() {
|
||||
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
|
||||
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
|
||||
|
||||
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
|
||||
API.registerUsageHandler(implosion);
|
||||
API.registerRecipeHandler(implosion);
|
||||
|
||||
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
|
||||
API.registerUsageHandler(alloy);
|
||||
API.registerRecipeHandler(alloy);
|
||||
|
||||
IronAlloySmelterRecipeHandler ironAlloy = new IronAlloySmelterRecipeHandler();
|
||||
API.registerUsageHandler(ironAlloy);
|
||||
API.registerRecipeHandler(ironAlloy);
|
||||
|
||||
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
|
||||
API.registerUsageHandler(sawmill);
|
||||
API.registerRecipeHandler(sawmill);
|
||||
|
||||
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
|
||||
API.registerUsageHandler(chem);
|
||||
API.registerRecipeHandler(chem);
|
||||
|
||||
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
|
||||
API.registerUsageHandler(cent);
|
||||
API.registerRecipeHandler(cent);
|
||||
|
||||
GrinderRecipeHandler grind = new GrinderRecipeHandler();
|
||||
API.registerUsageHandler(grind);
|
||||
API.registerRecipeHandler(grind);
|
||||
|
||||
IndustrialElectrolyzerRecipeHandler elec = new IndustrialElectrolyzerRecipeHandler();
|
||||
API.registerUsageHandler(elec);
|
||||
API.registerRecipeHandler(elec);
|
||||
|
||||
BlastFurnaceRecipeHandler blast = new BlastFurnaceRecipeHandler();
|
||||
API.registerUsageHandler(blast);
|
||||
API.registerRecipeHandler(blast);
|
||||
|
||||
API.registerUsageHandler(shapedRollingMachineHandler);
|
||||
API.registerRecipeHandler(shapedRollingMachineHandler);
|
||||
|
||||
API.registerUsageHandler(shapelessRollingMachineHandler);
|
||||
API.registerRecipeHandler(shapelessRollingMachineHandler);
|
||||
|
||||
AssemblingMachineRecipeHandler assemblingMachineRecipe = new AssemblingMachineRecipeHandler();
|
||||
API.registerUsageHandler(assemblingMachineRecipe);
|
||||
API.registerRecipeHandler(assemblingMachineRecipe);
|
||||
|
||||
FustionReacorRecipeHandler fustionReacorRecipeHandler = new FustionReacorRecipeHandler();
|
||||
API.registerUsageHandler(fustionReacorRecipeHandler);
|
||||
API.registerRecipeHandler(fustionReacorRecipeHandler);
|
||||
|
||||
VacuumFreezerRecipeHandler vacuumFreezerRecipe = new VacuumFreezerRecipeHandler();
|
||||
API.registerUsageHandler(vacuumFreezerRecipe);
|
||||
API.registerRecipeHandler(vacuumFreezerRecipe);
|
||||
|
||||
}
|
||||
}
|
111
ToAddBack/compat/nei/ShapedRollingMachineHandler.java
Normal file
111
ToAddBack/compat/nei/ShapedRollingMachineHandler.java
Normal file
|
@ -0,0 +1,111 @@
|
|||
//Copy and pasted from https://github.com/Chicken-Bones/NotEnoughItems/blob/master/src/codechicken/nei/recipe/ShapedRecipeHandler.java
|
||||
package techreborn.compat.nei;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.recipe.ShapedRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ShapedRollingMachineHandler extends ShapedRecipeHandler {
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiRollingMachine.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24,
|
||||
18), "rollingcrafting", new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Shaped Rolling Machine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return "rollingcrafting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals("rollingcrafting")
|
||||
&& getClass() == ShapedRollingMachineHandler.class) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||
.getRecipeList()) {
|
||||
CachedShapedRecipe recipe = null;
|
||||
if (irecipe instanceof ShapedRecipes)
|
||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapedOreRecipe)
|
||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null)
|
||||
continue;
|
||||
|
||||
recipe.computeVisuals();
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||
.getRecipeList()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||
irecipe.getRecipeOutput(), result)) {
|
||||
CachedShapedRecipe recipe = null;
|
||||
if (irecipe instanceof ShapedRecipes)
|
||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapedOreRecipe)
|
||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null)
|
||||
continue;
|
||||
|
||||
recipe.computeVisuals();
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||
.getRecipeList()) {
|
||||
CachedShapedRecipe recipe = null;
|
||||
if (irecipe instanceof ShapedRecipes)
|
||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapedOreRecipe)
|
||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null
|
||||
|| !recipe.contains(recipe.ingredients,
|
||||
ingredient.getItem()))
|
||||
continue;
|
||||
|
||||
recipe.computeVisuals();
|
||||
if (recipe.contains(recipe.ingredients, ingredient)) {
|
||||
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/rolling_machine.png";
|
||||
}
|
||||
}
|
116
ToAddBack/compat/nei/ShapelessRollingMachineHandler.java
Normal file
116
ToAddBack/compat/nei/ShapelessRollingMachineHandler.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
//Copy and pasted from https://github.com/Chicken-Bones/NotEnoughItems/blob/master/src/codechicken/nei/recipe/ShapelessRecipeHandler.java
|
||||
package techreborn.compat.nei;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.recipe.ShapelessRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.client.gui.GuiRollingMachine;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ShapelessRollingMachineHandler extends ShapelessRecipeHandler {
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiRollingMachine.class;
|
||||
}
|
||||
|
||||
public String getRecipeName() {
|
||||
return "Shapeless Rolling Machine";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
|
||||
"rollingcraftingnoshape"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return "rollingcraftingnoshape";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals("rollingcraftingnoshape")
|
||||
&& getClass() == ShapelessRollingMachineHandler.class) {
|
||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||
.getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes) {
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if (irecipe instanceof ShapelessRecipes)
|
||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapelessOreRecipe)
|
||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null)
|
||||
continue;
|
||||
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||
.getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||
irecipe.getRecipeOutput(), result)) {
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if (irecipe instanceof ShapelessRecipes)
|
||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapelessOreRecipe)
|
||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null)
|
||||
continue;
|
||||
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||
.getRecipeList();
|
||||
for (IRecipe irecipe : allrecipes) {
|
||||
CachedShapelessRecipe recipe = null;
|
||||
if (irecipe instanceof ShapelessRecipes)
|
||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||
else if (irecipe instanceof ShapelessOreRecipe)
|
||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||
|
||||
if (recipe == null)
|
||||
continue;
|
||||
|
||||
if (recipe.contains(recipe.ingredients, ingredient)) {
|
||||
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
||||
arecipes.add(recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private CachedShapelessRecipe shapelessRecipe(ShapelessRecipes recipe) {
|
||||
if (recipe.recipeItems == null)
|
||||
return null;
|
||||
|
||||
return new CachedShapelessRecipe(recipe.recipeItems,
|
||||
recipe.getRecipeOutput());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/rolling_machine.png";
|
||||
}
|
||||
}
|
54
ToAddBack/compat/nei/recipes/AlloySmelterRecipeHandler.java
Normal file
54
ToAddBack/compat/nei/recipes/AlloySmelterRecipeHandler.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiAlloySmelter;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class AlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset, false);
|
||||
input.add(pStack);
|
||||
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset, false);
|
||||
input.add(pStack2);
|
||||
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.alloySmelteRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/electric_alloy_furnace.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiAlloySmelter.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(75, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiAssemblingMachine;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class AssemblingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.assemblingMachineRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/assembling_machine.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiAssemblingMachine.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(80, 20, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
79
ToAddBack/compat/nei/recipes/BlastFurnaceRecipeHandler.java
Normal file
79
ToAddBack/compat/nei/recipes/BlastFurnaceRecipeHandler.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class BlastFurnaceRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 40 - offset, 25 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 40 - offset, 43 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 100 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 118 - offset, 35 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.blastFurnaceRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/industrial_blast_furnace.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiBlastFurnace.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(55, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
super.drawBackground(recipeIndex);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
if (((CachedGenericRecipe) recipe).recipie instanceof BlastFurnaceRecipe) {
|
||||
BlastFurnaceRecipe blastFurnaceRecipeHandler = (BlastFurnaceRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
GuiDraw.drawString("Requires " + blastFurnaceRecipeHandler.neededHeat + " heat", 14, 135, -1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
75
ToAddBack/compat/nei/recipes/CentrifugeRecipeHandler.java
Normal file
75
ToAddBack/compat/nei/recipes/CentrifugeRecipeHandler.java
Normal file
|
@ -0,0 +1,75 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiCentrifuge;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class CentrifugeRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 35 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 2) {
|
||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset, false);
|
||||
outputs.add(pStack5);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 3) {
|
||||
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset, false);
|
||||
outputs.add(pStack6);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.centrifugeRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/industrial_centrifuge.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiCentrifuge.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(64, 25, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(94, 25, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(78, 15, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(78, 40, 10, 10), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiChemicalReactor;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ChemicalReactorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 70 - offset, 21 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.chemicalReactorRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/chemical_reactor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiChemicalReactor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(70, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
141
ToAddBack/compat/nei/recipes/GenericRecipeHander.java
Normal file
141
ToAddBack/compat/nei/recipes/GenericRecipeHander.java
Normal file
|
@ -0,0 +1,141 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
|
||||
import java.awt.*;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public abstract class GenericRecipeHander extends TemplateRecipeHandler {
|
||||
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public class CachedGenericRecipe extends CachedRecipe {
|
||||
|
||||
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
||||
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
||||
public Point focus;
|
||||
public IBaseRecipeType recipie;
|
||||
public INeiBaseRecipe neiBaseRecipe;
|
||||
|
||||
public CachedGenericRecipe(IBaseRecipeType recipe, INeiBaseRecipe neiBaseRecipe) {
|
||||
this.recipie = recipe;
|
||||
this.neiBaseRecipe = neiBaseRecipe;
|
||||
neiBaseRecipe.addPositionedStacks(input, outputs, recipe);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return this.getCycledIngredients(cycleticks / 20, this.input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return this.outputs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return RecipeHandler.getUserFreindlyName(getNeiBaseRecipe().getRecipeName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return getNeiBaseRecipe().getGuiTexture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return getNeiBaseRecipe().getGuiClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
||||
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
||||
GuiDraw.drawString("Info:", 14, 84, -1);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
CachedGenericRecipe genericRecipe = (CachedGenericRecipe) recipe;
|
||||
float scale = 0.9F;
|
||||
GL11.glScalef(scale, scale, scale);
|
||||
DecimalFormat formatter = (DecimalFormat) NumberFormat.getInstance(Locale.US);
|
||||
DecimalFormatSymbols symbols = formatter.getDecimalFormatSymbols();
|
||||
symbols.setGroupingSeparator('.');
|
||||
formatter.setDecimalFormatSymbols(symbols);
|
||||
GuiDraw.drawString("EU needed: " + formatter.format(new Integer(genericRecipe.recipie.euPerTick() * genericRecipe.recipie.tickTime()).longValue()), 16, 105, -1);
|
||||
GuiDraw.drawString("Ticks to process: " + genericRecipe.recipie.tickTime(), 14, 115, -1);
|
||||
GuiDraw.drawString("Time to process: " + genericRecipe.recipie.tickTime() / 20 + " seconds", 14, 125, -1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int recipiesPerPage() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// public void loadTransferRects() {
|
||||
// this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
// new Rectangle(0, 0, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
// }
|
||||
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getNeiBaseRecipe().getRecipeName())) {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||
for (int i = 0; i < recipeType.getOutputsSize(); i++) {
|
||||
if (ItemUtils.isItemEqual(recipeType.getOutput(i), result, true, false, true)) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||
for (ItemStack input : recipeType.getInputs()) {
|
||||
if (ItemUtils.isItemEqual(ingredient, input, true, false, true)) {
|
||||
addCached(recipeType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addCached(IBaseRecipeType recipie) {
|
||||
this.arecipes.add(new CachedGenericRecipe(recipie, getNeiBaseRecipe()));
|
||||
}
|
||||
|
||||
}
|
104
ToAddBack/compat/nei/recipes/GrinderRecipeHandler.java
Normal file
104
ToAddBack/compat/nei/recipes/GrinderRecipeHandler.java
Normal file
|
@ -0,0 +1,104 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import reborncore.client.gui.GuiUtil;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.client.gui.GuiGrinder;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class GrinderRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 32 - offset, 26 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 32 - offset, 44 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 77 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 95 - offset, 35 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 2) {
|
||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 113 - offset, 35 - offset, false);
|
||||
outputs.add(pStack5);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 3) {
|
||||
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 131 - offset, 35 - offset, false);
|
||||
outputs.add(pStack6);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.grinderRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/industrial_grinder.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiGrinder.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(44, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
super.drawBackground(recipeIndex);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
if (((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe) {
|
||||
GrinderRecipe grinderRecipe = (GrinderRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
if (grinderRecipe.fluidStack != null) {
|
||||
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
|
||||
if (fluidIcon != null) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
int liquidHeight = grinderRecipe.fluidStack.amount * 100 / 16000;
|
||||
GuiUtil.drawRepeated(fluidIcon, 7, 22 + 47 - liquidHeight, 14.0D, liquidHeight, GuiDraw.gui.getZLevel());
|
||||
|
||||
}
|
||||
GuiDraw.drawString(grinderRecipe.fluidStack.amount + "mb of " + grinderRecipe.fluidStack.getLocalizedName(), 14, 135, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
36
ToAddBack/compat/nei/recipes/INeiBaseRecipe.java
Normal file
36
ToAddBack/compat/nei/recipes/INeiBaseRecipe.java
Normal file
|
@ -0,0 +1,36 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Use this to make your neiHandler
|
||||
*/
|
||||
public interface INeiBaseRecipe {
|
||||
|
||||
/**
|
||||
* Add the inputs and the outputs
|
||||
*
|
||||
* @param input add the input stacks to this
|
||||
* @param outputs add this output stacks to this
|
||||
*/
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType);
|
||||
|
||||
/**
|
||||
* @return the recipe name that is used for the recipe
|
||||
*/
|
||||
public String getRecipeName();
|
||||
|
||||
/**
|
||||
* @return the guiTexture location
|
||||
*/
|
||||
public String getGuiTexture();
|
||||
|
||||
/**
|
||||
* @return the gui class for the recipe
|
||||
*/
|
||||
public Class<? extends GuiContainer> getGuiClass();
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiImplosionCompressor;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class ImplosionCompressorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 37 - offset, 26 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.implosionCompressorRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/implosion_compressor.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiImplosionCompressor.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(50, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiIndustrialElectrolyzer;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialElectrolyzerRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 51 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 51 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 50 - offset, 19 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 70 - offset, 19 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
if (recipeType.getOutputsSize() > 2) {
|
||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 90 - offset, 19 - offset, false);
|
||||
outputs.add(pStack5);
|
||||
}
|
||||
if (recipeType.getOutputsSize() > 3) {
|
||||
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 110 - offset, 19 - offset, false);
|
||||
outputs.add(pStack6);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.industrialElectrolyzerRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/industrial_electrolyzer.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiIndustrialElectrolyzer.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(80, 20, 15, 15), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,97 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import reborncore.client.gui.GuiUtil;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class IndustrialSawmillRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
if (recipeType.getInputs().size() > 0) {
|
||||
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 32 - offset, 26 - offset, false);
|
||||
input.add(pStack);
|
||||
}
|
||||
|
||||
if (recipeType.getInputs().size() > 1) {
|
||||
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset, false);
|
||||
input.add(pStack2);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 0) {
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 1) {
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
|
||||
if (recipeType.getOutputsSize() > 2) {
|
||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset, false);
|
||||
outputs.add(pStack5);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.industrialSawmillRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/industrial_sawmill.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiIndustrialSawmill.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(50, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
super.drawBackground(recipeIndex);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
if (((CachedGenericRecipe) recipe).recipie instanceof IndustrialSawmillRecipe) {
|
||||
IndustrialSawmillRecipe grinderRecipe = (IndustrialSawmillRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
if (grinderRecipe.fluidStack != null) {
|
||||
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
|
||||
if (fluidIcon != null) {
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
|
||||
int liquidHeight = grinderRecipe.fluidStack.amount * 100 / 16000;
|
||||
GuiUtil.drawRepeated(fluidIcon, 7, 22 + 47 - liquidHeight, 14.0D, liquidHeight, GuiDraw.gui.getZLevel());
|
||||
|
||||
}
|
||||
GuiDraw.drawString(grinderRecipe.fluidStack.amount + "mb of " + grinderRecipe.fluidStack.getLocalizedName(), 14, 135, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiAlloyFurnace;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by MrBretzel on 01/11/2015.
|
||||
*/
|
||||
public class IronAlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 46 - offset, 9 - offset, false);
|
||||
input.add(pStack);
|
||||
|
||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 64 - offset, 9 - offset, false);
|
||||
input.add(pStack2);
|
||||
|
||||
Iterator i = ItemList.items.iterator();
|
||||
List<ItemStack> fuels = new ArrayList<ItemStack>();
|
||||
while(i.hasNext()) {
|
||||
ItemStack item = (ItemStack) i.next();
|
||||
if(!fuels.contains(new ItemStack(item.getItem()))) {
|
||||
int burnTime = TileEntityFurnace.getItemBurnTime(item);
|
||||
if(burnTime > 0) {
|
||||
fuels.add(new ItemStack(item.getItem()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PositionedStack pStack3 = new PositionedStack(fuels, 51, 42, false);
|
||||
input.add(pStack3);
|
||||
|
||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(0), 115 - offset, 28 - offset, false);
|
||||
outputs.add(pStack4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.ironalloySmelteRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/alloy_furnace.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiAlloyFurnace.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(75, 20, 25, 20), Reference.alloySmelteRecipe, new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 5, 11, 166, 65);
|
||||
}
|
||||
}
|
51
ToAddBack/compat/nei/recipes/VacuumFreezerRecipeHandler.java
Normal file
51
ToAddBack/compat/nei/recipes/VacuumFreezerRecipeHandler.java
Normal file
|
@ -0,0 +1,51 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.client.gui.GuiVacuumFreezer;
|
||||
import techreborn.lib.Reference;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.List;
|
||||
|
||||
public class VacuumFreezerRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||
|
||||
@Override
|
||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||
int offset = 4;
|
||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 34 - offset, false);
|
||||
input.add(pStack);
|
||||
|
||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset, false);
|
||||
outputs.add(pStack3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return Reference.vacuumFreezerRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "techreborn:textures/gui/vacuum_freezer.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends GuiContainer> getGuiClass() {
|
||||
return GuiVacuumFreezer.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(75, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
}
|
97
ToAddBack/compat/recipes/RecipesBiomesOPlenty.java
Normal file
97
ToAddBack/compat/recipes/RecipesBiomesOPlenty.java
Normal file
|
@ -0,0 +1,97 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
|
||||
import biomesoplenty.api.content.BOPCBlocks;
|
||||
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 ic2.api.item.IC2Items;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
public class RecipesBiomesOPlenty implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
if (ConfigTechReborn.AllowBOPRecipes) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 0), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 0), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 1), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 1), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 2), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 2), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 2), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 3), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 3), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 3), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs1, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 4), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 4), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 4), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 5), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 5), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 6), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 2), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 6), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 6), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 7), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 3), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 7), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs2, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 7), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 8), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 8), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 8), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 9), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 9), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs3, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 9), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 11), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 11), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 11), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 12), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 12), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 12), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 13), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 2), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 13), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 13), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(BOPCBlocks.planks, 6, 14), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 3), IC2Items.getItem("waterCell"), null, new ItemStack(BOPCBlocks.planks, 6, 14), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(BOPCBlocks.logs4, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(BOPCBlocks.planks, 6, 14), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
94
ToAddBack/compat/recipes/RecipesBuildcraft.java
Normal file
94
ToAddBack/compat/recipes/RecipesBuildcraft.java
Normal file
|
@ -0,0 +1,94 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
import buildcraft.api.fuels.IFuel;
|
||||
import buildcraft.core.Version;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import reborncore.common.util.CraftingHelper;
|
||||
import reborncore.common.util.RecipeRemover;
|
||||
import techreborn.Core;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
public class RecipesBuildcraft implements ICompatModule {
|
||||
|
||||
public static Block quarryBlock;
|
||||
|
||||
public static void removeRecipes() {
|
||||
RecipeRemover.removeAnyRecipe(new ItemStack(
|
||||
quarryBlock));
|
||||
}
|
||||
|
||||
public static void addRecipies() {
|
||||
Item drill = IC2Items.getItem("diamondDrill").getItem();
|
||||
ItemStack drillStack = new ItemStack(drill, 1, OreDictionary.WILDCARD_VALUE);
|
||||
//Quarry
|
||||
CraftingHelper.addShapedOreRecipe(new ItemStack(quarryBlock), new Object[]
|
||||
{
|
||||
"IAI", "GIG", "DED",
|
||||
'I', "gearIron",
|
||||
'G', "gearGold",
|
||||
'D', "gearDiamond",
|
||||
'A', IC2Items.getItem("advancedCircuit"),
|
||||
'E', drillStack
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
Core.logHelper.info("Trying to change the quarry recipe");
|
||||
try {
|
||||
String itemClass = "buildcraft.BuildCraftBuilders";
|
||||
if (!Version.getVersion().startsWith("7")) {//Buildcraft 6
|
||||
if (Loader.isModLoaded("BuildCraft|Factory")) {
|
||||
itemClass = "buildcraft.BuildCraftFactory";
|
||||
}
|
||||
} else if (!Version.getVersion().startsWith("7") && !Loader.isModLoaded("BuildCraft|Builders")) { //Buildcraft 7
|
||||
Core.logHelper.info("Buildcraft not found");
|
||||
return;
|
||||
}
|
||||
Object obj = Class.forName(itemClass).getField("quarryBlock").get(null);
|
||||
if (obj instanceof Block) {
|
||||
quarryBlock = (Block) obj;
|
||||
Core.logHelper.info("Found Quarry Block from buildcraft at " + itemClass + ":quarryBlock");
|
||||
} else {
|
||||
Core.logHelper.fatal("Could not retrieve quarry block from Buildcraft! This is a fatal error!");
|
||||
return;
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Core.logHelper.fatal("Could not retrieve quarry block from Buildcraft! This is a fatal error!");
|
||||
ex.printStackTrace();
|
||||
return;
|
||||
}
|
||||
removeRecipes();
|
||||
addRecipies();
|
||||
for (IFuel fuel : buildcraft.energy.fuels.FuelManager.INSTANCE.getFuels()) {
|
||||
FluidPowerManager.fluidPowerValues.put(fuel.getFluid(), (double) fuel.getPowerPerCycle() / ConfigTechReborn.euPerRF);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
74
ToAddBack/compat/recipes/RecipesForestry.java
Normal file
74
ToAddBack/compat/recipes/RecipesForestry.java
Normal file
|
@ -0,0 +1,74 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
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 forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.GeneratorFuel;
|
||||
import ic2.api.item.IC2Items;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class RecipesForestry implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
if (ConfigTechReborn.AllowForestryRecipes) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
ItemStack log = TreeManager.woodItemAccess.getLog(woodType, true);
|
||||
log.stackSize = 1;
|
||||
ItemStack plank = TreeManager.woodItemAccess.getPlanks(woodType, true);
|
||||
plank.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, null, new FluidStack(FluidRegistry.WATER, 1000), plank, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, IC2Items.getItem("waterCell"), null, plank, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, new ItemStack(Items.water_bucket), null, plank, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
log = TreeManager.woodItemAccess.getLog(woodType, false);
|
||||
log.stackSize = 1;
|
||||
plank = TreeManager.woodItemAccess.getPlanks(woodType, false);
|
||||
plank.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, null, new FluidStack(FluidRegistry.WATER, 1000), plank, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, IC2Items.getItem("waterCell"), null, plank, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(log, new ItemStack(Items.water_bucket), null, plank, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
}
|
||||
|
||||
Iterator entries = FuelManager.generatorFuel.entrySet().iterator();
|
||||
while (entries.hasNext()) {
|
||||
Map.Entry thisEntry = (Map.Entry) entries.next();
|
||||
Fluid fluid = (Fluid) thisEntry.getKey();
|
||||
GeneratorFuel generatorFuel = (GeneratorFuel) thisEntry.getValue();
|
||||
FluidPowerManager.fluidPowerValues.put(fluid, (double) (generatorFuel.eu / generatorFuel.rate));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
||||
|
1369
ToAddBack/compat/recipes/RecipesIC2.java
Normal file
1369
ToAddBack/compat/recipes/RecipesIC2.java
Normal file
File diff suppressed because it is too large
Load diff
89
ToAddBack/compat/recipes/RecipesNatura.java
Normal file
89
ToAddBack/compat/recipes/RecipesNatura.java
Normal file
|
@ -0,0 +1,89 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
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 ic2.api.item.IC2Items;
|
||||
import mods.natura.common.NContent;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
|
||||
public class RecipesNatura implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
if (ConfigTechReborn.AllowNaturaRecipes) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 0), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 0), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 0), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 1), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 1), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 1), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 2), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 2), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 2), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 2), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 5), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 3), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 5), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.tree, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 5), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.redwood, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 3), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.redwood, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 3), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.redwood, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 3), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.willow, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 10), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.willow, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 10), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.willow, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 10), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 6), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 6), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 6), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 7), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 7), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 7), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 2), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 8), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 2), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 8), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 2), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 8), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 3), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 9), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 3), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 9), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.rareTree, 1, 3), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 9), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 0), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 11), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 0), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 11), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 0), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 11), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 1), null, new FluidStack(FluidRegistry.WATER, 1000), new ItemStack(NContent.planks, 6, 12), pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 1), IC2Items.getItem("waterCell"), null, new ItemStack(NContent.planks, 6, 12), pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(new ItemStack(NContent.darkTree, 1, 1), new ItemStack(Items.water_bucket), null, new ItemStack(NContent.planks, 6, 12), pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
50
ToAddBack/compat/recipes/RecipesThaumcraft.java
Normal file
50
ToAddBack/compat/recipes/RecipesThaumcraft.java
Normal file
|
@ -0,0 +1,50 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
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 ic2.api.item.IC2Items;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.api.recipe.machines.IndustrialSawmillRecipe;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import thaumcraft.api.ItemApi;
|
||||
|
||||
public class RecipesThaumcraft implements ICompatModule {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
ItemStack pulpStack = OreDictionary.getOres("pulpWood").get(0);
|
||||
ItemStack greatWoodStack = ItemApi.getBlock("blockWoodenDevice", 6);
|
||||
greatWoodStack.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 0), null, new FluidStack(FluidRegistry.WATER, 1000), greatWoodStack, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 0), IC2Items.getItem("waterCell"), null, greatWoodStack, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 0), new ItemStack(Items.water_bucket), null, greatWoodStack, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
|
||||
ItemStack silverWooodStack = ItemApi.getBlock("blockWoodenDevice", 7);
|
||||
silverWooodStack.stackSize = 6;
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 1), null, new FluidStack(FluidRegistry.WATER, 1000), silverWooodStack, pulpStack, null, 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 1), IC2Items.getItem("waterCell"), null, silverWooodStack, pulpStack, IC2Items.getItem("cell"), 200, 30, false));
|
||||
RecipeHandler.addRecipe(new IndustrialSawmillRecipe(ItemApi.getBlock("blockMagicalLog", 1), new ItemStack(Items.water_bucket), null, silverWooodStack, pulpStack, new ItemStack(Items.bucket), 200, 30, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
32
ToAddBack/compat/recipes/RecipesThermalExpansion.java
Normal file
32
ToAddBack/compat/recipes/RecipesThermalExpansion.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package techreborn.compat.recipes;
|
||||
|
||||
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;
|
||||
|
||||
public class RecipesThermalExpansion implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event) {
|
||||
// TODO remove basic machine frame recipe
|
||||
// TODO replace iron in recipe to steel
|
||||
// TODO add industrial blast furnace recipes for Enderium and Fluxed Electrum
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
}
|
34
ToAddBack/compat/waila/CompatModuleWaila.java
Normal file
34
ToAddBack/compat/waila/CompatModuleWaila.java
Normal file
|
@ -0,0 +1,34 @@
|
|||
package techreborn.compat.waila;
|
||||
|
||||
import net.minecraftforge.fml.common.event.*;
|
||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||
import techreborn.compat.ICompatModule;
|
||||
import techreborn.tiles.TileMachineBase;
|
||||
|
||||
public class CompatModuleWaila implements ICompatModule {
|
||||
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
FMLInterModComms.sendMessage("Waila", "register", getClass().getName()
|
||||
+ ".callbackRegister");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serverStarting(FMLServerStartingEvent event) {
|
||||
|
||||
}
|
||||
|
||||
public static void callbackRegister(IWailaRegistrar registrar) {
|
||||
registrar.registerBodyProvider(new WailaProviderMachines(),
|
||||
TileMachineBase.class);
|
||||
}
|
||||
}
|
60
ToAddBack/compat/waila/WailaProviderMachines.java
Normal file
60
ToAddBack/compat/waila/WailaProviderMachines.java
Normal file
|
@ -0,0 +1,60 @@
|
|||
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.world.World;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import techreborn.tiles.TileMachineBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WailaProviderMachines implements IWailaDataProvider {
|
||||
|
||||
private List<String> info = new ArrayList<String>();
|
||||
|
||||
@Override
|
||||
public List<String> getWailaBody(ItemStack item, List<String> tip,
|
||||
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||
if (accessor.getTileEntity() instanceof IListInfoProvider) {
|
||||
((IListInfoProvider) accessor.getTileEntity()).addInfo(info, true);
|
||||
}
|
||||
tip.addAll(info);
|
||||
info.clear();
|
||||
|
||||
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 null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te,
|
||||
NBTTagCompound tag, World w, int x, int y, int z) {
|
||||
|
||||
return tag;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue