NovaEngineering-Source / ModularMachinery-Community-Edition

Customize your machinery with more powerful features.
https://www.curseforge.com/minecraft/mc-mods/modularmachinery-community-edition
GNU General Public License v3.0
28 stars 12 forks source link

Modifier: Duration no longer works as of r39 #30

Closed jchung01 closed 1 year ago

jchung01 commented 1 year ago

If you define a modifier for a modular machine in the json targeting duration, this no longer affects the recipe time as of r39. I tested on r38 and the faster recipe works as intended, but not from r39 and higher. I would assume it's because of something you changed to implement the upgrade system.

As a quick test, replace gold block with diamond block for following machine to expect faster recipe. Works in r38, does not in >= r39. I believe recipes added by CT also are not affected and that other modifier types work correctly (like modifying item I/O rates). Test files: In config\modularmachinery\machinery, file gaia_altar.json

{
    "registryname": "gaia_altar",
    "localizedname": "Gaia Altar",
    "color": "3297c9",
    "modifiers": [
        {
            "elements": "minecraft:diamond_block",
            "x": 0,
            "y": 0,
            "z": 3,
            "description": "Replace for faster recipes",
            "modifier": {
                "io": "output",
                "target": "modularmachinery:duration",
                "operation": 1,
                "multiplier": 0.05
            }
        }
    ],
    "parts": [
        {
            "x": -1,
            "y": 0,
            "z": 0,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -3,
            "y": 0,
            "z": 3,
            "elements": [
                "modularmachinery:blockoutputbus"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 0,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 0,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -3,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 0,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 3,
            "elements": [
                "minecraft:gold_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 0,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 3,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -1,
            "y": 0,
            "z": 6,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 0,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 3,
            "y": 0,
            "z": 3,
            "elements": [
                "modularmachinery:blockinputbus"
            ]
        },
        {
            "x": 0,
            "y": 0,
            "z": 6,
            "elements": [
                "modularmachinery:blockenergyinputhatch"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 1,
            "y": 0,
            "z": 6,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 0,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 3,
            "y": 0,
            "z": 4,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 1,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 1,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 1,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 1,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 1,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 1,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 1,
            "z": 3,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 2,
            "y": 1,
            "z": 5,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -2,
            "y": 0,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": -3,
            "y": 0,
            "z": 2,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 2,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        },
        {
            "x": 0,
            "y": 3,
            "z": 1,
            "elements": [
                "minecraft:iron_block"
            ]
        }
    ]}

In config\modularmachinery\recipes, file gaia_altar_diamond.json

{
    "machine": "gaia_altar",
    "registryName": "gaia_altar_diamond",
    "recipeTime": 100,
    "requirements": [
        {
            "type": "modularmachinery:energy",
            "io-type": "input",
            "energyPerTick": 100
        },
        {
            "type": "modularmachinery:item",
            "io-type": "output",
            "item": "minecraft:diamond",
            "amount": 1
        },
        {
            "type": "modularmachinery:item",
            "io-type": "input",
            "item": "minecraft:coal",
            "amount": 1
        },
        {
            "type": "modularmachinery:item",
            "io-type": "input",
            "item": "minecraft:tnt",
            "amount": 1
        }
    ]
}
KasumiNova commented 1 year ago

Please change "io": "output" to "io": "input".