mojira.dev
MC-311169

Number Providers for Fuel Times are unnecessarily complex

The new number providers for fuel time in 26.3 Snapshot 9 are in the form of (a * b) or (a * c), when a * (b or c) is much simpler. This also makes custom datapacks slightly simpler, as each fuel time only needs to be updated once, not twice in the same file.

Old (time_coal.json):

{
  "type": "minecraft:conditional",
  "condition": "minecraft:block/fast_cooking",
  "on_false": {
    "type": "minecraft:product",
    "operands": [
      1600.0,
      "minecraft:cooking/normal_burn_time_multiplier"
    ]
  },
  "on_true": {
    "type": "minecraft:product",
    "operands": [
      1600.0,
      "minecraft:cooking/fast_burn_time_multiplier"
    ]
  }
}

Proposed:

{
  "type": "minecraft:product",
  "operands": [
    1600.0,
    {
      "type": "minecraft:conditional",
      "condition": "minecraft:block/fast_cooking",
      "on_false": "minecraft:cooking/normal_burn_time_multiplier",
      "on_true": "minecraft:cooking/fast_burn_time_multiplier"
    }
  ]
}

By inspecting the decompiled code, switching the order of the product and conditional number providers in NumberProviders#cookingto something like the following.

    private static NumberProvider cooking(
        final HolderGetter<LootItemCondition> predicates,
        final Holder.Reference<NumberProvider> normalBurnTime,
        final Holder.Reference<NumberProvider> fastBurnTime,
        final int timeSeconds
    ) {
        Holder<LootItemCondition> fasterCookingBlocks = predicates.getOrThrow(LootPredicates.FAST_FURNACE);
        return Product.product(
            ConstantValue.exactly(timeSeconds),
            new ConditionalValue(
              fasterCookingBlocks,
              fastBurnTime,
              normalBurnTime
            )
        );
    }

Linked issues

Comments 1

Thank you for your report!
After consideration, the issue is being closed as Invalid.

This report does not describe a bug.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

OroArmor

(Unassigned)

Confirmed

26.3 Snapshot 9

Retrieved