Skip to content

Commit

Permalink
Boilerplate Registry for Lists (#234)
Browse files Browse the repository at this point in the history
* make addBackup and addScripted return a boolean

* add boilerplate class for list registry

* use boilerplate list in relevant places

* handle slightly special list cases

* convert some new registries to StandardListRegistry

* rename to getRecipes

* add some javadocs to relevant classes

* handle generics

* make better with mods heat an Entry-type

* document add and remove methods for standard list

* fix class name pattern not including underscores

* dont print an empty line if no example text

* update examples

* readd removal example for life essence

* add more lists

* explosion furnace example one line update

* use getRecipes() in valid places

* convert relevant new registries to StandardListRegistry

* update related examples

* only call getRecipes once for relevant SLR methods

* disable gradle properties
  • Loading branch information
WaitingIdly authored Oct 2, 2024
1 parent ac9f813 commit ea07ef5
Show file tree
Hide file tree
Showing 187 changed files with 1,426 additions and 5,445 deletions.
46 changes: 23 additions & 23 deletions examples/postInit/advancedrocketry.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Auto generated groovyscript example file
// MODS_LOADED: advancedrocketry

println 'mod \'advancedrocketry\' detected, running script'
log.info 'mod \'advancedrocketry\' detected, running script'

// Centrifuge:
// Converts an input fluid into up to 12 output items and up to 4 output fluids, consuming RF
// Converts an input fluid into up to 12 output items and up to 4 output fluids, consuming RF.

// mods.advancedrocketry.centrifuge.removeAll()
mods.advancedrocketry.centrifuge.removeByInput(fluid('enrichedlava'))
// mods.advancedrocketry.centrifuge.removeAll()

mods.advancedrocketry.centrifuge.recipeBuilder()
.fluidInput(fluid('lava') * 500)
Expand All @@ -22,11 +22,11 @@ mods.advancedrocketry.centrifuge.recipeBuilder()


// Chemical Reactor:
// Converts up to 2 fluids and 8 input items into up to 1 fluid and up to 4 output items, consuming RF
// Converts up to 2 fluids and 8 input items into up to 1 fluid and up to 4 output items, consuming RF.

// mods.advancedrocketry.chemical_reactor.removeAll()
mods.advancedrocketry.chemical_reactor.removeByInput(item('minecraft:bone'))
mods.advancedrocketry.chemical_reactor.removeByOutput(item('minecraft:leather_helmet'))
// mods.advancedrocketry.chemical_reactor.removeAll()

mods.advancedrocketry.chemical_reactor.recipeBuilder()
.input(item('minecraft:chorus_fruit_popped'))
Expand All @@ -39,11 +39,11 @@ mods.advancedrocketry.chemical_reactor.recipeBuilder()


// Crystallizer:
// Converts up to 4 input items into up to 4 output items, consuming RF
// Converts up to 4 input items into up to 4 output items, consuming RF.

// mods.advancedrocketry.crystallizer.removeAll()
mods.advancedrocketry.crystallizer.removeByInput(item('libvulpes:productingot', 3))
mods.advancedrocketry.crystallizer.removeByOutput(item('libvulpes:productgem'))
// mods.advancedrocketry.crystallizer.removeAll()

mods.advancedrocketry.crystallizer.recipeBuilder()
.input(item('minecraft:blaze_powder') * 4)
Expand All @@ -54,11 +54,11 @@ mods.advancedrocketry.crystallizer.recipeBuilder()


// Cutting Machine:
// Converts up to 4 input items into up to 4 output items, consuming RF
// Converts up to 4 input items into up to 4 output items, consuming RF.

// mods.advancedrocketry.cutting_machine.removeAll()
mods.advancedrocketry.cutting_machine.removeByInput(item('advancedrocketry:alienwood'))
mods.advancedrocketry.cutting_machine.removeByOutput(item('minecraft:planks', 1))
// mods.advancedrocketry.cutting_machine.removeAll()

mods.advancedrocketry.cutting_machine.recipeBuilder()
.input(item('minecraft:blaze_rod'))
Expand All @@ -69,11 +69,11 @@ mods.advancedrocketry.cutting_machine.recipeBuilder()


// Electric Arc Furnace:
// Converts input items and fluids into output items and fluids, consuming RF
// Converts input items and fluids into output items and fluids, consuming RF.

// mods.advancedrocketry.electric_arc_furnace.removeAll()
mods.advancedrocketry.electric_arc_furnace.removeByInput(item('minecraft:iron_ingot'))
mods.advancedrocketry.electric_arc_furnace.removeByOutput(item('libvulpes:productingot', 3))
// mods.advancedrocketry.electric_arc_furnace.removeAll()

mods.advancedrocketry.electric_arc_furnace.recipeBuilder()
.input(item('minecraft:blaze_powder') * 4)
Expand All @@ -84,11 +84,11 @@ mods.advancedrocketry.electric_arc_furnace.recipeBuilder()


// Electrolyser:
// Converts an input fluid into up to 2 output fluids, consuming RF
// Converts an input fluid into up to 2 output fluids, consuming RF.

// mods.advancedrocketry.electrolyser.removeAll()
mods.advancedrocketry.electrolyser.removeByInput(fluid('water'))
// mods.advancedrocketry.electrolyser.removeByOutput(fluid('oxygen'))
// mods.advancedrocketry.electrolyser.removeAll()

mods.advancedrocketry.electrolyser.recipeBuilder()
.fluidInput(fluid('lava') * 10)
Expand All @@ -99,11 +99,11 @@ mods.advancedrocketry.electrolyser.recipeBuilder()


// Lathe:
// Converts up to 4 input items into up to 4 output items, consuming RF
// Converts up to 4 input items into up to 4 output items, consuming RF.

// mods.advancedrocketry.lathe.removeAll()
mods.advancedrocketry.lathe.removeByInput(item('libvulpes:productingot', 6))
mods.advancedrocketry.lathe.removeByOutput(item('libvulpes:productrod', 4))
// mods.advancedrocketry.lathe.removeAll()

mods.advancedrocketry.lathe.recipeBuilder()
.input(ore('plankWood'))
Expand All @@ -114,11 +114,11 @@ mods.advancedrocketry.lathe.recipeBuilder()


// Precision Assembler:
// Converts input items and fluids into output items and fluids, consuming RF
// Converts input items and fluids into output items and fluids, consuming RF.

// mods.advancedrocketry.precision_assembler.removeAll()
mods.advancedrocketry.precision_assembler.removeByInput(item('minecraft:redstone_block'))
mods.advancedrocketry.precision_assembler.removeByOutput(item('advancedrocketry:atmanalyser'))
// mods.advancedrocketry.precision_assembler.removeAll()

mods.advancedrocketry.precision_assembler.recipeBuilder()
.input(item('minecraft:fishing_rod'), item('minecraft:carrot'))
Expand All @@ -129,11 +129,11 @@ mods.advancedrocketry.precision_assembler.recipeBuilder()


// Precision Laser Etcher:
// Converts up to 4 input items into up to 4 output items, consuming RF
// Converts up to 4 input items into up to 4 output items, consuming RF.

// mods.advancedrocketry.precision_laser_etcher.removeAll()
mods.advancedrocketry.precision_laser_etcher.removeByInput(item('minecraft:redstone_block'))
mods.advancedrocketry.precision_laser_etcher.removeByOutput(item('advancedrocketry:itemcircuitplate'))
// mods.advancedrocketry.precision_laser_etcher.removeAll()

mods.advancedrocketry.precision_laser_etcher.recipeBuilder()
.input(item('minecraft:blaze_powder') * 4, item('advancedrocketry:wafer'))
Expand All @@ -144,11 +144,11 @@ mods.advancedrocketry.precision_laser_etcher.recipeBuilder()


// Rolling Machine:
// Consumes up to 1 input fluid and up to 4 input items into up to 4 output items, consuming RF
// Consumes up to 1 input fluid and up to 4 input items into up to 4 output items, consuming RF.

// mods.advancedrocketry.rolling_machine.removeAll()
mods.advancedrocketry.rolling_machine.removeByInput(item('libvulpes:productplate'))
mods.advancedrocketry.rolling_machine.removeByOutput(item('libvulpes:productsheet', 1))
// mods.advancedrocketry.rolling_machine.removeAll()

mods.advancedrocketry.rolling_machine.recipeBuilder()
.input(item('minecraft:snow'), fluid('water') * 300)
Expand All @@ -159,11 +159,11 @@ mods.advancedrocketry.rolling_machine.recipeBuilder()


// Small Plate Presser:
// Converts a block right below it into output items when powered by redstone
// Converts a block right below it into output items when powered by redstone.

// mods.advancedrocketry.small_plate_presser.removeAll()
mods.advancedrocketry.small_plate_presser.removeByInput(item('minecraft:iron_block'))
mods.advancedrocketry.small_plate_presser.removeByOutput(item('libvulpes:productplate', 2))
// mods.advancedrocketry.small_plate_presser.removeAll()

mods.advancedrocketry.small_plate_presser.recipeBuilder()
.input(item('minecraft:cobblestone'))
Expand Down
3 changes: 0 additions & 3 deletions examples/postInit/aether_legacy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mods.aether_legacy.accessory.recipeBuilder()
.register()



// Enchanter:
// Enchanting is a mechanic used to create new items, as well as repair tools, armor, and weapons, using the Altar block.

Expand All @@ -30,7 +29,6 @@ mods.aether_legacy.enchanter.recipeBuilder()
.register()



// Enchanter Fuel:
// By default, the Enchanter (Altar) takes Ambrosium Shards as fuel. Using GroovyScript, custom fuels can be added.

Expand All @@ -52,7 +50,6 @@ mods.aether_legacy.freezer.recipeBuilder()
.register()



// Freezer Fuel:
// By default, the Freezer takes Icestone as fuel. Using GroovyScript, custom fuels can be added.

Expand Down
3 changes: 0 additions & 3 deletions examples/postInit/alchemistry.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ mods.alchemistry.atomizer.recipeBuilder()
.register()



// Chemical Combiner:
// Converts up to 9 input itemstacks into an output itemstack.

Expand Down Expand Up @@ -110,7 +109,6 @@ mods.alchemistry.evaporator.recipeBuilder()
.register()



// Liquifier:
// Converts an input itemstack into an output fluidstack, consuming a set amount of power.

Expand All @@ -129,4 +127,3 @@ mods.alchemistry.liquifier.recipeBuilder()
.register()



5 changes: 0 additions & 5 deletions examples/postInit/astralsorcery.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ mods.astralsorcery.chalice_interaction.recipeBuilder()
.register()



// Constellation:
// Create a custom Constellation.

Expand Down Expand Up @@ -67,7 +66,6 @@ mods.astralsorcery.constellation.signatureItems()
.register()



// Fountain:
// Adds virtual aquifers that can be accessed via the Evershifting Fountain's Necromantic Prime.

Expand All @@ -82,7 +80,6 @@ mods.astralsorcery.fountain.chanceHelper()
.register()



// Grindstone:
// Converts an item into an itemstack with a chance of getting twice the amount after right clicking the grindstone based
// on weight.
Expand All @@ -105,7 +102,6 @@ mods.astralsorcery.grindstone.recipeBuilder()
.register()



// Infusion Altar:
// Consumes buckets of Liquid Starlight when interacted with by a Resonating Wand to convert input items into output
// itemstacks after a time.
Expand Down Expand Up @@ -180,7 +176,6 @@ mods.astralsorcery.lightwell.recipeBuilder()
.register()



// Perk Tree:
// Create a custom perk with a custom effect, at a given location.

Expand Down
1 change: 0 additions & 1 deletion examples/postInit/avaritia.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,3 @@ mods.avaritia.extreme_crafting.shapelessBuilder()
.register()



2 changes: 2 additions & 0 deletions examples/postInit/betterwithmods.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ mods.betterwithmods.crucible.recipeBuilder()
// Heat:
// Creates new levels or adds new blocks to old heat levels.

// mods.betterwithmods.heat.removeAll()

mods.betterwithmods.heat.add(4, item('minecraft:redstone_block'), item('minecraft:redstone_torch'))
mods.betterwithmods.heat.add(3, 'torch')

Expand Down
7 changes: 0 additions & 7 deletions examples/postInit/bloodmagic.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mods.bloodmagic.alchemy_array.recipeBuilder()
.register()



// Alchemy Table:
// Converts up to 6 input items into an output itemstack, with configurable time, minimum tier of Blood Orb required, and
// Life Essence drained from the Orb network.
Expand All @@ -54,7 +53,6 @@ mods.bloodmagic.alchemy_table.recipeBuilder()
.register()



// Blood Altar:
// Converts an input item into an output itemstack, draining life essence from the altar at a base rate and requiring at
// least a specific tier.
Expand Down Expand Up @@ -82,7 +80,6 @@ mods.bloodmagic.blood_altar.recipeBuilder()
.register()



// Meteor:
// Throwing an input catalyst atop an activated Mark of the Falling Tower Ritual will spawn a meteor made of the given
// components, size, explosion strength, and Life Essence cost.
Expand Down Expand Up @@ -110,7 +107,6 @@ mods.bloodmagic.meteor.recipeBuilder()
.register()



// Sacrificial:
// How much Life Essence is gained when using the Sacrificial Dagger on a mob.

Expand All @@ -125,7 +121,6 @@ mods.bloodmagic.sacrificial.recipeBuilder()
.register()



// Tartaric Forge:
// Converts up to 4 input items into an output itemstack, requiring a Tartaric gem with a minimum amount of souls, and
// consuming some.
Expand All @@ -150,7 +145,6 @@ mods.bloodmagic.tartaric_forge.recipeBuilder()
.register()



// Tranquility:
// Blocks in the area around the Tranquility Altar provide tranquility up to the Altar's cap, with reduced effect the more
// of a particular type of Tranquility is provided.
Expand Down Expand Up @@ -178,4 +172,3 @@ mods.bloodmagic.tranquility.recipeBuilder()
.register()



8 changes: 0 additions & 8 deletions examples/postInit/botania.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mods.botania.apothecary.recipeBuilder()
.register()



// Brew Effect:
// Creates a custom brew, but not a recipe for the brew.

Expand Down Expand Up @@ -66,11 +65,9 @@ mods.botania.elven_trade.recipeBuilder()
.register()



// Magnet:
// Add or remove items from the magnet blacklist.


mods.botania.magnet.addToBlacklist(item('minecraft:diamond'))

// Mana Infusion:
Expand All @@ -89,7 +86,6 @@ mods.botania.mana_infusion.recipeBuilder()
.register()



// Orechid:
// Converts stone blocks into one of a few ore blocks at the cost of mana.

Expand Down Expand Up @@ -127,7 +123,6 @@ mods.botania.pure_daisy.recipeBuilder()
.register()



// Rune Altar:
// Converts a items inputs into an item output at the cost of mana when a Livingrock item is thrown atop the altar and
// right clicked with a Wand of the Forest.
Expand All @@ -144,7 +139,6 @@ mods.botania.rune_altar.recipeBuilder()
.register()



// Lexicon Knowledge:
// Creates a new type of knowledge that Lexica Botania entries may be gated with. Can only be created.

Expand Down Expand Up @@ -194,5 +188,3 @@ mods.botania.entry.entryBuilder()
.register()




3 changes: 0 additions & 3 deletions examples/postInit/enderio.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ mods.enderio.enchanter.recipeBuilder()
.register()



// Fluid Coolant:
// Create a Coolant with a given coolant rate that produces power with a Fuel while in a Combustion Generator.

Expand Down Expand Up @@ -153,7 +152,6 @@ mods.enderio.slice_n_splice.recipeBuilder()
.register()



// Soulbinder:
// Converts an input itemstack into an output itemstack, requiring one of several entities in soul vials, using energy and
// giving XP. Must have a unique name. To function properly, the input entities must be allowed in Soul Vials.
Expand Down Expand Up @@ -206,7 +204,6 @@ mods.enderio.tank.recipeBuilder()
.register()



// Vat:
// Converts an input fluidstack into an output itemstack at a rate based on up 2 itemstack inputs, and using power. Can be
// set to require at least NORMAL or ENHANCED tiers, or to IGNORE the tier. NORMAL and IGNORE are effectively the same.
Expand Down
Loading

0 comments on commit ea07ef5

Please sign in to comment.