When burnTime is less than or equal to 0, do not process (#5194)

This commit is contained in:
るんく君
2025-07-10 06:19:02 +09:00
committed by GitHub
parent b91fa2cf37
commit 0424a5dd12
2 changed files with 2 additions and 1 deletions

View File

@@ -68,7 +68,7 @@ public class InventoryListener implements Listener {
furnaceState instanceof Furnace ? ((Furnace) furnaceState).getInventory()
.getSmelting() : null;
if (!ItemUtils.isSmeltable(smelting)) {
if (!ItemUtils.isSmeltable(smelting) || event.getBurnTime() <= 0) {
return;
}

View File

@@ -34,6 +34,7 @@ public class SmeltingManager extends SkillManager {
* @param burnTime The initial burn time from the {@link FurnaceBurnEvent}
*/
public int fuelEfficiency(int burnTime) {
if (burnTime <= 0) return 0;
return Math.min(Short.MAX_VALUE, Math.max(1, burnTime * getFuelEfficiencyMultiplier()));
}