PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

50M Downloads

Configurable Plastic Mixer Liquid Output

pyure opened this issue ยท 13 comments

commented

Team, possibly related to #326:

We need a way to either disable or tweak the output when melting plastic. The change in 326 to allow us to create plastic from arbitrary liquids via CT was fantastic, but it created a back door exploit where the player can then melt that plastic into polyethylene.

Being able to set the output fluid when melting plastic sheets (via the config or via scripts) would be excellent, but even just outright disabling the melting capability would be fine.

commented

Yeah, I see the problem. I'll have a think about the cleanest way of handling this...

commented
commented

OK, how about this:

  • Removed the methods I added in #326 (sorry!)
  • Added some new much more powerful methods, allowing melting / solidifying pretty much anything

New methods:

# 100mB Lava-> Concrete
mods.pneumaticcraft.plasticmixer.addSolidifyOnlyRecipe(<liquid:lava> * 100, <minecraft:concrete>);
# Lapis Block -> 1000mB Coolant (100C to melt)
mods.pneumaticcraft.plasticmixer.addMeltOnlyRecipe(<liquid:ic2coolant> * 1000, <minecraft:lapis_block>, 373);
# 10mB Pyrotheum <-> Rockwool (300C to melt)
mods.pneumaticcraft.plasticmixer.addRecipe(<liquid:pyrotheum> * 10, <thermalfoundation:rockwool>, 573);

# remove recipe(s)
mods.pneumaticcraft.plasticmixer.removeRecipe(<liquid:lava>);
mods.pneumaticcraft.plasticmixer.removeAllRecipes();

For your case, something like

mods.pneumaticcraft.plasticmixer.removeAllRecipes();
mods.pneumaticcraft.plasticmixer.addSolidifyOnlyRecipe(<liquid:oil> * 1000, <pneumaticcraft:plastic>);

should work, I think? That prevents plastic being melted down again in the mixer.

Anyway, this can be played with in build 355 from https://jenkins.k-4u.nl/job/PneumaticCraft-Repressurized/ if you'd like to test it out...

commented

desht, apologies, I've been away a few days. Will get on this asap.

commented

The new solidify-only methods work exceptionally well. I love the extra flexibility. (I'm also really glad you switched up the zenclass name, that was an obvious oops)

I could not get the melting functions to work, either melting-only or the two-way version.

Script Tests:

Creates plastic sheet, consumes 200mb input fluid:
mods.pneumaticcraft.plasticmixer.addSolidifyOnlyRecipe(<liquid:oil_heavy> * 200, <pneumaticcraft:plastic>); // Works

Generates recipe in JEI but does not melt plastic when (well) over 100C:
mods.pneumaticcraft.plasticmixer.addMeltOnlyRecipe(<liquid:oil> * 200, <pneumaticcraft:plastic>, 373); // Does not work

Generates JEI in both recipes.
Oil -> Plastic fails because Plastic Mixer thinks the tank is empty.
Plastic -> Oil fails same as previous (does not melt when over 100C)
mods.pneumaticcraft.plasticmixer.addRecipe(<liquid:oil> * 400, <pneumaticcraft:plastic>, 373); // No worky.

commented

That's odd, the second two recipes work absolutely fine for me. Oil is converted to/from plastic as expected in both cases. Did you remove the default recipe (mods.pneumaticcraft.plasticmixer.removeAllRecipes()) ? That would interfere.

Also just to confirm the next release will use modified method signatures as you suggested in the commit:

    @ZenMethod
    public static void addRecipe(ILiquidStack liquid, IItemStack stack, int temperature) {
        CraftTweaker.ADDITIONS.add(new LiquidPlasticAction(Helper.toFluid(liquid), Helper.toStack(stack), temperature, true, true));
    }

    @ZenMethod
    public static void addMeltOnlyRecipe(IItemStack stackInput, ILiquidStack liquidOutput, int temperature) {
        CraftTweaker.ADDITIONS.add(new LiquidPlasticAction(Helper.toFluid(liquidOutput), Helper.toStack(stackInput), temperature, true, false));
    }

    @ZenMethod
    public static void addSolidifyOnlyRecipe(ILiquidStack liquidInput, IItemStack stackOutput) {
        CraftTweaker.ADDITIONS.add(new LiquidPlasticAction(Helper.toFluid(liquidInput), Helper.toStack(stackOutput), 0, false, true));
    }
commented

Hm, it does seem to work if I run it in isolation, so its a conflict as you suggested. I haven't figured out the exact combination of rows yet that causes it. Still tinkering.

commented

Definitely conflicts. Most of them on second glance make sense. This one I feel doesn't:

mods.pneumaticcraft.plasticmixer.removeAllRecipes();
mods.pneumaticcraft.plasticmixer.addSolidifyOnlyRecipe(<liquid:oil_light> * 600, <pneumaticcraft:plastic>);
mods.pneumaticcraft.plasticmixer.addRecipe(<liquid:oil_heavy> * 400, <pneumaticcraft:plastic>, 373); 
  • 600 units of oil_light should make plastic.
  • 400 units of oil_heavy should make plastic
  • 1 unit of plastic should make 400 units of oil_heavy (does not logically conflict with oil_light)
commented

"oil_heavy" and "oil_light" are from which mod?

commented

Actually, nerver mind, think I've figured out the problem (searching for the recipe could return the wrong one, i.e. trying to melt plastic found the solidify-only recipe, which of course didn't work). Next build should resolve that...

commented

desht, I tried the 356 build and it works exactly as I'd expect :)

commented

Build 356 (just building now) should hopefully fix the problems you saw.

commented

Added in 0.11.0 release