Skip to content

Commit

Permalink
add Calculator compat (#134)
Browse files Browse the repository at this point in the history
* basic calculator compat

* add mixins to make work

* clear calculator providers field to prevent JEI implosion

* use most recent version of calculator

* actually its any sonarcore mod, fix all of them

* fix most compat

* remove treeHarvest because sickle uses hardcoded blockstates

* namesake compat??? whoa, crazy

* fix examples having lang keys for those

* fix up fabrication chamber

* analysing chamber

* allow AnalyzingChamber

* remove trailing comma and whitespace from fab example

* test IIngredients
  • Loading branch information
WaitingIdly authored Mar 20, 2024
1 parent 99f2615 commit 38e841a
Show file tree
Hide file tree
Showing 29 changed files with 2,624 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ dependencies {
runtimeOnly rfg.deobf('curse.maven:avaritia_1_10-261348:3143349')
}

compileOnly rfg.deobf("curse.maven:sonar-core-239418:2645156")
compileOnly rfg.deobf("curse.maven:calculator-225104:2847174")
if (project.debug_calculator.toBoolean()) {
runtimeOnly rfg.deobf("curse.maven:sonar-core-239418:2645156")
runtimeOnly rfg.deobf("curse.maven:calculator-225104:2847174")
}

compileOnly rfg.deobf("curse.maven:shadowfacts-forgelin-248453:2785465")
compileOnly rfg.deobf("curse.maven:alchemylib-293426:2761706")
compileOnly rfg.deobf("curse.maven:alchemistry-293425:3186612")
Expand Down
264 changes: 264 additions & 0 deletions examples/postInit/calculator.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@

// Auto generated groovyscript example file
// MODS_LOADED: calculator

println 'mod \'calculator\' detected, running script'

// Algorithm Separator:
// Converts an input itemstack into two output itemstacks.

mods.calculator.algorithm_separator.removeByInput(item('calculator:tanzaniteleaves'))
mods.calculator.algorithm_separator.removeByOutput(item('calculator:weakeneddiamond'))
// mods.calculator.algorithm_separator.removeAll()

mods.calculator.algorithm_separator.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'), item('minecraft:diamond'))
.register()


// Analysing Chamber:
// Takes a non-analysed Circuit and analyses it, converting it into usable Stable or Analysed Circuit. Will produce power
// and item outputs based on randomly generated NBT data.

mods.calculator.analysing_chamber.removeByInput(item('sonarcore:reinforceddirtblock'))
// mods.calculator.analysing_chamber.removeAll()

mods.calculator.analysing_chamber.recipeBuilder()
.slot(6)
.location(1)
.output(item('minecraft:diamond'))
.register()

mods.calculator.analysing_chamber.recipeBuilder()
.slot(1)
.location(18)
.output(item('minecraft:clay'))
.register()


// Atomic Calculator:
// Converts three input itemstacks into one output itemstack.

mods.calculator.atomic_calculator.removeByInput(item('minecraft:end_stone'))
mods.calculator.atomic_calculator.removeByOutput(item('calculator:firediamond'))
// mods.calculator.atomic_calculator.removeAll()

mods.calculator.atomic_calculator.recipeBuilder()
.input(item('minecraft:clay'), item('minecraft:clay'), item('minecraft:clay'))
.output(item('minecraft:gold_ingot') * 4)
.register()


// Calculator:
// Converts two input itemstacks into one output itemstack.

mods.calculator.basic_calculator.removeByInput(item('minecraft:cobblestone'))
mods.calculator.basic_calculator.removeByOutput(item('calculator:reinforcedironingot'))
// mods.calculator.basic_calculator.removeAll()

mods.calculator.basic_calculator.recipeBuilder()
.input(item('minecraft:clay'), item('minecraft:clay'))
.output(item('minecraft:gold_ingot'))
.register()


// Conductor Mast:
// Converts an input itemstack into an output itemstack, costing a configurable amount of power. This power can only be
// gained via the Conductor Mast's semi-regular generation of lightning strikes.

mods.calculator.conductor_mast.removeByInput(item('calculator:firediamond'))
mods.calculator.conductor_mast.removeByOutput(item('calculator:material:7'))
// mods.calculator.conductor_mast.removeAll()

mods.calculator.conductor_mast.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.value(100)
.register()


// Extraction Chamber:
// Converts an input itemstack into an output itemstack, and gives either a Dirty or Damaged Circuit.

mods.calculator.extraction_chamber.removeByInput(item('minecraft:dirt'))
mods.calculator.extraction_chamber.removeByOutput(item('calculator:smallstone'))
// mods.calculator.extraction_chamber.removeAll()

mods.calculator.extraction_chamber.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.register()

mods.calculator.extraction_chamber.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:clay'))
.isDamaged()
.register()


// Fabrication Chamber:
// Converts Stable and Analysed Circuits into output itemstacks.

mods.calculator.fabrication_chamber.removeByInput(item('calculator:circuitboard:8').withNbt([Stable: 0, Analysed: 1]))
mods.calculator.fabrication_chamber.removeByOutput(item('calculator:calculatorassembly'))
// mods.calculator.fabrication_chamber.removeAll()

mods.calculator.fabrication_chamber.recipeBuilder()
.input(item('calculator:circuitboard:8').withNbt([Stable: 0, Analysed: 1]))
.output(item('minecraft:diamond'))
.register()

mods.calculator.fabrication_chamber.recipeBuilder()
.input(item('calculator:circuitboard:0').withNbt([Stable: 0, Analysed: true]), item('calculator:circuitboard:1').withNbt([Stable: 0, Analysed: true]), item('calculator:circuitboard:2').withNbt([Stable: 0, Analysed: true]), item('calculator:circuitboard:3').withNbt([Stable: 0, Analysed: true]), item('calculator:circuitboard:4').withNbt([Stable: 0, Analysed: true]))
.input(item('calculator:circuitboard:0').withNbt([Stable: 1, Analysed: true]), item('calculator:circuitboard:1').withNbt([Stable: 1, Analysed: true]), item('calculator:circuitboard:2').withNbt([Stable: 1, Analysed: true]), item('calculator:circuitboard:3').withNbt([Stable: 1, Analysed: true]), item('calculator:circuitboard:4').withNbt([Stable: 1, Analysed: true]))
.output(item('minecraft:clay'))
.register()


// Flawless Calculator:
// Converts four input itemstacks into one output itemstack.

mods.calculator.flawless_calculator.removeByInput(item('minecraft:obsidian'))
mods.calculator.flawless_calculator.removeByOutput(item('minecraft:ender_pearl'))
// mods.calculator.flawless_calculator.removeAll()

mods.calculator.flawless_calculator.recipeBuilder()
.input(item('minecraft:clay'), item('minecraft:clay'), item('minecraft:clay'), item('minecraft:clay'))
.output(item('minecraft:gold_ingot') * 16)
.register()


// Glowstone Extractor:
// Converts an input itemstack into power, at the cost of a burnable fuel.

mods.calculator.glowstone_extractor.removeByInput(item('minecraft:glowstone'))
// mods.calculator.glowstone_extractor.removeAll()

mods.calculator.glowstone_extractor.recipeBuilder()
.input(item('minecraft:clay'))
.value(100)
.register()


// Health Processor:
// Converts an input itemstack into "Health Points", which charge a Health or Nutrition module and are converted into
// rapidly regenerating health.

mods.calculator.health_processor.removeByInput(item('minecraft:blaze_rod'))
// mods.calculator.health_processor.removeAll()

mods.calculator.health_processor.recipeBuilder()
.input(item('minecraft:clay'))
.value(100)
.register()


// Precision Chamber:
// Converts an input itemstack into two output itemstacks.

mods.calculator.precision_chamber.removeByInput(item('minecraft:clay'))
mods.calculator.precision_chamber.removeByOutput(item('calculator:soil'))
// mods.calculator.precision_chamber.removeAll()

mods.calculator.precision_chamber.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'), item('calculator:circuitdamaged:4'))
.register()

mods.calculator.precision_chamber.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'), item('minecraft:diamond'))
.register()


// Processing Chamber:
// Converts an input itemstack into an output itemstack, typically a Dirty or Damaged Circuit. By default, functions as a
// combined Restoration and Reassembly Chamber.

mods.calculator.processing_chamber.removeByInput(item('calculator:circuitdamaged:4'))
mods.calculator.processing_chamber.removeByOutput(item('calculator:circuitboard:1'))
// mods.calculator.processing_chamber.removeAll()

mods.calculator.processing_chamber.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.register()


// Reassembly Chamber:
// Converts an input itemstack into an output itemstack, typically a Damaged Circuit.

mods.calculator.reassembly_chamber.removeByInput(item('calculator:circuitdamaged:12'))
mods.calculator.reassembly_chamber.removeByOutput(item('calculator:circuitboard:13'))
// mods.calculator.reassembly_chamber.removeAll()

mods.calculator.reassembly_chamber.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.register()


// Redstone Extractor:
// Converts an input itemstack into power, at the cost of a burnable fuel.

mods.calculator.redstone_extractor.removeByInput(item('minecraft:redstone_block'))
// mods.calculator.redstone_extractor.removeAll()

mods.calculator.redstone_extractor.recipeBuilder()
.input(item('minecraft:clay'))
.value(100)
.register()


// Restoration Chamber:
// Converts an input itemstack into an output itemstack, typically a Dirty Circuit.

mods.calculator.restoration_chamber.removeByInput(item('calculator:circuitdirty:5'))
mods.calculator.restoration_chamber.removeByOutput(item('calculator:circuitboard:3'))
// mods.calculator.restoration_chamber.removeAll()

mods.calculator.restoration_chamber.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.register()


// Scientific Calculator:
// Converts two input itemstacks into one output itemstack.

mods.calculator.scientific_calculator.removeByInput(item('calculator:smallamethyst'))
mods.calculator.scientific_calculator.removeByOutput(item('calculator:redstoneingot'))
// mods.calculator.scientific_calculator.removeAll()

mods.calculator.scientific_calculator.recipeBuilder()
.input(item('minecraft:clay'), item('minecraft:clay'))
.output(item('minecraft:gold_ingot') * 2)
.register()


// Starch Extractor:
// Converts an input itemstack into power, at the cost of a burnable fuel.

mods.calculator.starch_extractor.removeByInput(item('minecraft:apple'))
// mods.calculator.starch_extractor.removeAll()

mods.calculator.starch_extractor.recipeBuilder()
.input(item('minecraft:clay'))
.value(100)
.register()


// Stone Separator:
// Converts an input itemstack into two output itemstacks.

mods.calculator.stone_separator.removeByInput(item('minecraft:gold_ore'))
mods.calculator.stone_separator.removeByOutput(item('calculator:reinforcedironingot'))
// mods.calculator.stone_separator.removeAll()

mods.calculator.stone_separator.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'), item('minecraft:diamond'))
.register()


1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ debug_avaritia = false
debug_better_with_mods = false
debug_blood_magic = false
debug_botania = false
debug_calculator = false
debug_chisel = false
debug_compact_machines = false
debug_draconic_evolution = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.cleanroommc.groovyscript.compat.mods.betterwithmods.BetterWithMods;
import com.cleanroommc.groovyscript.compat.mods.bloodmagic.BloodMagic;
import com.cleanroommc.groovyscript.compat.mods.botania.Botania;
import com.cleanroommc.groovyscript.compat.mods.calculator.Calculator;
import com.cleanroommc.groovyscript.compat.mods.chisel.Chisel;
import com.cleanroommc.groovyscript.compat.mods.compactmachines.CompactMachines;
import com.cleanroommc.groovyscript.compat.mods.draconicevolution.DraconicEvolution;
Expand Down Expand Up @@ -64,6 +65,7 @@ public class ModSupport implements IDynamicGroovyProperty {
public static final GroovyContainer<BetterWithMods> BETTER_WITH_MODS = new InternalModContainer<>("betterwithmods", "Better With Mods", BetterWithMods::new);
public static final GroovyContainer<BloodMagic> BLOOD_MAGIC = new InternalModContainer<>("bloodmagic", "Blood Magic: Alchemical Wizardry", BloodMagic::new, "bm");
public static final GroovyContainer<Botania> BOTANIA = new InternalModContainer<>("botania", "Botania", Botania::new);
public static final GroovyContainer<Calculator> CALCULATOR = new InternalModContainer<>("calculator", "Calculator", Calculator::new);
public static final GroovyContainer<Chisel> CHISEL = new InternalModContainer<>("chisel", "Chisel", Chisel::new);
public static final GroovyContainer<CompactMachines> COMPACT_MACHINES = new InternalModContainer<>("compactmachines3", "Compact Machines 3", CompactMachines::new, "compactmachines");
public static final GroovyContainer<DraconicEvolution> DRACONIC_EVOLUTION = new InternalModContainer<>("draconicevolution", "Draconic Evolution", DraconicEvolution::new, "de");
Expand Down
Loading

0 comments on commit 38e841a

Please sign in to comment.