Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-171981

Map of fuel times is created anew every time an item is placed in a furnace, instead of being cached

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w03a
    • 1.15.2, 1.16.1, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2, 1.16.4 Pre-release 1, 1.16.4, 20w46a, 20w48a, 20w49a, 21w03a, 1.16.5, 21w07a, 1.17, 1.17.1 Pre-release 1, 1.17.1, 21w44a, 1.19.3
    • None
    • Confirmed
    • Performance
    • Low
    • Gameplay

      Yes, every time.

      Names used are based on the Yarn mappings for the game.

      // AbstractFurnaceBlockEntity
      public static Map<Item, Integer> createFuelTimeMap() {
        Map<Item, Integer> map = Maps.newLinkedHashMap();
        addFuel(map, Items.LAVA_BUCKET, 20000);
        addFuel(map, Blocks.COAL_BLOCK, 16000);
        addFuel(map, Items.BLAZE_ROD, 2400);
        //...etc
        return map;
      }
      
      protected int getFuelTime(ItemStack stack) {
         if (stack.isEmpty()) {
            return 0;
         }
      
         return createFuelTimeMap().getOrDefault(stack.getItem(), 0);
      }
      
      public static boolean canUseAsFuel(ItemStack stack) {
         return createFuelTimeMap().containsKey(stack.getItem());
      }

      Possible fix: make fuel/burn times part of datapacks and remove that map entirely. That will make it easier to customise for players, map makers, and modders, and would ensure the values are correctly available when they're actually needed.

       

      I've seen a few people in the Fabric discord playing around with the idea of a recipe type for furnace, blast furnace, and smoker fuels. #justsaiyan

            Unassigned Unassigned
            awr_* Sollace
            Votes:
            17 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: