Compare commits

...

13 commits

Author SHA1 Message Date
c09e3dfe09 feat: add Auracore infusion & research compat 2023-01-23 22:13:21 +01:00
bfb5c7d474 fix: use camelCase for remove fuel
Closes #1
2023-01-05 12:31:18 +01:00
ca09d6e5a9 chore: bump version 2022-12-18 16:17:58 +01:00
49c9bdfe2c feat: add auracore compat 2022-12-16 21:39:00 +01:00
6de4ad874b feat: Mekanism Theoretical Elementizer compat 2022-11-22 22:44:33 +01:00
Tobias Wohlfarth
44bb751d54 Version Bump: 0.9.6 2016-07-06 12:01:52 +02:00
Tobias Wohlfarth
e74070a030 Fix #327 : FSP support now Minetweaker itself 2016-06-17 19:26:18 +02:00
Tobias Wohlfarth
64fdb57b81 fix #320 : mistake up getPercent() and getChance() 2016-04-07 05:48:38 +02:00
Tobias Wohlfarth
23eb3a6461 fix #308 : Mekanism - import missing ZenClasses for Gases 2016-03-04 17:41:57 +01:00
Tobias Wohlfarth
ddd78e9dbd Merge pull request #302 from yrsegal/master
Add Botanical Addons support
2016-03-04 00:33:34 +01:00
Tobias Wohlfarth
5c520e853c Changed GasLogger format to CSV, similar to stanhebben/MineTweaker3#133 2016-03-03 00:26:07 +01:00
Tobias Wohlfarth
be46a8343d Corrected Mekanism Machine Names 2016-03-03 00:17:07 +01:00
yrsegal
2aa238a9eb Add Botanical Addons support 2016-02-09 19:49:19 -05:00
36 changed files with 922 additions and 290 deletions

View file

@ -1,24 +1,39 @@
# Change Log # Change Log
## [0.9.6](https://github.com/jaredlll08/ModTweaker2/tree/0.9.6) (2016-07-06)
[Full Changelog](https://github.com/jaredlll08/ModTweaker2/compare/0.9.5...0.9.6)
**Implemented enhancements:**
- \[Request\] Botanical Addons \(Botania\) support [\#301](https://github.com/jaredlll08/ModTweaker2/issues/301)
**Fixed bugs:**
- Remove FSP integration [\#327](https://github.com/jaredlll08/ModTweaker2/issues/327)
- \[1.7.10\] \[BUG\] Cannot specify low byproduct chance for Forestry squeezer [\#320](https://github.com/jaredlll08/ModTweaker2/issues/320)
- Importing some ModTweaker classes in ZenScript fails [\#308](https://github.com/jaredlll08/ModTweaker2/issues/308)
- Missing 'name' parameter in line 182 of modtweaker2.mods.exnihilo.mods.handler.Hammer results in script failure when no recipe found. [\#297](https://github.com/jaredlll08/ModTweaker2/issues/297)
## [0.9.5](https://github.com/jaredlll08/ModTweaker2/tree/0.9.5) (2015-12-07) ## [0.9.5](https://github.com/jaredlll08/ModTweaker2/tree/0.9.5) (2015-12-07)
[Full Changelog](https://github.com/jaredlll08/ModTweaker2/compare/0.9.4...0.9.5) [Full Changelog](https://github.com/jaredlll08/ModTweaker2/compare/0.9.4...0.9.5)
**Implemented enhancements:** **Implemented enhancements:**
- Added WeightedItemStack Handlers [\#275](https://github.com/jaredlll08/ModTweaker2/issues/275) - Added WeightedItemStack Handlers [\#275](https://github.com/jaredlll08/ModTweaker2/issues/275)
- \[Request Feature\] TinkerConstruct support: a way to disable a modifier [\#238](https://github.com/jaredlll08/ModTweaker2/issues/238)
**Fixed bugs:** **Fixed bugs:**
- Crash with Forestry 4.0 [\#252](https://github.com/jaredlll08/ModTweaker2/issues/252) - Crash with Forestry 4.0 [\#252](https://github.com/jaredlll08/ModTweaker2/issues/252)
**Closed issues:**
- \[Request Feature\] TinkerConstruct support: a way to disable a modifier [\#238](https://github.com/jaredlll08/ModTweaker2/issues/238)
## [0.9.4](https://github.com/jaredlll08/ModTweaker2/tree/0.9.4) (2015-10-12) ## [0.9.4](https://github.com/jaredlll08/ModTweaker2/tree/0.9.4) (2015-10-12)
**Implemented enhancements:** **Implemented enhancements:**
- QED Table remove funktion missing [\#245](https://github.com/jaredlll08/ModTweaker2/issues/245) - QED Table remove funktion missing [\#245](https://github.com/jaredlll08/ModTweaker2/issues/245)
- \[Suggestion\] Oredicted Recipes QED Table [\#242](https://github.com/jaredlll08/ModTweaker2/issues/242) - \[Suggestion\] Oredicted Recipes QED Table [\#242](https://github.com/jaredlll08/ModTweaker2/issues/242)
- \[Request\] Allow oredict usage in Forestry Carpenter [\#192](https://github.com/jaredlll08/ModTweaker2/issues/192)
- Updated ToolStats based on new TConstruct API [\#232](https://github.com/jaredlll08/ModTweaker2/pull/232) ([blade1981m](https://github.com/blade1981m))
**Fixed bugs:** **Fixed bugs:**
@ -29,6 +44,10 @@
- mekanism chemicalInfuser MineTweakerAPI.apply call; incorrect param [\#213](https://github.com/jaredlll08/ModTweaker2/issues/213) - mekanism chemicalInfuser MineTweakerAPI.apply call; incorrect param [\#213](https://github.com/jaredlll08/ModTweaker2/issues/213)
- \[AE2 Inscriber\] Error msg [\#200](https://github.com/jaredlll08/ModTweaker2/issues/200) - \[AE2 Inscriber\] Error msg [\#200](https://github.com/jaredlll08/ModTweaker2/issues/200)
**Closed issues:**
- \[Request\] Allow oredict usage in Forestry Carpenter [\#192](https://github.com/jaredlll08/ModTweaker2/issues/192)
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*

View file

@ -22,6 +22,7 @@ Supported Mods
- Applied Energistics 2 - Applied Energistics 2
- Auracascade - Auracascade
- Botania - Botania
- Botanical Addons
- Chisel - Chisel
- ExNihilo - ExNihilo
- ExtendedWorkbench - ExtendedWorkbench

View file

@ -11,13 +11,19 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' classpath ('com.anatawa12.forge:ForgeGradle:1.2-1.0.+') {
changing = true
}
} }
} }
apply plugin: 'forge' apply plugin: 'forge'
apply plugin: 'maven-publish'
apply plugin: 'java' apply plugin: 'java'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// define the properties file // define the properties file
ext.configFile = file "build.properties" ext.configFile = file "build.properties"
configFile.withReader { configFile.withReader {
@ -40,12 +46,19 @@ minecraft {
repositories { repositories {
maven { maven {
name = "forestry" name = "forestry"
url = "http://maven.ic2.player.to/" url = "https://maven.ic2.player.to/"
metadataSources {
artifact()
}
}
maven {
url = "https://maven.tilera.xyz"
} }
} }
dependencies { dependencies {
compile "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:api" implementation "dev.tilera:auracore:1.8.0:deobf"
implementation "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:api"
} }
processResources processResources
@ -74,3 +87,36 @@ task deobfJar(type: Jar) {
} }
tasks.build.dependsOn deobfJar tasks.build.dependsOn deobfJar
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifactId = project.archivesBaseName
artifact deobfJar
artifact sourcesJar
artifact jar
}
}
repositories {
if (project.hasProperty('mvnURL')) {
maven {
credentials {
username findProperty("mvnUsername")
password findProperty("mvnPassword")
}
url = findProperty("mvnURL")
}
}
else {
mavenLocal()
}
}
}

View file

@ -1,6 +1,6 @@
minecraft.version=1.7.10 minecraft.version=1.7.10
forge.version=10.13.4.1448-1.7.10 forge.version=10.13.4.1614-1.7.10
mod.version=0.9.5 mod.version=0.11.0
forestry.version=4.1.0.43 forestry.version=4.1.0.43

View file

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.1-bin.zip

Binary file not shown.

View file

@ -12,6 +12,7 @@ import modtweaker2.mods.botania.commands.BotaniaOrechidLogger;
import modtweaker2.mods.botania.lexicon.commands.LexiconCategoryLogger; import modtweaker2.mods.botania.lexicon.commands.LexiconCategoryLogger;
import modtweaker2.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger; import modtweaker2.mods.botania.lexicon.commands.LexiconKnowledgeTypesLogger;
import modtweaker2.mods.botania.lexicon.commands.LexiconPageLogger; import modtweaker2.mods.botania.lexicon.commands.LexiconPageLogger;
import modtweaker2.mods.botanicaladdons.commands.BotanicalAddonsDendricLogger;
import modtweaker2.mods.chisel.commands.ChiselGroupLogger; import modtweaker2.mods.chisel.commands.ChiselGroupLogger;
import modtweaker2.mods.chisel.commands.ChiselVariationLogger; import modtweaker2.mods.chisel.commands.ChiselVariationLogger;
import modtweaker2.mods.exnihilo.commands.ExNihiloLogger; import modtweaker2.mods.exnihilo.commands.ExNihiloLogger;
@ -58,6 +59,10 @@ public class Commands {
MineTweakerAPI.server.addMineTweakerCommand("botania", new String[] { "/minetweaker botania [HANDLER]", " Outputs a list of all Botania recipes." }, new BotaniaLogger()); MineTweakerAPI.server.addMineTweakerCommand("botania", new String[] { "/minetweaker botania [HANDLER]", " Outputs a list of all Botania recipes." }, new BotaniaLogger());
} }
if (TweakerPlugin.isLoaded("shadowfox_botany")) {
MineTweakerAPI.server.addMineTweakerCommand("treeCrafting", new String[] { "/minetweaker treeCrafting", " Outputs a list of all Botanical Addons Tree Crafting recipes." }, new BotanicalAddonsDendricLogger());
}
if (TweakerPlugin.isLoaded("chisel")) { if (TweakerPlugin.isLoaded("chisel")) {
MineTweakerAPI.server.addMineTweakerCommand("chiselGroups", new String[] { "/minetweaker chiselGroups", " Outputs a list of chisel groups" }, new ChiselGroupLogger()); MineTweakerAPI.server.addMineTweakerCommand("chiselGroups", new String[] { "/minetweaker chiselGroups", " Outputs a list of chisel groups" }, new ChiselGroupLogger());
MineTweakerAPI.server.addMineTweakerCommand("chiselVariations", new String[] { "/minetweaker chiselVariations", "/minetweaker chiselVariations [GROUP]", " Outputs a list of chisel variations" }, new ChiselVariationLogger()); MineTweakerAPI.server.addMineTweakerCommand("chiselVariations", new String[] { "/minetweaker chiselVariations", "/minetweaker chiselVariations [GROUP]", " Outputs a list of chisel variations" }, new ChiselVariationLogger());

View file

@ -8,14 +8,15 @@ import minetweaker.runtime.providers.ScriptProviderDirectory;
import minetweaker.util.IEventHandler; import minetweaker.util.IEventHandler;
import modtweaker2.mods.appeng.AppliedEnergistics; import modtweaker2.mods.appeng.AppliedEnergistics;
import modtweaker2.mods.auracascade.AuraCascade; import modtweaker2.mods.auracascade.AuraCascade;
import modtweaker2.mods.auracore.AuraCore;
import modtweaker2.mods.botania.Botania; import modtweaker2.mods.botania.Botania;
import modtweaker2.mods.botanicaladdons.BotanicalAddons;
import modtweaker2.mods.chisel.Chisel; import modtweaker2.mods.chisel.Chisel;
import modtweaker2.mods.exnihilo.ExNihilo; import modtweaker2.mods.exnihilo.ExNihilo;
import modtweaker2.mods.extendedworkbench.ExtendedWorkbench; import modtweaker2.mods.extendedworkbench.ExtendedWorkbench;
import modtweaker2.mods.extraUtils.ExtraUtils; import modtweaker2.mods.extraUtils.ExtraUtils;
import modtweaker2.mods.factorization.Factorization; import modtweaker2.mods.factorization.Factorization;
import modtweaker2.mods.forestry.Forestry; import modtweaker2.mods.forestry.Forestry;
import modtweaker2.mods.fsp.Steamcraft;
import modtweaker2.mods.ic2c.IC2C; import modtweaker2.mods.ic2c.IC2C;
import modtweaker2.mods.mariculture.Mariculture; import modtweaker2.mods.mariculture.Mariculture;
import modtweaker2.mods.mekanism.Mekanism; import modtweaker2.mods.mekanism.Mekanism;
@ -65,6 +66,7 @@ public class ModTweaker2 {
logger.info("Starting Initialization for " + ModProps.modid); logger.info("Starting Initialization for " + ModProps.modid);
TweakerPlugin.register("appliedenergistics2-core", AppliedEnergistics.class); TweakerPlugin.register("appliedenergistics2-core", AppliedEnergistics.class);
TweakerPlugin.register("Botania", Botania.class); TweakerPlugin.register("Botania", Botania.class);
TweakerPlugin.register("shadowfox_botany", BotanicalAddons.class);
TweakerPlugin.register("exnihilo", ExNihilo.class); TweakerPlugin.register("exnihilo", ExNihilo.class);
TweakerPlugin.register("extendedWorkbench", ExtendedWorkbench.class); TweakerPlugin.register("extendedWorkbench", ExtendedWorkbench.class);
TweakerPlugin.register("factorization", Factorization.class); TweakerPlugin.register("factorization", Factorization.class);
@ -73,7 +75,6 @@ public class ModTweaker2 {
TweakerPlugin.register("Metallurgy", Metallurgy.class); TweakerPlugin.register("Metallurgy", Metallurgy.class);
TweakerPlugin.register("PneumaticCraft", PneumaticCraft.class); TweakerPlugin.register("PneumaticCraft", PneumaticCraft.class);
TweakerPlugin.register("Railcraft", Railcraft.class); TweakerPlugin.register("Railcraft", Railcraft.class);
TweakerPlugin.register("Steamcraft", Steamcraft.class);
TweakerPlugin.register("TConstruct", TConstruct.class); TweakerPlugin.register("TConstruct", TConstruct.class);
TweakerPlugin.register("Thaumcraft", Thaumcraft.class); TweakerPlugin.register("Thaumcraft", Thaumcraft.class);
TweakerPlugin.register("ThermalExpansion", ThermalExpansion.class); TweakerPlugin.register("ThermalExpansion", ThermalExpansion.class);
@ -82,6 +83,7 @@ public class ModTweaker2 {
TweakerPlugin.register("aura", AuraCascade.class); TweakerPlugin.register("aura", AuraCascade.class);
TweakerPlugin.register("ExtraUtilities", ExtraUtils.class); TweakerPlugin.register("ExtraUtilities", ExtraUtils.class);
TweakerPlugin.register("IC2", IC2C.class); TweakerPlugin.register("IC2", IC2C.class);
TweakerPlugin.register("auracore", AuraCore.class);
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) { if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {

View file

@ -0,0 +1,68 @@
package modtweaker2.mods.auracore;
import dev.tilera.auracore.api.AuracoreRecipes;
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
import dev.tilera.auracore.api.research.ResearchPageCrucible;
import minetweaker.IUndoableAction;
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchPage;
public class AddCruciblePage implements IUndoableAction {
String key;
String tab;
ResearchPage page;
ResearchPage[] oldPages;
String recipeKey;
public AddCruciblePage(String research, String key) {
this.key = research;
this.tab = ThaumcraftHelper.getResearchTab(this.key);
this.recipeKey = key;
}
@Override
public void apply() {
for (CrucibleRecipe rec : AuracoreRecipes.getCrucibleRecipes()) {
if (rec.key.equals(recipeKey)) {
page = new ResearchPageCrucible(rec);
break;
}
}
if (page == null) return;
oldPages = ResearchCategories.researchCategories.get(tab).research.get(key).getPages();
if (oldPages == null) oldPages = new ResearchPage[0];
ResearchPage[] newPages = new ResearchPage[oldPages.length + 1];
for (int x = 0; x < oldPages.length; x++) {
newPages[x] = oldPages[x];
}
newPages[oldPages.length] = page;
ResearchCategories.researchCategories.get(tab).research.get(key).setPages(newPages);
}
@Override
public String describe() {
return "Adding Research Page to " + key;
}
@Override
public boolean canUndo() {
return oldPages != null;
}
@Override
public void undo() {
ResearchCategories.researchCategories.get(tab).research.get(key).setPages(oldPages);
}
@Override
public String describeUndo() {
return "Removing Page from " + key;
}
@Override
public String getOverrideKey() {
return null;
}
}

View file

@ -0,0 +1,68 @@
package modtweaker2.mods.auracore;
import dev.tilera.auracore.api.AuracoreRecipes;
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
import dev.tilera.auracore.api.research.ResearchPageInfusion;
import minetweaker.IUndoableAction;
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchPage;
public class AddInfusionPage implements IUndoableAction {
String key;
String tab;
ResearchPage page;
ResearchPage[] oldPages;
String recipeKey;
public AddInfusionPage(String research, String key) {
this.key = research;
this.tab = ThaumcraftHelper.getResearchTab(this.key);
this.recipeKey = key;
}
@Override
public void apply() {
for (IInfusionRecipe rec : AuracoreRecipes.getInfusionRecipes()) {
if (rec.getKey().equals(recipeKey)) {
page = new ResearchPageInfusion(rec);
break;
}
}
if (page == null) return;
oldPages = ResearchCategories.researchCategories.get(tab).research.get(key).getPages();
if (oldPages == null) oldPages = new ResearchPage[0];
ResearchPage[] newPages = new ResearchPage[oldPages.length + 1];
for (int x = 0; x < oldPages.length; x++) {
newPages[x] = oldPages[x];
}
newPages[oldPages.length] = page;
ResearchCategories.researchCategories.get(tab).research.get(key).setPages(newPages);
}
@Override
public String describe() {
return "Adding Research Page to " + key;
}
@Override
public boolean canUndo() {
return oldPages != null;
}
@Override
public void undo() {
ResearchCategories.researchCategories.get(tab).research.get(key).setPages(oldPages);
}
@Override
public String describeUndo() {
return "Removing Page from " + key;
}
@Override
public String getOverrideKey() {
return null;
}
}

View file

@ -0,0 +1,17 @@
package modtweaker2.mods.auracore;
import minetweaker.MineTweakerAPI;
import modtweaker2.mods.auracore.handlers.Crucible;
import modtweaker2.mods.auracore.handlers.Infusion;
import modtweaker2.mods.auracore.handlers.Research;
import modtweaker2.utils.TweakerPlugin;
public class AuraCore extends TweakerPlugin {
public AuraCore() {
MineTweakerAPI.registerClass(Crucible.class);
MineTweakerAPI.registerClass(Infusion.class);
MineTweakerAPI.registerClass(Research.class);
}
}

View file

@ -0,0 +1,75 @@
package modtweaker2.mods.auracore.handlers;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.StackHelper.matches;
import java.util.LinkedList;
import java.util.List;
import dev.tilera.auracore.api.AuracoreRecipes;
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.LogHelper;
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.auracore.Crucible")
public class Crucible {
public static final String name = "Auracore Crucible";
@ZenMethod
public static void addRecipe(String key, IItemStack result, int cost, String aspects) {
MineTweakerAPI.apply(new Add(new CrucibleRecipe(key, toStack(result), ThaumcraftHelper.parseAspects(aspects), cost)));
}
private static class Add extends BaseListAddition<CrucibleRecipe> {
public Add(CrucibleRecipe recipe) {
super(Crucible.name, AuracoreRecipes.getCrucibleRecipes());
recipes.add(recipe);
}
@Override
protected String getRecipeInfo(CrucibleRecipe recipe) {
return LogHelper.getStackDescription(recipe.recipeOutput);
}
}
// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ZenMethod
public static void removeRecipe(IIngredient output) {
List<CrucibleRecipe> recipes = new LinkedList<CrucibleRecipe>();
for (Object o : AuracoreRecipes.getCrucibleRecipes()) {
if (o instanceof CrucibleRecipe) {
CrucibleRecipe r = (CrucibleRecipe) o;
if (r.recipeOutput != null && matches(output, toIItemStack(r.recipeOutput))) {
recipes.add(r);
}
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", Crucible.name, output.toString()));
}
}
private static class Remove extends BaseListRemoval<CrucibleRecipe> {
public Remove(List<CrucibleRecipe> recipes) {
super(Crucible.name, AuracoreRecipes.getCrucibleRecipes(), recipes);
}
@Override
protected String getRecipeInfo(CrucibleRecipe recipe) {
return LogHelper.getStackDescription(recipe.recipeOutput);
}
}
}

View file

@ -0,0 +1,102 @@
package modtweaker2.mods.auracore.handlers;
import static modtweaker2.helpers.InputHelper.toStacks;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.StackHelper.matches;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import dev.tilera.auracore.api.AuracoreRecipes;
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
import dev.tilera.auracore.api.crafting.ShapedInfusionCraftingRecipe;
import dev.tilera.auracore.api.crafting.ShapelessInfusionCraftingRecipe;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.LogHelper;
import modtweaker2.mods.thaumcraft.ThaumcraftHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.auracore.Infusion")
public class Infusion {
public static final String name = "Auracore Infusion Altar";
@ZenMethod
public static void addShaped(String key, String research, int cost, IItemStack output, String aspects, IItemStack[][] ingredients) {
List<ItemStack> stacks = new ArrayList<>();
int width = 0;
int height = 0;
for(IItemStack[] row : ingredients) {
height++;
width = Math.max(width, row.length);
for (IItemStack i : row) {
stacks.add(toStack(i));
}
}
MineTweakerAPI.apply(new Add(new ShapedInfusionCraftingRecipe(key, research, width, height, stacks.toArray(new ItemStack[stacks.size()]), toStack(output), cost, ThaumcraftHelper.parseAspects(aspects))));
}
@ZenMethod
public static void addShapeless(String key, String research, int cost, IItemStack output, String aspects, IItemStack[] ingredients) {
MineTweakerAPI.apply(new Add(new ShapelessInfusionCraftingRecipe(key, research, toStack(output), Arrays.asList(toStacks(ingredients)), cost, ThaumcraftHelper.parseAspects(aspects))));
}
private static class Add extends BaseListAddition<IInfusionRecipe> {
public Add(IInfusionRecipe recipe) {
super(Infusion.name, AuracoreRecipes.getInfusionRecipes());
recipes.add(recipe);
}
@Override
protected String getRecipeInfo(IInfusionRecipe recipe) {
ItemStack stack = recipe.getRecipeOutput();
if(stack instanceof ItemStack)
return LogHelper.getStackDescription(stack);
else
return "Unknown output";
}
}
@ZenMethod
public static void removeRecipe(IItemStack output) {
List<IInfusionRecipe> recipes = new LinkedList<IInfusionRecipe>();
for(IInfusionRecipe recipe : AuracoreRecipes.getInfusionRecipes()) {
if(recipe.getRecipeOutput() != null && matches(output, toIItemStack(recipe.getRecipeOutput()))) {
recipes.add(recipe);
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command Ignored", Infusion.name, output.toString()));
}
}
private static class Remove extends BaseListRemoval<IInfusionRecipe> {
public Remove(List<IInfusionRecipe> recipes) {
super(Infusion.name, AuracoreRecipes.getInfusionRecipes(), recipes);
}
@Override
protected String getRecipeInfo(IInfusionRecipe recipe) {
ItemStack stack = recipe.getRecipeOutput();
if(stack instanceof ItemStack)
return LogHelper.getStackDescription(stack);
else
return "Unknown output";
}
}
}

View file

@ -0,0 +1,22 @@
package modtweaker2.mods.auracore.handlers;
import minetweaker.MineTweakerAPI;
import modtweaker2.mods.auracore.AddCruciblePage;
import modtweaker2.mods.auracore.AddInfusionPage;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.auracore.Research")
public class Research {
@ZenMethod
public static void addInfusionPage(String research, String recipe) {
MineTweakerAPI.apply(new AddInfusionPage(research, recipe));
}
@ZenMethod
public static void addCruciblePage(String research, String recipe) {
MineTweakerAPI.apply(new AddCruciblePage(research, recipe));
}
}

View file

@ -0,0 +1,12 @@
package modtweaker2.mods.botanicaladdons;
import minetweaker.MineTweakerAPI;
import modtweaker2.mods.botanicaladdons.handlers.DendricSuffuser;
import modtweaker2.mods.botanicaladdons.handlers.IridescentTree;
public class BotanicalAddons {
public BotanicalAddons() {
MineTweakerAPI.registerClass(DendricSuffuser.class);
MineTweakerAPI.registerClass(IridescentTree.class);
}
}

View file

@ -0,0 +1,29 @@
package modtweaker2.mods.botanicaladdons.commands;
import minetweaker.MineTweakerAPI;
import minetweaker.MineTweakerImplementationAPI;
import minetweaker.api.player.IPlayer;
import minetweaker.api.server.ICommandFunction;
import modtweaker2.helpers.LogHelper;
import ninja.shadowfox.shadowfox_botany.api.ShadowFoxAPI;
import ninja.shadowfox.shadowfox_botany.api.recipe.RecipeTreeCrafting;
public class BotanicalAddonsDendricLogger implements ICommandFunction{
@Override
public void execute(String[] arguments, IPlayer player) {
System.out.println("Recipes: " + ShadowFoxAPI.treeRecipes.size());
for (RecipeTreeCrafting recipe : ShadowFoxAPI.treeRecipes) {
MineTweakerAPI.logCommand(String.format("mods.botanicaladdons.DendricSuffuser.addRecipe(%s, %s, %s, %s);",
LogHelper.getStackDescription(recipe.getOutput()),
recipe.getManaUsage(),
recipe.getThrottle(),
LogHelper.getListDescription(recipe.getInputs())
));
}
if (player != null) {
player.sendChat(MineTweakerImplementationAPI.platform.getMessage("List generated; see minetweaker.log in your minecraft dir"));
}
}
}

View file

@ -0,0 +1,93 @@
package modtweaker2.mods.botanicaladdons.handlers;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.InputHelper;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import ninja.shadowfox.shadowfox_botany.api.ShadowFoxAPI;
import ninja.shadowfox.shadowfox_botany.api.recipe.RecipeTreeCrafting;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import java.util.LinkedList;
import java.util.List;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toObjects;
import static modtweaker2.helpers.StackHelper.matches;
@ZenClass("mods.botanicaladdons.DendricSuffuser")
public class DendricSuffuser {
protected static final String name = "Botanical Addons Dendric Suffuser";
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ZenMethod
public static void addRecipe(IItemStack blockOutput, int mana, int throttle, IIngredient[] input) {
Object output = InputHelper.toObject(blockOutput);
if(output == null || !(output instanceof ItemStack) || !InputHelper.isABlock((ItemStack)output)) {
LogHelper.logError("Output must be a block.");
return;
}
MineTweakerAPI.apply(new Add(new RecipeTreeCrafting(mana, Block.getBlockFromItem(((ItemStack)output).getItem()),
((ItemStack)output).getItemDamage(), throttle, toObjects(input))));
}
@ZenMethod
public static void addRecipe(IItemStack blockOutput, int mana, IIngredient[] input) {
addRecipe(blockOutput, mana, -1, input);
}
private static class Add extends BaseListAddition<RecipeTreeCrafting> {
public Add(RecipeTreeCrafting recipe) {
super(DendricSuffuser.name, ShadowFoxAPI.treeRecipes);
recipes.add(recipe);
}
@Override
public String getRecipeInfo(RecipeTreeCrafting recipe) {
return LogHelper.getStackDescription(recipe.getOutput());
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ZenMethod
public static void removeRecipe(IItemStack output) {
// Get list of existing recipes, matching with parameter
List<RecipeTreeCrafting> recipes = new LinkedList<RecipeTreeCrafting>();
for (RecipeTreeCrafting r : ShadowFoxAPI.treeRecipes) {
if (r != null && r.getOutput() != null && matches(output, toIItemStack(r.getOutput()))) {
recipes.add(r);
}
}
// Check if we found the recipes and apply the action
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", DendricSuffuser.name, output.toString()));
}
}
private static class Remove extends BaseListRemoval<RecipeTreeCrafting> {
public Remove(List<RecipeTreeCrafting> recipes) {
super(DendricSuffuser.name, ShadowFoxAPI.treeRecipes, recipes);
}
@Override
public String getRecipeInfo(RecipeTreeCrafting recipe) {
return LogHelper.getStackDescription(recipe.getOutput());
}
}
}

View file

@ -0,0 +1,119 @@
package modtweaker2.mods.botanicaladdons.handlers;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.InputHelper;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import ninja.shadowfox.shadowfox_botany.api.ShadowFoxAPI;
import ninja.shadowfox.shadowfox_botany.api.trees.IIridescentSaplingVariant;
import ninja.shadowfox.shadowfox_botany.api.trees.IridescentSaplingBaseVariant;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import java.util.LinkedList;
import java.util.List;
@ZenClass("mods.botanicaladdons.IridescentTree")
public class IridescentTree {
protected static final String name = "Botanical Addons Iridescent Tree";
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ZenMethod
public static void addVariant(IItemStack blockSoil, IItemStack blockWood, IItemStack blockLeaves, int metaMin, int metaMax, int metaShift) {
Object soil = InputHelper.toObject(blockSoil);
Object wood = InputHelper.toObject(blockWood);
Object leaves = InputHelper.toObject(blockLeaves);
if (soil == null || !(soil instanceof ItemStack) || !InputHelper.isABlock((ItemStack)soil)) {
LogHelper.logError("Soil must be a block.");
return;
}
else if (wood == null || !(wood instanceof ItemStack) || !InputHelper.isABlock((ItemStack)wood)) {
LogHelper.logError("Wood must be a block.");
return;
}
else if(leaves == null || !(leaves instanceof ItemStack) || !InputHelper.isABlock((ItemStack)leaves)) {
LogHelper.logError("Leaves must be a block.");
return;
}
Block soilBlock = Block.getBlockFromItem(((ItemStack)soil).getItem());
Block woodBlock = Block.getBlockFromItem(((ItemStack)wood).getItem());
Block leavesBlock = Block.getBlockFromItem(((ItemStack)leaves).getItem());
MineTweakerAPI.apply(new Add(new IridescentSaplingBaseVariant(soilBlock, woodBlock, leavesBlock, metaMin, metaMax, metaShift)));
}
@ZenMethod
public static void addVariant(IItemStack blockSoil, IItemStack blockWood, IItemStack blockLeaves, int metaMin, int metaMax) {
addVariant(blockSoil, blockWood, blockLeaves, metaMin, metaMax, 0);
}
@ZenMethod
public static void addVariant(IItemStack blockSoil, IItemStack blockWood, IItemStack blockLeaves, int meta) {
addVariant(blockSoil, blockWood, blockLeaves, meta, meta, 0);
}
@ZenMethod
public static void addVariant(IItemStack blockSoil, IItemStack blockWood, IItemStack blockLeaves) {
addVariant(blockSoil, blockWood, blockLeaves, 0, 15, 0);
}
private static class Add extends BaseListAddition<IIridescentSaplingVariant> {
public Add(IIridescentSaplingVariant recipe) {
super(IridescentTree.name, ShadowFoxAPI.treeVariants);
recipes.add(recipe);
}
@Override
public String getRecipeInfo(IIridescentSaplingVariant recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getAcceptableSoils().get(0)));
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ZenMethod
public static void removeRecipe(IItemStack blockSoil) {
// Get list of existing recipes, matching with parameter
Object soil = InputHelper.toObject(blockSoil);
if (soil == null || !(soil instanceof ItemStack) || !InputHelper.isABlock((ItemStack)soil)) {
LogHelper.logError("Soil must be a block.");
return;
}
Block soilBlock = Block.getBlockFromItem(((ItemStack)soil).getItem());
List<IIridescentSaplingVariant> recipes = new LinkedList<IIridescentSaplingVariant>();
for (IIridescentSaplingVariant r : ShadowFoxAPI.treeVariants) {
if (r != null && r instanceof IridescentSaplingBaseVariant && r.getAcceptableSoils().get(0) == soilBlock) {
recipes.add(r);
}
}
// Check if we found the recipes and apply the action
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new Remove(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", IridescentTree.name, soilBlock.toString()));
}
}
private static class Remove extends BaseListRemoval<IIridescentSaplingVariant> {
public Remove(List<IIridescentSaplingVariant> recipes) {
super(IridescentTree.name, ShadowFoxAPI.treeVariants, recipes);
}
@Override
public String getRecipeInfo(IIridescentSaplingVariant recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getAcceptableSoils().get(0)));
}
}
}

View file

@ -56,7 +56,7 @@ public class Squeezer {
*/ */
@ZenMethod @ZenMethod
public static void addRecipe(ILiquidStack fluidOutput, WeightedItemStack itemOutput, IItemStack[] ingredients, int timePerItem) { public static void addRecipe(ILiquidStack fluidOutput, WeightedItemStack itemOutput, IItemStack[] ingredients, int timePerItem) {
MineTweakerAPI.apply(new Add(new SqueezerRecipe(timePerItem, toStacks(ingredients), toFluid(fluidOutput), toStack(itemOutput.getStack()), (int) itemOutput.getPercent()))); MineTweakerAPI.apply(new Add(new SqueezerRecipe(timePerItem, toStacks(ingredients), toFluid(fluidOutput), toStack(itemOutput.getStack()), itemOutput.getChance())));
} }
@ZenMethod @ZenMethod

View file

@ -1,16 +0,0 @@
package modtweaker2.mods.fsp;
import flaxbeard.steamcraft.api.CrucibleLiquid;
import flaxbeard.steamcraft.api.SteamcraftRegistry;
public class FSPHelper {
public static CrucibleLiquid getLiquid(String name) {
for (CrucibleLiquid l : SteamcraftRegistry.liquids) {
if (l.name.equals(name)) {
return l;
}
}
return null;
}
}

View file

@ -1,12 +0,0 @@
package modtweaker2.mods.fsp;
import minetweaker.MineTweakerAPI;
import modtweaker2.mods.fsp.handlers.Crucible;
import modtweaker2.mods.fsp.handlers.Furnace;
public class Steamcraft {
public Steamcraft() {
MineTweakerAPI.registerClass(Crucible.class);
MineTweakerAPI.registerClass(Furnace.class);
}
}

View file

@ -1,160 +0,0 @@
package modtweaker2.mods.fsp.handlers;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.StackHelper.matches;
import static modtweaker2.mods.fsp.FSPHelper.getLiquid;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseMapAddition;
import modtweaker2.utils.BaseMapRemoval;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.MutablePair;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import flaxbeard.steamcraft.api.CrucibleFormula;
import flaxbeard.steamcraft.api.CrucibleLiquid;
import flaxbeard.steamcraft.api.SteamcraftRegistry;
import flaxbeard.steamcraft.api.Tuple3;
@ZenClass("mods.fsp.Crucible")
public class Crucible {
public static final String nameLiquid = "FSP Crucible (Liquid)";
public static final String nameMelting = "FSP Crucible (Liquid)";
public static final String nameDunking = "FSP Crucible (Dunking)";
@ZenMethod
public static void addLiquid(String name, IItemStack ingot, IItemStack plate, IItemStack nugget, int r, int g, int b) {
MineTweakerAPI.apply(new AddLiquid(new CrucibleLiquid(name, toStack(ingot), toStack(plate), toStack(nugget), null, r, g, b)));
}
@ZenMethod
public static void addLiquid(String name, IItemStack ingot, IItemStack plate, IItemStack nugget, int r, int g, int b, String l1, int n1, String l2, int n2, int n3) {
MineTweakerAPI.apply(new AddLiquid(new CrucibleLiquid(name, toStack(ingot), toStack(plate), toStack(nugget), new CrucibleFormula(getLiquid(l1), n1, getLiquid(l2), n2, n3), r, g, b)));
}
private static class AddLiquid extends BaseListAddition<CrucibleLiquid> {
public AddLiquid(CrucibleLiquid recipe) {
super(nameLiquid, SteamcraftRegistry.liquids);
recipes.add(recipe);
}
@Override
public String getRecipeInfo(CrucibleLiquid recipe) {
return recipe.name;
}
}
@ZenMethod
public static void addMelting(IItemStack input, String liquid, int volume) {
ItemStack stack = toStack(input);
CrucibleLiquid fluid = getLiquid(liquid);
if (fluid != null) {
MineTweakerAPI.apply(new AddMelting(stack, MutablePair.of(stack.getItem(), stack.getItemDamage()), MutablePair.of(fluid, volume)));
}
}
private static class AddMelting extends BaseMapAddition<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> {
public AddMelting(ItemStack stack, MutablePair<Item, Integer> key, MutablePair<CrucibleLiquid, Integer> recipe) {
super(nameMelting, SteamcraftRegistry.smeltThings);
map.put(key, recipe);
}
@Override
protected String getRecipeInfo(Entry<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getKey().left, 1, recipe.getKey().right));
}
}
@ZenMethod
public static void removeMelting(IIngredient input) {
Map<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> recipes = new HashMap<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>>();
for(Entry<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> entry : SteamcraftRegistry.smeltThings.entrySet()) {
if(matches(input, toIItemStack(new ItemStack(entry.getKey().left, 1, entry.getKey().right)))) {
recipes.put(entry.getKey(), entry.getValue());
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveMelting(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipes found for %s", Crucible.nameMelting, input));
}
}
private static class RemoveMelting extends BaseMapRemoval<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> {
public RemoveMelting(Map<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> recipes) {
super(nameMelting, SteamcraftRegistry.smeltThings, recipes);
}
@Override
protected String getRecipeInfo(Entry<MutablePair<Item, Integer>, MutablePair<CrucibleLiquid, Integer>> recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getKey().left, 1, recipe.getKey().right));
}
}
@ZenMethod
public static void addDunking(IItemStack input, String liquid, int volume, IItemStack output) {
ItemStack stack = toStack(input);
CrucibleLiquid fluid = getLiquid(liquid);
if (fluid != null) {
MineTweakerAPI.apply(new AddDunking(new Tuple3(stack.getItem(), stack.getItemDamage(), fluid), MutablePair.of(volume, toStack(output))));
}
}
private static class AddDunking extends BaseMapAddition<Tuple3, MutablePair<Integer, ItemStack>> {
public AddDunking(Tuple3 key, MutablePair<Integer, ItemStack> recipe) {
super(Crucible.nameDunking, SteamcraftRegistry.dunkThings);
recipes.put(key, recipe);
}
@Override
public String getRecipeInfo(Entry<Tuple3, MutablePair<Integer, ItemStack>> recipe) {
return LogHelper.getStackDescription(recipe.getValue().right);
}
}
@ZenMethod
public static void removeDunking(IIngredient input, String liquid) {
Map<Tuple3, MutablePair<Integer, ItemStack>> recipes = new HashMap<Tuple3, MutablePair<Integer, ItemStack>>();
for(Entry<Tuple3, MutablePair<Integer, ItemStack>> recipe : SteamcraftRegistry.dunkThings.entrySet()) {
if(recipe.getValue() != null && recipe.getValue().right != null && matches(input, toIItemStack(recipe.getValue().right))) {
if(((CrucibleLiquid)recipe.getKey().third).equals(getLiquid(liquid))) {
recipes.put(recipe.getKey(), recipe.getValue());
}
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveDunking(recipes));
} else {
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", Crucible.nameDunking, input.toString(), liquid));
}
}
private static class RemoveDunking extends BaseMapRemoval<Tuple3, MutablePair<Integer, ItemStack>> {
public RemoveDunking(Map<Tuple3, MutablePair<Integer, ItemStack>> recipes) {
super(Crucible.nameDunking, SteamcraftRegistry.dunkThings, recipes);
}
@Override
public String getRecipeInfo(Entry<Tuple3, MutablePair<Integer, ItemStack>> recipe) {
return LogHelper.getStackDescription(recipe.getValue().right);
}
}
}

View file

@ -1,75 +0,0 @@
package modtweaker2.mods.fsp.handlers;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.StackHelper.matches;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseMapAddition;
import modtweaker2.utils.BaseMapRemoval;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.tuple.MutablePair;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import flaxbeard.steamcraft.api.SteamcraftRegistry;
@ZenClass("mods.fsp.Furnace")
public class Furnace {
public static final String name = "FSP Furnace (Steamed Foods)";
@ZenMethod
public static void addSteamFood(IItemStack input, IItemStack output) {
MineTweakerAPI.apply(new AddSteamFood(toStack(input), MutablePair.of(toStack(input).getItem(), toStack(input).getItemDamage()), MutablePair.of(toStack(output).getItem(), toStack(output).getItemDamage())));
}
private static class AddSteamFood extends BaseMapAddition<MutablePair<Item, Integer>, MutablePair<Item, Integer>> {
public AddSteamFood(ItemStack stack, MutablePair<Item, Integer> key, MutablePair<Item, Integer> recipe) {
super(Furnace.name, SteamcraftRegistry.steamedFoods);
recipes.put(key, recipe);
}
@Override
public String getRecipeInfo(Entry<MutablePair<Item, Integer>, MutablePair<Item, Integer>> recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getKey().left, 1, recipe.getKey().right));
}
}
@ZenMethod
public static void removeSteamFood(IIngredient input) {
Map<MutablePair<Item, Integer>, MutablePair<Item, Integer>> recipes = new HashMap<MutablePair<Item, Integer>, MutablePair<Item, Integer>>();
for(Entry<MutablePair<Item, Integer>, MutablePair<Item, Integer>> recipe : SteamcraftRegistry.steamedFoods.entrySet()) {
if(matches(input, toIItemStack(new ItemStack(recipe.getKey().left, 1, recipe.getKey().right)))) {
recipes.put(recipe.getKey(), recipe.getValue());
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveSteamFood(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s. Command ignored!", Furnace.name, input.toString()));
}
}
private static class RemoveSteamFood extends BaseMapRemoval<MutablePair<Item, Integer>, MutablePair<Item, Integer>> {
public RemoveSteamFood(Map<MutablePair<Item, Integer>, MutablePair<Item, Integer>> recipes) {
super(Furnace.name, SteamcraftRegistry.steamedFoods, recipes);
}
@Override
public String getRecipeInfo(Entry<MutablePair<Item, Integer>, MutablePair<Item, Integer>> recipe) {
return LogHelper.getStackDescription(new ItemStack(recipe.getKey().left, 1, recipe.getKey().right));
}
}
}

View file

@ -2,6 +2,8 @@ package modtweaker2.mods.mekanism;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import modtweaker2.mods.mekanism.gas.GasBracketHandler; import modtweaker2.mods.mekanism.gas.GasBracketHandler;
import modtweaker2.mods.mekanism.gas.IGasDefinition;
import modtweaker2.mods.mekanism.gas.IGasStack;
import modtweaker2.mods.mekanism.handlers.ChemicalCrystallizer; import modtweaker2.mods.mekanism.handlers.ChemicalCrystallizer;
import modtweaker2.mods.mekanism.handlers.ChemicalDissolution; import modtweaker2.mods.mekanism.handlers.ChemicalDissolution;
import modtweaker2.mods.mekanism.handlers.ChemicalInfuser; import modtweaker2.mods.mekanism.handlers.ChemicalInfuser;
@ -20,11 +22,14 @@ import modtweaker2.mods.mekanism.handlers.Sawmill;
import modtweaker2.mods.mekanism.handlers.Separator; import modtweaker2.mods.mekanism.handlers.Separator;
import modtweaker2.mods.mekanism.handlers.SolarEvaporation; import modtweaker2.mods.mekanism.handlers.SolarEvaporation;
import modtweaker2.mods.mekanism.handlers.SolarNeutronActivator; import modtweaker2.mods.mekanism.handlers.SolarNeutronActivator;
import modtweaker2.mods.mekanism.handlers.TheoreticalElementizer;
import modtweaker2.utils.TweakerPlugin; import modtweaker2.utils.TweakerPlugin;
public class Mekanism extends TweakerPlugin { public class Mekanism extends TweakerPlugin {
public Mekanism() { public Mekanism() {
MineTweakerAPI.registerBracketHandler(new GasBracketHandler()); MineTweakerAPI.registerBracketHandler(new GasBracketHandler());
MineTweakerAPI.registerClass(IGasDefinition.class);
MineTweakerAPI.registerClass(IGasStack.class);
MineTweakerAPI.registerClass(ChemicalCrystallizer.class); MineTweakerAPI.registerClass(ChemicalCrystallizer.class);
MineTweakerAPI.registerClass(ChemicalDissolution.class); MineTweakerAPI.registerClass(ChemicalDissolution.class);
MineTweakerAPI.registerClass(ChemicalInfuser.class); MineTweakerAPI.registerClass(ChemicalInfuser.class);
@ -43,5 +48,6 @@ public class Mekanism extends TweakerPlugin {
MineTweakerAPI.registerClass(Separator.class); MineTweakerAPI.registerClass(Separator.class);
MineTweakerAPI.registerClass(SolarEvaporation.class); MineTweakerAPI.registerClass(SolarEvaporation.class);
MineTweakerAPI.registerClass(SolarNeutronActivator.class); MineTweakerAPI.registerClass(SolarNeutronActivator.class);
MineTweakerAPI.registerClass(TheoreticalElementizer.class);
} }
} }

View file

@ -28,7 +28,7 @@ public class GasLogger implements ICommandFunction {
Collections.sort(gases, COMPARATOR); Collections.sort(gases, COMPARATOR);
for (Gas gas : gases) { for (Gas gas : gases) {
System.out.println("Gas " + gas.getName()); System.out.println("Gas " + gas.getName());
MineTweakerAPI.logCommand("<gas:" + gas.getName() + "> -- " + gas.getLocalizedName()); MineTweakerAPI.logCommand("<gas:" + gas.getName() + ">, " + gas.getLocalizedName());
} }
if (player != null) { if (player != null) {

View file

@ -21,7 +21,7 @@ import mekanism.common.recipe.machines.PurificationRecipe;
import mekanism.common.recipe.machines.SawmillRecipe; import mekanism.common.recipe.machines.SawmillRecipe;
import mekanism.common.recipe.machines.SeparatorRecipe; import mekanism.common.recipe.machines.SeparatorRecipe;
import mekanism.common.recipe.machines.SmeltingRecipe; import mekanism.common.recipe.machines.SmeltingRecipe;
import mekanism.common.recipe.machines.SolarEvaporationRecipe; import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import mekanism.common.recipe.machines.SolarNeutronRecipe; import mekanism.common.recipe.machines.SolarNeutronRecipe;
import mekanism.common.recipe.machines.WasherRecipe; import mekanism.common.recipe.machines.WasherRecipe;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
@ -215,7 +215,7 @@ public class MekanismLogger implements ICommandFunction {
} }
if(args.isEmpty() || args.contains("SolarEvaporation")) { if(args.isEmpty() || args.contains("SolarEvaporation")) {
for(SolarEvaporationRecipe recipe : (Collection<SolarEvaporationRecipe>)Recipe.SOLAR_EVAPORATION_PLANT.get().values()) { for(ThermalEvaporationRecipe recipe : (Collection<ThermalEvaporationRecipe>)Recipe.THERMAL_EVAPORATION_PLANT.get().values()) {
MineTweakerAPI.logCommand(String.format("mods.mekanism.SolarEvaporation.addRecipe(%s, %s);", MineTweakerAPI.logCommand(String.format("mods.mekanism.SolarEvaporation.addRecipe(%s, %s);",
LogHelper.getStackDescription(recipe.recipeInput.ingredient), LogHelper.getStackDescription(recipe.recipeInput.ingredient),
LogHelper.getStackDescription(recipe.recipeOutput.output))); LogHelper.getStackDescription(recipe.recipeOutput.output)));

View file

@ -30,7 +30,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Crystallizer") @ZenClass("mods.mekanism.chemical.Crystallizer")
public class ChemicalCrystallizer { public class ChemicalCrystallizer {
public static final String name = "Mekanism Crusher"; public static final String name = "Mekanism Chemical Crystallizer";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -30,7 +30,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Dissolution") @ZenClass("mods.mekanism.chemical.Dissolution")
public class ChemicalDissolution { public class ChemicalDissolution {
public static final String name = "Mekanism Dissolution"; public static final String name = "Mekanism Chemical Dissolution Chamber";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -27,7 +27,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Infuser") @ZenClass("mods.mekanism.chemical.Infuser")
public class ChemicalInfuser { public class ChemicalInfuser {
public static final String name = "Mekanism Infuser"; public static final String name = "Mekanism Chemical Infuser";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -32,7 +32,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Injection") @ZenClass("mods.mekanism.chemical.Injection")
public class ChemicalInjection { public class ChemicalInjection {
public static final String name = "Mekanism Injection"; public static final String name = "Mekanism Chemical Injection Chamber";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -30,7 +30,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Oxidizer") @ZenClass("mods.mekanism.chemical.Oxidizer")
public class ChemicalOxidizer { public class ChemicalOxidizer {
public static final String name = "Mekanism Oxidizer"; public static final String name = "Mekanism Chemical Oxidizer";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -27,7 +27,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.chemical.Washer") @ZenClass("mods.mekanism.chemical.Washer")
public class ChemicalWasher { public class ChemicalWasher {
public static final String name = "Mekanism Washer"; public static final String name = "Mekanism Chemical Washer";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -29,7 +29,7 @@ import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.Infuser") @ZenClass("mods.mekanism.Infuser")
public class Infuser { public class Infuser {
public static final String name = "Mekanism Infuser"; public static final String name = "Mekanism Metallurgic Infuser";
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -10,7 +10,7 @@ import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.inputs.FluidInput; import mekanism.common.recipe.inputs.FluidInput;
import mekanism.common.recipe.inputs.MachineInput; import mekanism.common.recipe.inputs.MachineInput;
import mekanism.common.recipe.machines.MachineRecipe; import mekanism.common.recipe.machines.MachineRecipe;
import mekanism.common.recipe.machines.SolarEvaporationRecipe; import mekanism.common.recipe.machines.ThermalEvaporationRecipe;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient; import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IngredientAny; import minetweaker.api.item.IngredientAny;
@ -39,9 +39,9 @@ public class SolarEvaporation {
return; return;
} }
SolarEvaporationRecipe recipe = new SolarEvaporationRecipe(toFluid(liquidInput), toFluid(liquidOutput)); ThermalEvaporationRecipe recipe = new ThermalEvaporationRecipe(toFluid(liquidInput), toFluid(liquidOutput));
MineTweakerAPI.apply(new AddMekanismRecipe(name, Recipe.SOLAR_EVAPORATION_PLANT.get(), recipe)); MineTweakerAPI.apply(new AddMekanismRecipe(name, Recipe.THERMAL_EVAPORATION_PLANT.get(), recipe));
} }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -58,7 +58,7 @@ public class SolarEvaporation {
Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>(); Map<MachineInput, MachineRecipe> recipes = new HashMap<MachineInput, MachineRecipe>();
for(Entry<FluidInput, SolarEvaporationRecipe> entry : ((Map<FluidInput, SolarEvaporationRecipe>)Recipe.SOLAR_EVAPORATION_PLANT.get()).entrySet() ) { for(Entry<FluidInput, ThermalEvaporationRecipe> entry : ((Map<FluidInput, ThermalEvaporationRecipe>)Recipe.THERMAL_EVAPORATION_PLANT.get()).entrySet() ) {
ILiquidStack inputLiquid = InputHelper.toILiquidStack(entry.getKey().ingredient); ILiquidStack inputLiquid = InputHelper.toILiquidStack(entry.getKey().ingredient);
ILiquidStack outputLiquid = InputHelper.toILiquidStack(entry.getValue().recipeOutput.output); ILiquidStack outputLiquid = InputHelper.toILiquidStack(entry.getValue().recipeOutput.output);
@ -69,7 +69,7 @@ public class SolarEvaporation {
} }
if(!recipes.isEmpty()) { if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.SOLAR_EVAPORATION_PLANT.get(), recipes)); MineTweakerAPI.apply(new RemoveMekanismRecipe(name, Recipe.THERMAL_EVAPORATION_PLANT.get(), recipes));
} else { } else {
LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, liquidInput.toString(), liquidOutput.toString())); LogHelper.logWarning(String.format("No %s recipe found for %s and %s. Command ignored!", name, liquidInput.toString(), liquidOutput.toString()));
} }

View file

@ -0,0 +1,211 @@
package modtweaker2.mods.mekanism.handlers;
import java.util.LinkedList;
import java.util.List;
import mekanism.common.recipe.ElementizerRecipeHandler;
import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack;
import static modtweaker2.helpers.InputHelper.toIItemStack;
import static modtweaker2.helpers.InputHelper.toStack;
import static modtweaker2.helpers.StackHelper.matches;
import modtweaker2.helpers.LogHelper;
import modtweaker2.utils.BaseListAddition;
import modtweaker2.utils.BaseListRemoval;
import net.minecraft.item.ItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
@ZenClass("mods.mekanism.Elementizer")
public class TheoreticalElementizer {
public static final String name = "Theoretical Elementizer";
@ZenMethod
public static void addOutput(IItemStack itemOutput) {
if(itemOutput == null) {
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
return;
}
MineTweakerAPI.apply(new AddOutput(toStack(itemOutput)));
}
private static class AddOutput extends BaseListAddition<ItemStack> {
public AddOutput(ItemStack recipe) {
super(TheoreticalElementizer.name, null);
recipes.add(recipe);
}
public void apply() {
for(ItemStack recipe : recipes) {
boolean applied = ElementizerRecipeHandler.outputItems.add(recipe);
if(applied) {
successful.add(recipe);
}
}
}
public void undo() {
for(ItemStack recipe : successful) {
ElementizerRecipeHandler.outputItems.remove(recipe);
}
}
@Override
protected boolean equals(ItemStack recipe, ItemStack otherRecipe) {
return recipe != null && recipe.isItemEqual(otherRecipe);
}
@Override
protected String getRecipeInfo(ItemStack recipe) {
return LogHelper.getStackDescription(recipe);
}
}
@ZenMethod
public static void removeOutput(IIngredient input) {
List<ItemStack> recipes = new LinkedList<ItemStack>();
for(ItemStack recipe : ElementizerRecipeHandler.outputItems) {
if(recipe != null && matches(input, toIItemStack(recipe))) {
recipes.add(recipe);
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveOutput(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s.", name, input.toString()));
}
}
private static class RemoveOutput extends BaseListRemoval<ItemStack> {
public RemoveOutput(List<ItemStack> recipes) {
super(TheoreticalElementizer.name, null, recipes);
}
public void apply() {
for(ItemStack recipe : recipes) {
boolean removed = ElementizerRecipeHandler.outputItems.remove(recipe);
if(removed) {
successful.add(recipe);
}
}
}
public void undo() {
for(ItemStack recipe : successful) {
ElementizerRecipeHandler.outputItems.add(recipe);
}
}
@Override
protected boolean equals(ItemStack recipe, ItemStack otherRecipe) {
return recipe != null && recipe.isItemEqual(otherRecipe);
}
@Override
protected String getRecipeInfo(ItemStack recipe) {
return LogHelper.getStackDescription(recipe);
}
}
@ZenMethod
public static void addFuel(IItemStack itemFuel) {
if(itemFuel == null) {
LogHelper.logError(String.format("Required parameters missing for %s Recipe.", name));
return;
}
MineTweakerAPI.apply(new AddFuel(toStack(itemFuel)));
}
private static class AddFuel extends BaseListAddition<ItemStack> {
public AddFuel(ItemStack recipe) {
super(TheoreticalElementizer.name, null);
recipes.add(recipe);
}
public void apply() {
for(ItemStack recipe : recipes) {
boolean applied = ElementizerRecipeHandler.fuelItems.add(recipe);
if(applied) {
successful.add(recipe);
}
}
}
public void undo() {
for(ItemStack recipe : successful) {
ElementizerRecipeHandler.fuelItems.remove(recipe);
}
}
@Override
protected boolean equals(ItemStack recipe, ItemStack otherRecipe) {
return recipe != null && recipe.isItemEqual(otherRecipe);
}
@Override
protected String getRecipeInfo(ItemStack recipe) {
return LogHelper.getStackDescription(recipe);
}
}
@ZenMethod
public static void removeFuel(IIngredient input) {
List<ItemStack> recipes = new LinkedList<ItemStack>();
for(ItemStack recipe : ElementizerRecipeHandler.fuelItems) {
if(recipe != null && matches(input, toIItemStack(recipe))) {
recipes.add(recipe);
}
}
if(!recipes.isEmpty()) {
MineTweakerAPI.apply(new RemoveFuel(recipes));
} else {
LogHelper.logWarning(String.format("No %s Recipe found for %s.", name, input.toString()));
}
}
private static class RemoveFuel extends BaseListRemoval<ItemStack> {
public RemoveFuel(List<ItemStack> recipes) {
super(TheoreticalElementizer.name, null, recipes);
}
public void apply() {
for(ItemStack recipe : recipes) {
boolean removed = ElementizerRecipeHandler.fuelItems.remove(recipe);
if(removed) {
successful.add(recipe);
}
}
}
public void undo() {
for(ItemStack recipe : successful) {
ElementizerRecipeHandler.fuelItems.add(recipe);
}
}
@Override
protected boolean equals(ItemStack recipe, ItemStack otherRecipe) {
return recipe != null && recipe.isItemEqual(otherRecipe);
}
@Override
protected String getRecipeInfo(ItemStack recipe) {
return LogHelper.getStackDescription(recipe);
}
}
}