-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Composition, Recipe Search, Other Fixes, Update Buildscript
Ton of stuff I did over the weekend... Don't even remember it all, but it works and its better now.
- Loading branch information
1 parent
ec74c57
commit fd0e79d
Showing
39 changed files
with
2,115 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Import Recipe Search Helpers, used for Chanced Item and Fluid Ingredients | ||
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.GTRecipeHelpers.* | ||
|
||
// Building Test Recipes | ||
mods.gregtech.arc_furnace.recipeBuilder().inputs(metaitem('nomilabs:dustImpureOsmiridium8020')).outputs(item('minecraft:apple') * 64, item('minecraft:apple') * 64).EUt(50).duration(30).buildAndRegister() | ||
mods.gregtech.arc_furnace.recipeBuilder().inputs(item('minecraft:stick')).outputs(item('minecraft:apple') * 64).EUt(50).duration(30).buildAndRegister() | ||
mods.gregtech.arc_furnace.recipeBuilder().inputs(item('minecraft:yellow_flower')).outputs(item('minecraft:apple') * 64, item('minecraft:apple') * 64, item('minecraft:apple') * 64).chancedOutput(item('minecraft:apple') * 64, 50, 1).chancedFluidOutput(fluid('fluorine') * 2000, 50, 1).EUt(50).duration(30).buildAndRegister() | ||
mods.gregtech.arc_furnace.recipeBuilder().inputs(metaitem('nomilabs:dustOsmiridium8020')).outputs(item('minecraft:apple') * 64, item('minecraft:apple') * 64, item('minecraft:apple') * 64).chancedOutput(item('minecraft:apple') * 64, 50, 1).chancedFluidOutput(fluid('fluorine') * 2000, 50, 1).EUt(50).duration(30).buildAndRegister() | ||
mods.gregtech.arc_furnace.recipeBuilder().inputs(metaitem('nomilabs:dustPureOsmiridium8020')).outputs(item('minecraft:apple') * 64, item('minecraft:apple') * 64).EUt(50).duration(30).buildAndRegister() | ||
|
||
// Find/Remove By Input Extensions (Are Lists of: List<ItemStack> itemInputs, List<FluidStack> fluidInputs) | ||
// mods.gregtech.<RECIPE_MAP>.removeByInput to remove, mods.gregtech.<RECIPE_MAP>.find to find (Returns null if no recipe found) | ||
// Original: [long voltage, Inputs... (see above)] (Matches/Removes any recipe with that input, and that voltage or more, CHECKING AMOUNT) | ||
// ALL FIND/REMOVE BY INPUT EXTENSIONS IGNORE THE AMOUNT! | ||
// Three Extensions: | ||
// [GTRecipeCategory category, Inputs... (see above)] (Matches/Removes any recipe with that input, and that category) | ||
// [Inputs... (see above)] (Matches/Removes any recipe with that input) | ||
// [Predicate<Recipe> predicate, Inputs... (see above)] (Matches/Removes any recipe with that input, and matching that predicate) | ||
mods.gregtech.arc_furnace.removeByInput([item('minecraft:yellow_flower')], null) | ||
|
||
// Find/Remove By Output | ||
// Outputs Specification: List<ItemStack> itemOutputs, List<FluidStack> fluidOutputs, List<ChancedItemOutput> chancedItemOutputs, List<ChancedFluidOutput> chancedFluidOutputs | ||
// Chanced Item/Fluid Outputs: chanced(item/fluid, chance, chanceBoost) | ||
// mods.gregtech.<RECIPE_MAP>.removeByOutput to remove, mods.gregtech.<RECIPE_MAP>.findByOutput to find (Returns null if no recipes found) | ||
// ALL FIND/REMOVE BY OUTPUT OPTIONS IGNORE THE AMOUNT! | ||
// Four Options: | ||
// [long voltage, Outputs... (see above)] (Matches/Removes any recipe with that output, and that voltage or more) | ||
// [GTRecipeCategory category, Outputs... (see above)] (Matches/Removes any recipe with that output, and that category) | ||
// [Outputs... (see above)] (Matches/Removes any recipe with that output) | ||
// [Predicate<Recipe> predicate, Outputs... (see above)] (Matches/Removes any recipe with that output, and matching that predicate) | ||
mods.gregtech.arc_furnace.removeByOutput(50, [item('minecraft:apple') * 64, item('minecraft:apple') * 64, item('minecraft:apple') * 64], null, [chanced(item('minecraft:apple') * 64, 50, 1)], [chanced(fluid('fluorine') * 2000, 50, 1)]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
// Imports Helpers (Only Needed to use Groovy Helper Calls, | ||
// useful when you only have an ItemStack or FluidStack of a Material | ||
import static com.nomiceu.nomilabs.groovy.GroovyHelpers.ChangeCompositionHelpers.* | ||
|
||
// Imports Mixer Specification, needed to specify Mixer Specification if specifying how to change Mixer | ||
import static com.nomiceu.nomilabs.groovy.CompositionBuilder.MixerSpecification | ||
|
||
// Replace Composition (changes specified) | ||
// Decomp recipes are either centrifuge or electrolyzer recipes, and require the material not to have the DISABLE_DECOMPOSITION flag, and either have a dust or fluid. | ||
// You cannot enable them, if the material already has them disabled. | ||
// Chemical Formula Changes are not recursive. | ||
// However, changes will apply if you first change the inner materials before the outer. | ||
// ABS Recipe requires the material to have a molten fluid, and Alloy Blast and Blast Properties, and not have the Disable ABS Recipe Flag. | ||
// Mixer Recipe requires the material to have an existing mixer recipe, and have a Dust Property. | ||
|
||
// You can get all material components of a material by holding an ItemStack of that material, then doing /gs hand! | ||
|
||
// Having the target material be a Material Stack changes nothing. | ||
// Having the component list be an item stack will grab the material, then use the stack's amount as the material amount. | ||
// Having the component list be an fluid stack will grab the material, then use the fluid amount / 1000. | ||
// You cannot have fractional components. | ||
// You can have materials with only liquid forms (fluorine, mercury, etc.), as both inputs and outputs. | ||
|
||
// Don't have recursive components! This will throw a Stack Overflow Error. | ||
|
||
// How to specify a Material Stack | ||
println("Material Stack of 1 Pyrite | " + materialstack('pyrite')) // Material Stack of 1 Pyrite | ||
println("Material Stack of 6 Pyrite | " + materialstack('pyrite') * 6) // Material Stack of 6 Pyrite | ||
|
||
println("Material Stack of 1 Pyrite | " + material('pyrite') * 1) // Material Stack of 1 Pyrite | ||
println("Material Stack of 6 Pyrite | " + material('pyrite') * 6) // Material Stack of 6 Pyrite | ||
|
||
// How not to specify a Material Stack | ||
println("Material: Pyrite | " + material('pyrite')) // MATERIAL, not Material Stack! This will throw an error! | ||
|
||
// Remove Decomposition by Material | ||
|
||
// Call Change Composition On a FluidStack or ItemStack or MaterialStack or Material, with Groovy Helper Call | ||
// Change Composition Selectively | ||
changeComposition(material('osmiridium')) | ||
// Remove Components | ||
.removeComponents() | ||
// Remove Decomposition (No Components, so is removed) | ||
.changeDecompositionRecipes() | ||
// Remove Mixer (No Components, so is removed) | ||
.changeMixer() | ||
// Save and Apply Change **IMPORTANT** | ||
.change() | ||
|
||
changeComposition(material('osmiridium')) | ||
// Set Components, using a mixture of MaterialStacks, ItemStacks and FluidStacks | ||
// This is 4 fluorine, not 4000, because fluids are divided by 1000 | ||
.setComponents([fluid('fluorine') * 4000, materialstack('rhodium'), materialstack('nomilabs:naquadah_oxide') * 4, materialstack('magnesium') * 3, metaitem('dustCarbon') * 2]) | ||
// Change ABS Recipe with new specified components | ||
.changeABS() | ||
// Change Chemical Formula (Also Saves the Change, so GS Hand shows new components instead of original) | ||
.changeChemicalFormula() | ||
// Save and Apply Change **IMPORTANT** | ||
.change() | ||
|
||
// Call Change Composition on a Material Object | ||
material('ruthenium_trinium_americium_neutronate') | ||
// Start the builder | ||
.changeComposition() | ||
// Set Components, using a mixture of MaterialStacks, ItemStacks and FluidStacks | ||
.setComponents([materialstack('pyrite') * 4, materialstack('rhodium') * 2, materialstack('nomilabs:naquadah_oxide'), materialstack('magnesium'), materialstack('carbon')]) | ||
// Change ABS Recipes | ||
.changeABS() | ||
// Change Chemical Formula (Also Saves the Change, so GS Hand shows new components instead of original) | ||
.changeChemicalFormula() | ||
// Change Decomp Recipes | ||
.changeDecompositionRecipes() | ||
// Change Mixer, using all mixer defaults (see below for description) | ||
.changeMixer() | ||
// Save and Apply Change **IMPORTANT** | ||
.change() | ||
|
||
material('rhodium_plated_palladium') | ||
// Start the builder | ||
.changeComposition() | ||
// Set Components, using a mixture of MaterialStacks, ItemStacks and FluidStacks | ||
.setComponents([materialstack('pyrite') * 4, materialstack('rhodium') * 2, materialstack('nomilabs:naquadah_oxide'), materialstack('magnesium'), materialstack('carbon')]) | ||
// Change Chemical Formula (Also Saves the Change, so GS Hand shows new components instead of original) | ||
.changeChemicalFormula() | ||
// Change Decomp Recipes | ||
.changeDecompositionRecipes() | ||
// Override All, Some or None Mixer Specifications | ||
// If none, can provide no params | ||
// Call new MixerSpecification() to start the builder | ||
// Builder Params and Defaults: | ||
// EUt: How Much EU per Tick the Mixer Recipe uses. Default to EUt in original recipe. | ||
// Output Amount: How much the Mixer Recipe Outputs. Defaults to Amount of Components (E.g. If 5 Pyrite and 2 Iron, outputs 7) | ||
// Circuit: The circuit of the recipe, use 0 for none. Defaults to circuit in original mixer recipe. | ||
.changeMixer(new MixerSpecification().overrideEUt(200).overrideOutputAmount(1).overrideDuration(250).overrideCircuit(0)) | ||
// Change ABS Recipes | ||
.changeABS() | ||
.change() | ||
|
||
// Example of 'Recursive' Chemical Formula Change | ||
// Redstone has Ruby as a Component | ||
material('ruby') | ||
.changeComposition() | ||
// Originally 1 Chrome, 2 Aluminium, 3 Oxygen | ||
.setComponents([materialstack('chrome') * 2, materialstack('aluminium') * 2, materialstack('oxygen') * 6]) | ||
.changeChemicalFormula() // Must call this, so the chemical formula is reloaded, and so that changes are saved | ||
.change() | ||
|
||
material('redstone') | ||
.changeComposition() | ||
// Marks this as a 'reload', meaning that components are the original ones from GT or the addon | ||
.reloadComponents() | ||
.changeChemicalFormula() // Must call this, so the chemical formula is reloaded | ||
.change() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/main/java/com/nomiceu/nomilabs/gregtech/AccessibleMaterial.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
src/main/java/com/nomiceu/nomilabs/gregtech/mixinhelper/AccessibleMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.nomiceu.nomilabs.gregtech.mixinhelper; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import gregtech.api.recipes.Recipe; | ||
import gregtech.api.unification.stack.MaterialStack; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public interface AccessibleMaterial { | ||
void setComponents(ImmutableList<MaterialStack> components, boolean changeFormula); | ||
|
||
void setComponents(ImmutableList<MaterialStack> components); | ||
|
||
void recalculateDecompositionType(); | ||
|
||
void setOriginalRecipes(CompositionRecipeType type, List<Recipe> originals); | ||
|
||
Map<CompositionRecipeType, List<Recipe>> getOriginalRecipes(); | ||
|
||
ImmutableList<MaterialStack> getOriginalComponents(); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/nomiceu/nomilabs/gregtech/mixinhelper/AccessibleMaterialFlags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.nomiceu.nomilabs.gregtech.mixinhelper; | ||
|
||
import gregtech.api.unification.material.info.MaterialFlag; | ||
|
||
public interface AccessibleMaterialFlags { | ||
void removeFlags(MaterialFlag... toRemove); | ||
} |
Oops, something went wrong.