From adb6a91642c9fa9fd635bd38aad3318c266e8326 Mon Sep 17 00:00:00 2001 From: Thomas Vermeer Date: Sun, 14 Jun 2026 11:00:05 +0200 Subject: [PATCH 1/2] feat: add smelt-items-per-refill setting to AutoSmelter - Added `smelt-items-per-refill` setting so users can control how many items are smelted per action - Default value is now 8 (instead of always 64) - Improved consistency with fuel refilling Addresses suggestion #6331 --- .../systems/modules/world/AutoSmelter.java | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java index 21a4d238f3..f0d7a167e7 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java @@ -1,5 +1,5 @@ /* - * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client). + * This file is part of the Meteor Client distribution[](https://github.com/MeteorDevelopment/meteor-client). * Copyright (c) Meteor Development. */ @@ -54,6 +54,15 @@ public class AutoSmelter extends Module { .build() ); + private final Setting smeltItemsPerRefill = sgGeneral.add(new IntSetting.Builder() + .name("smelt-items-per-refill") + .description("How many items to put into the furnace each time it refills") + .defaultValue(8) + .range(1, 64) + .sliderRange(1, 16) + .build() + ); + private final Setting disableWhenOutOfItems = sgGeneral.add(new BoolSetting.Builder() .name("disable-when-out-of-items") .description("Disable the module when you run out of items") @@ -121,7 +130,27 @@ private void insertItems(AbstractFurnaceMenu c) { if (slot == -1) return; - InvUtils.move().fromId(slot).toId(0); + ItemStack sourceStack = c.slots.get(slot).getItem(); + int moveCount = Math.min(smeltItemsPerRefill.get(), sourceStack.getCount()); + + moveSmeltItems(c, slot, moveCount); + } + + private void moveSmeltItems(AbstractFurnaceMenu c, int fromId, int amount) { + if (amount <= 0 || mc.player == null || mc.gameMode == null) return; + if (!mc.player.containerMenu.getCarried().isEmpty()) return; + + mc.gameMode.handleContainerInput(c.containerId, fromId, 0, ContainerInput.PICKUP, mc.player); + + for (int i = 0; i < amount; i++) { + if (mc.player.containerMenu.getCarried().isEmpty()) break; + mc.gameMode.handleContainerInput(c.containerId, 0, 1, ContainerInput.PICKUP, mc.player); + } + + if (!mc.player.containerMenu.getCarried().isEmpty()) { + mc.gameMode.handleContainerInput(c.containerId, fromId, 0, ContainerInput.PICKUP, mc.player); + } + c.slots.getFirst().getItem().isEmpty(); } From d1430cf580596fa4f6887a2fec295c3610701730 Mon Sep 17 00:00:00 2001 From: Thomas Vermeer Date: Sun, 14 Jun 2026 11:06:16 +0200 Subject: [PATCH 2/2] docs: add comments to AutoSmelter module - Added explanatory comments throughout the AutoSmelter module - Documented the new `smeltItemsPerRefill` logic - Clarified purpose of `moveSmeltItems` and `insertItems` methods - Improved code readability and maintainability No functional changes. --- .../systems/modules/world/AutoSmelter.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java index f0d7a167e7..f0a235b3f3 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/world/AutoSmelter.java @@ -54,6 +54,7 @@ public class AutoSmelter extends Module { .build() ); + // Added to address user suggestion - allows control over how many items are smelted per action private final Setting smeltItemsPerRefill = sgGeneral.add(new IntSetting.Builder() .name("smelt-items-per-refill") .description("How many items to put into the furnace each time it refills") @@ -91,27 +92,29 @@ private boolean smeltableItemFilter(Item item) { } public void tick(AbstractFurnaceMenu c) { - // Limit actions to happen every n ticks + // Limit actions to happen every n ticks to prevent lag and double actions if (mc.player.tickCount % 10 == 0) return; // Check for fuel checkFuel(c); - // Take the smelted results + // Take the smelted results from the output slot takeResults(c); - // Insert new items + // Insert new items to smelt insertItems(c); if (autoClose.get()) mc.setScreen(null); } private void insertItems(AbstractFurnaceMenu c) { + // Do nothing if input slot is already occupied ItemStack inputItemStack = c.slots.getFirst().getItem(); if (!inputItemStack.isEmpty()) return; int slot = -1; + // Search inventory for a valid item to smelt for (int i = 3; i < c.slots.size(); i++) { ItemStack item = c.slots.get(i).getItem(); if (!((IAbstractFurnaceMenu) c).meteor$canSmelt(item)) continue; @@ -136,6 +139,7 @@ private void insertItems(AbstractFurnaceMenu c) { moveSmeltItems(c, slot, moveCount); } + // Moves exact amount of items to the input slot (similar style as moveFuelItems) private void moveSmeltItems(AbstractFurnaceMenu c, int fromId, int amount) { if (amount <= 0 || mc.player == null || mc.gameMode == null) return; if (!mc.player.containerMenu.getCarried().isEmpty()) return;