From 5cd0f160d52af7a907250c696bec283c9681b830 Mon Sep 17 00:00:00 2001 From: SrdjanV Date: Fri, 19 Apr 2024 23:49:20 +0200 Subject: [PATCH] Update examples --- .../Reservoirs.zs} | 0 examples/GroovyScript/Reservoirs.groovy | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+) rename examples/{examples.zs => CraftTweaker/Reservoirs.zs} (100%) create mode 100644 examples/GroovyScript/Reservoirs.groovy diff --git a/examples/examples.zs b/examples/CraftTweaker/Reservoirs.zs similarity index 100% rename from examples/examples.zs rename to examples/CraftTweaker/Reservoirs.zs diff --git a/examples/GroovyScript/Reservoirs.groovy b/examples/GroovyScript/Reservoirs.groovy new file mode 100644 index 0000000..e2cc094 --- /dev/null +++ b/examples/GroovyScript/Reservoirs.groovy @@ -0,0 +1,37 @@ +//Register an power tier +var power = mods.tweakedMods.PowerTier.recipeBuilder() + .capacity(5555555) + .rft(5) + .register() + +/* +This method will register a reservoir with the chance to drain fluid from the chunk. +If drainChance is set to 0.25 it will have a 25% chance to drain from the chunk +If drainChance is set to 0.5 it will have a 50% chance to drain from the chunk +If drainChance is set to 1 it will have a 100% chance to drain from the chunk, its the same as registering it normally +*/ + +//Register an gas reservoir +mods.tweakedMods.GasReservoir.recipeBuilder() + .name("GroovyGasReservoir") + .fluid(gas("hydrogen")) + .weight(80000) + .powerTier(power) + .minSize(50) + .maxSize(1500) + .pumpSpeed(10) + .replenishRate(5) + .register() + +//Remove an gas reservoir +mods.tweakedMods.GasReservoir.remove("Some_Name") + +//Modify an reservoir +mods.tweakedMods.GasReservoir.get("lava").toBuilder() + .drainChance(0.8).maxSize(Integer.MAX_VALUE).register() + +/* +Groovy compat is located in 'io.github.srdjanv.tweakedpetroleum.common.compat.groovy' + +Also see https://cleanroommc.com/groovy-script/ +*/ \ No newline at end of file