Skip to content

Commit

Permalink
Add ProdigyTech compatibility (#173)
Browse files Browse the repository at this point in the history
* Made Prodigy Tech compilable, added Solderer

* solderer: separated Pattern from Input

* prodigytech: added Zorra Altar integration

* prodigytech: added the simple machines

* prodigytech: added primordialis reactor

* prodigytech: added atomic reshaper

* zorra altar: better way to create custom items

* prodigytech: added explosion furnace

* prodigytech: add example localization

* prodigytech: pull request fixes

* prodigytech: set proper @Property annotations

* prodigytech: pr fixes (2)

* prodigytech: restore debug variables to false

* prodigytech: code cleanup

* prodigytech: pr fixes (3)

* prodigytech: made adjustments that made sense

* prodigytech: change to 'greater than 0' wording

* prodigytech: somewhat improved EFAdditives code

* prodigytech: made SimpleRecipeHandlers public

* prodigytech: convert Explosive/Dampener into records
  • Loading branch information
Wizzerinus authored Jul 6, 2024
1 parent 4891763 commit 3c0af9b
Show file tree
Hide file tree
Showing 20 changed files with 1,488 additions and 65 deletions.
3 changes: 2 additions & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ final def mod_dependencies = [
'athenaeum-284350:4633750' : [project.debug_pyrotech],
'pyrotech-306676:4956838' : [project.debug_pyrotech],
'mystical_world-282940:3460961' : [project.debug_roots],
'patchouli-306770:3162874' : [project.debug_roots, project.debug_natures_aura],
'patchouli-306770:3162874' : [project.debug_roots, project.debug_natures_aura, project.debug_prodigytech],
'prodigytech-297414:2769520' : [project.debug_prodigytech],
'roots-246183:3905074' : [project.debug_roots],
'rustic-256141:3107974' : [project.debug_rustic],
'thaumcraft-223628:2629023' : [project.debug_thaum],
Expand Down
13 changes: 13 additions & 0 deletions examples/assets/placeholdername/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,21 @@ itemGroup.groovyscript.example_creative_tab=GroovyScript Creative Tab
item.placeholdername.heartofauniverse.name=Heart of the Universe
item.placeholdername.clay_2.name=If clay is so good...
item.placeholdername.clay_3.name=Enchanted Clay
item.placeholdername.prodigy_stick.name=Prodigy Stick
item.placeholdername.snack.name=Snack
tile.placeholdername.generic_block.name=Generic Block
tile.placeholdername.dragon_egg_lamp.name=Dragon Egg Lamp

fluid.placeholdername.amongium=Amongium

# For the prodigy tech example
enchantment.level.11=XI
enchantment.level.12=XII
enchantment.level.13=XIII
enchantment.level.14=XIV
enchantment.level.15=XV
enchantment.level.16=XVI
enchantment.level.17=XVII
enchantment.level.18=XVIII
enchantment.level.19=XIX
enchantment.level.20=XX
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "placeholdername:items/prodigy_stick"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
195 changes: 195 additions & 0 deletions examples/postInit/prodigytech.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@

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

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

// Atomic Reshaper:
// Uses Hot Air and Primordium to convert items. Can have a weighted random based output.

mods.prodigytech.atomic_reshaper.removeByInput(ore('paper'))
// mods.prodigytech.atomic_reshaper.removeAll()

mods.prodigytech.atomic_reshaper.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:emerald_block'))
.primordium(10)
.time(50)
.register()

mods.prodigytech.atomic_reshaper.recipeBuilder()
.input(item('minecraft:gold_block'))
.output(item('minecraft:diamond_block'), 10)
.output(item('minecraft:carrot'), 3)
.primordium(7)
.register()


// Explosion Furnace:
// Uses an explosive, a dampener, and an optional reagent to convert items. The power value of all recipes, all explosives,
// and all dampeners should be close to avoid an efficiency loss.

// mods.prodigytech.explosion_furnace.removeAll()
mods.prodigytech.explosion_furnace.removeByOutput(item('prodigytech:ferramic_ingot'))

mods.prodigytech.explosion_furnace.recipeBuilder()
.input(ore('ingotGold'), item('minecraft:diamond'))
.craftPerReagent(8)
.power(160)
.output(item('minecraft:emerald_block'))
.register()

mods.prodigytech.explosion_furnace.recipeBuilder()
.input(item('minecraft:stone'))
.power(160)
.output(item('minecraft:glowstone'))
.register()


// Explosion Furnace Additives:
// Turn an item into an explosive or into a dampener when inserted into the Explosion Furnace.

// mods.prodigytech.explosion_furnace_additives.removeAllDampeners()
// mods.prodigytech.explosion_furnace_additives.removeAllExplosives()
mods.prodigytech.explosion_furnace_additives.removeDampener(ore('dustAsh'))
mods.prodigytech.explosion_furnace_additives.removeExplosive(ore('gunpowder'))

mods.prodigytech.explosion_furnace_additives.addDampener(item('minecraft:stone'), 50)
mods.prodigytech.explosion_furnace_additives.addExplosive(item('minecraft:cobblestone'), 50)

// Heat Sawmill:
// Wood processing machine with 1 input, 2 outputs and an optional chance for the 2nd output.

mods.prodigytech.heat_sawmill.removeByInput(ore('plankWood'))
// mods.prodigytech.heat_sawmill.removeAll()

mods.prodigytech.heat_sawmill.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'))
.time(50)
.register()

mods.prodigytech.heat_sawmill.recipeBuilder()
.input(item('minecraft:iron_ingot'))
.output(item('minecraft:coal'))
.register()

mods.prodigytech.heat_sawmill.recipeBuilder()
.input(item('minecraft:iron_block'))
.output(item('minecraft:emerald'), item('minecraft:clay'))
.register()

mods.prodigytech.heat_sawmill.recipeBuilder()
.input(item('minecraft:gold_block'))
.output(item('minecraft:emerald'), item('minecraft:nether_star'))
.secondaryChance(0.25)
.time(50)
.register()


// Magnetic Reassembler:
// A simple 1 to 1 processing machine for dusts.

mods.prodigytech.magnetic_reassembler.removeByInput(item('minecraft:gravel'))
// mods.prodigytech.magnetic_reassembler.removeAll()

mods.prodigytech.magnetic_reassembler.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'))
.time(50)
.register()

mods.prodigytech.magnetic_reassembler.recipeBuilder()
.input(item('minecraft:iron_ingot'))
.output(item('minecraft:coal'))
.register()


// Ore Refinery:
// Ore processing machine with 1 input, 2 outputs and an optional chance for the 2nd output.

mods.prodigytech.ore_refinery.removeByInput(ore('oreLapis'))
// mods.prodigytech.ore_refinery.removeAll()

mods.prodigytech.ore_refinery.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'))
.time(50)
.register()

mods.prodigytech.ore_refinery.recipeBuilder()
.input(item('minecraft:iron_ingot'))
.output(item('minecraft:coal'))
.register()

mods.prodigytech.ore_refinery.recipeBuilder()
.input(item('minecraft:iron_block'))
.output(item('minecraft:emerald'), item('minecraft:clay'))
.register()

mods.prodigytech.ore_refinery.recipeBuilder()
.input(item('minecraft:gold_block'))
.output(item('minecraft:emerald'), item('minecraft:nether_star'))
.secondaryChance(0.25)
.time(50)
.register()


// Primordialis Reactor:
// Turns organic matter into Primordium.

mods.prodigytech.primordialis_reactor.remove(ore('sugarcane'))
// mods.prodigytech.primordialis_reactor.removeAll()

mods.prodigytech.primordialis_reactor.add(item('minecraft:diamond'))

// Rotary Grinder:
// A simple 1 to 1 processing machine making dusts.

mods.prodigytech.rotary_grinder.removeByInput(item('minecraft:gravel'))
// mods.prodigytech.rotary_grinder.removeAll()

mods.prodigytech.rotary_grinder.recipeBuilder()
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'))
.time(50)
.register()

mods.prodigytech.rotary_grinder.recipeBuilder()
.input(item('minecraft:iron_ingot'))
.output(item('minecraft:coal'))
.register()


// Solderer:
// Performs recipes using Gold Dust, has a recipe catalyst, and uses up Circuit Boards and an optional extra input for each
// recipe.

mods.prodigytech.solderer.removeByAdditive(item('minecraft:iron_ingot'))
mods.prodigytech.solderer.removeByOutput(item('prodigytech:circuit_refined'))
mods.prodigytech.solderer.removeByPattern(item('prodigytech:pattern_circuit_refined'))
// mods.prodigytech.solderer.removeAll()
// mods.prodigytech.solderer.removeWithoutAdditive()

mods.prodigytech.solderer.recipeBuilder()
.pattern(item('minecraft:clay'))
.input(item('minecraft:gold_ingot'))
.output(item('minecraft:diamond'))
.gold(5)
.time(100)
.register()

mods.prodigytech.solderer.recipeBuilder()
.pattern(item('minecraft:coal_block'))
.output(item('minecraft:nether_star'))
.gold(75)
.register()


// Zorra Altar:
// Allows over-enchanting Zorrasteel equipment.

mods.prodigytech.zorra_altar.addEnchantment('sword', enchantment('minecraft:power'), 10)
mods.prodigytech.zorra_altar.addEnchantment('stick', enchantment('minecraft:knockback'), 20)
mods.prodigytech.zorra_altar.removeEnchantment('sword', enchantment('minecraft:sharpness'))

21 changes: 21 additions & 0 deletions examples/preInit/prodigytech.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// MODS_LOADED: prodigytech

import lykrast.prodigytech.common.item.IZorrasteelEquipment
import lykrast.prodigytech.common.recipe.ZorraAltarManager

if (!isLoaded('prodigytech')) return
println 'mod \'prodigytech\' detected, running script'

// Create an item at the location 'placeholdername:prodigy_stick' enchantable in the Zorra Altar
// Note: due to the PT's implementation it is difficult to make other mod's items enchantable
// This merely registers the item, the post-init script adds the specific enchantments
class ProdigyStick extends Item implements IZorrasteelEquipment {
static registry = mods.prodigytech.zorra_altar.createRegistry('stick')

ZorraAltarManager getManager() {
return registry
}
}

content.registerItem('prodigy_stick', new ProdigyStick())

1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ debug_lazy_ae2 = false
debug_mekanism = false
debug_natures_aura = false
debug_packmode = false
debug_prodigytech = false
debug_projecte = false
debug_pyrotech = false
debug_roots = false
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.cleanroommc.groovyscript.compat.mods.lazyae2.LazyAE2;
import com.cleanroommc.groovyscript.compat.mods.mekanism.Mekanism;
import com.cleanroommc.groovyscript.compat.mods.naturesaura.NaturesAura;
import com.cleanroommc.groovyscript.compat.mods.prodigytech.ProdigyTech;
import com.cleanroommc.groovyscript.compat.mods.projecte.ProjectE;
import com.cleanroommc.groovyscript.compat.mods.pyrotech.PyroTech;
import com.cleanroommc.groovyscript.compat.mods.roots.Roots;
Expand Down Expand Up @@ -92,6 +93,7 @@ public class ModSupport {
public static final GroovyContainer<Mekanism> MEKANISM = new InternalModContainer<>("mekanism", "Mekanism", Mekanism::new);
public static final GroovyContainer<LazyAE2> LAZYAE2 = new InternalModContainer<>("threng", "LazyAE2", LazyAE2::new, "lazyae2");
public static final GroovyContainer<NaturesAura> NATURES_AURA = new InternalModContainer<>("naturesaura", "Nature's Aura", NaturesAura::new);
public static final GroovyContainer<ProdigyTech> PRODIGY_TECH = new InternalModContainer<>("prodigytech", "Prodigy Tech", ProdigyTech::new);
public static final GroovyContainer<ProjectE> PROJECT_E = new InternalModContainer<>("projecte", "ProjectE", ProjectE::new);
public static final GroovyContainer<PyroTech> PYROTECH = new InternalModContainer<>("pyrotech", "Pyrotech", PyroTech::new);
public static final GroovyContainer<Roots> ROOTS = new InternalModContainer<>("roots", "Roots 3", Roots::new);
Expand Down
Loading

0 comments on commit 3c0af9b

Please sign in to comment.