You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forge patched in ItemSmeltedEvent into checkTakeAchievements of FurnaceResultSlot a long time ago, and ever since then the event has had one major flaw, that eliminates a huge chunk of use-cases.
It's been on my list of 'broken in forge' bugs for a long time, but now we have NeoForge yay
Foreword: There's actually two bugs below.. but only one is functionally critical
Basically, when extracting a stack from the FurnaceResultSlot, the stack provided is the exact stack the player attempts to extract, regardless of whether it's successful or not.
This means that the event is actually providing an inaccurate value to modders when attempting to use the stack to determine how many things were smelted.
Here's an example result table for a stack of 64 iron ingots smelted, and the resultant event stack size:
Left click - 64
Right click - 32
Shift click - 64
Shift click with only 5 spaces left in inventory - 64
Problem here? the stack is always the stack attempted, even if the player doesn't have space when shift clicking/quicktransferring
Solution: pass in the removeCount variable, which keeps track of exactly how much is being removed (move the event up a line so it resets removeCount after the event)
BUG 2: When shift-clicking the stack, MC fires checkTakeAchievementstwice, with the second call being for an empty stack.
Don't call the event if the removecount or stack is 0. You're currently firing it twice for every shift-click extraction
The text was updated successfully, but these errors were encountered:
Forge patched in
ItemSmeltedEvent
intocheckTakeAchievements
ofFurnaceResultSlot
a long time ago, and ever since then the event has had one major flaw, that eliminates a huge chunk of use-cases.It's been on my list of 'broken in forge' bugs for a long time, but now we have NeoForge yay
Foreword: There's actually two bugs below.. but only one is functionally critical
Basically, when extracting a stack from the
FurnaceResultSlot
, the stack provided is the exact stack the player attempts to extract, regardless of whether it's successful or not.This means that the event is actually providing an inaccurate value to modders when attempting to use the stack to determine how many things were smelted.
Here's an example result table for a stack of 64 iron ingots smelted, and the resultant event stack size:
Left click - 64
Right click - 32
Shift click - 64
Shift click with only 5 spaces left in inventory - 64
Problem here? the stack is always the stack attempted, even if the player doesn't have space when shift clicking/quicktransferring
Solution: pass in the
removeCount
variable, which keeps track of exactly how much is being removed (move the event up a line so it resets removeCount after the event)BUG 2: When shift-clicking the stack, MC fires
checkTakeAchievements
twice, with the second call being for an empty stack.Don't call the event if the removecount or stack is 0. You're currently firing it twice for every shift-click extraction
The text was updated successfully, but these errors were encountered: