forestry update

This commit is contained in:
jaredlll08 2015-01-20 18:07:46 +02:00
parent f049cbfe9b
commit e36dd43b18
8 changed files with 77 additions and 8 deletions

View file

@ -13,6 +13,7 @@ import modtweaker.mods.factorization.Factorization;
import modtweaker.mods.forestry.Forestry; import modtweaker.mods.forestry.Forestry;
import modtweaker.mods.fsp.Steamcraft; import modtweaker.mods.fsp.Steamcraft;
import modtweaker.mods.hee.HardcoreEnderExpansion; import modtweaker.mods.hee.HardcoreEnderExpansion;
import modtweaker.mods.imc.handler.Message;
import modtweaker.mods.mariculture.Mariculture; import modtweaker.mods.mariculture.Mariculture;
import modtweaker.mods.mekanism.Mekanism; import modtweaker.mods.mekanism.Mekanism;
import modtweaker.mods.mekanism.gas.GasLogger; import modtweaker.mods.mekanism.gas.GasLogger;
@ -30,11 +31,19 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
@Mod(modid = ModProps.modid, name = ModProps.name, dependencies = ModProps.dependencies) @Mod(modid = ModProps.modid, name = ModProps.name, dependencies = ModProps.dependencies)
public class ModTweaker { public class ModTweaker {
@EventHandler
public void preInit(FMLPreInitializationEvent event){
new Message(event.getModConfigurationDirectory().getPath() + "/modtweaker/");
}
@EventHandler @EventHandler
public void init(FMLInitializationEvent event) { public void init(FMLInitializationEvent event) {
TweakerPlugin.register("Botania", Botania.class); TweakerPlugin.register("Botania", Botania.class);

View file

@ -32,7 +32,7 @@ import forestry.factory.gadgets.MachineCarpenter.RecipeManager;
public class Carpenter { public class Carpenter {
@ZenMethod @ZenMethod
public static void addRecipe(int packagingTime, ILiquidStack liquid, IItemStack product, IItemStack[] ingredients, IItemStack ingredient) { public static void addRecipe(int packagingTime, ILiquidStack liquid, IItemStack[] ingredients, IItemStack ingredient, IItemStack product) {
ArrayList<ItemStack> stacks = new ArrayList<ItemStack>(); ArrayList<ItemStack> stacks = new ArrayList<ItemStack>();
for (ItemStack stack : toStacks(ingredients)) { for (ItemStack stack : toStacks(ingredients)) {
if (stack != null) { if (stack != null) {

View file

@ -22,7 +22,7 @@ import forestry.factory.gadgets.MachineCentrifuge.RecipeManager;
public class Centrifuge { public class Centrifuge {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack[] output, int[] chances, int timePerItem, IItemStack itemInput) { public static void addRecipe(int timePerItem, IItemStack itemInput, int[] chances, IItemStack[] output) {
HashMap<ItemStack, Integer> products = new HashMap<ItemStack, Integer>(); HashMap<ItemStack, Integer> products = new HashMap<ItemStack, Integer>();
// products.put(toStack(output[0]), chances[0]); // products.put(toStack(output[0]), chances[0]);
int i = 0; int i = 0;

View file

@ -22,7 +22,7 @@ import forestry.factory.gadgets.MachineFermenter.RecipeManager;
public class Fermenter { public class Fermenter {
@ZenMethod @ZenMethod
public static void addRecipe(IItemStack resource, int fermentationValue, float modifier, ILiquidStack output, ILiquidStack liquid) { public static void addRecipe(IItemStack resource, ILiquidStack liquid, int fermentationValue, float modifier, ILiquidStack output) {
MineTweakerAPI.apply(new Add(new Recipe(toStack(resource), fermentationValue, modifier, toFluid(output), toFluid(liquid)))); MineTweakerAPI.apply(new Add(new Recipe(toStack(resource), fermentationValue, modifier, toFluid(output), toFluid(liquid))));
MachineFermenter.RecipeManager.recipeFluidInputs.add(getFluid(liquid)); MachineFermenter.RecipeManager.recipeFluidInputs.add(getFluid(liquid));
MachineFermenter.RecipeManager.recipeFluidOutputs.add(getFluid(output)); MachineFermenter.RecipeManager.recipeFluidOutputs.add(getFluid(output));

View file

@ -40,14 +40,14 @@ public class Squeezer {
} }
@ZenMethod @ZenMethod
public static void removeRecipe(ILiquidStack output) { public static void removeRecipe(ILiquidStack liquid) {
MineTweakerAPI.apply(new Remove(MachineSqueezer.RecipeManager.recipes, toFluid(output))); MineTweakerAPI.apply(new Remove(MachineSqueezer.RecipeManager.recipes, toFluid(liquid)));
} }
private static class Remove extends BaseListRemoval { private static class Remove extends BaseListRemoval {
public Remove(List list, FluidStack stack) { public Remove(List list, FluidStack liquid) {
super(list, stack); super(list, liquid);
} }

View file

@ -29,7 +29,7 @@ public class ThermionicFabricator {
//first production step: smelting item into liquid //first production step: smelting item into liquid
@ZenMethod @ZenMethod
public static void addSmelting(IItemStack itemInput, int fluidOutput, int meltingPoint) { public static void addSmelting(IItemStack itemInput, int meltingPoint, int fluidOutput) {
//The machines internal tank accept only liquid glass, therefor this function only accept the amount and hardcode the fluid to glass //The machines internal tank accept only liquid glass, therefor this function only accept the amount and hardcode the fluid to glass
MineTweakerAPI.apply(new Add(new Smelting(toStack(itemInput), FluidRegistry.getFluidStack("glass", fluidOutput), meltingPoint))); MineTweakerAPI.apply(new Add(new Smelting(toStack(itemInput), FluidRegistry.getFluidStack("glass", fluidOutput), meltingPoint)));
} }

View file

@ -0,0 +1,10 @@
package modtweaker.mods.imc;
import java.util.ArrayList;
import java.util.List;
public class IMC {
public static ArrayList<ArrayList<String>> IMCmessages = new ArrayList<ArrayList<String>>();
}

View file

@ -0,0 +1,50 @@
package modtweaker.mods.imc.handler;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.util.ArrayList;
import java.util.Scanner;
import cpw.mods.fml.common.event.FMLInterModComms;
public class Message {
public static String destination;
public File[] files;
public Scanner fileReader;
public Message(String destination) {
this.destination = destination;
files = new File(destination).listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
if (name.toLowerCase().endsWith(".imc")) {
return true;
}
return false;
}
});
for (File file : files) {
try {
this.fileReader = new Scanner(file);
while (fileReader.hasNextLine()) {
String command = fileReader.nextLine().trim();
if (command.toLowerCase().startsWith("sendimc(") && command.substring(command.length() - 1).equals(";")) {
command = command.substring("sendimc(".length()).replace(command.substring(command.length() - 1), "").replace(command.substring(command.length() - 1), "").replaceAll("\"", "");
String[] input = command.split(",");
FMLInterModComms.sendMessage(input[0], input[1], input[2]);
System.out.println(input[0] + ", " + input[1] + ", " + input[2]);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
}
}