-
-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Milestone
Description
Describe
In ChemicalUtil.moveChemical, extractChemical is SIMULATEd twice, leading to easy infinite chemical glitch.
Lines 74 to 89 in dbcefa4
| for (int i : fromSlots) { | |
| ChemicalStack extracted = inventoryFrom.extractChemical(i, needs, Action.SIMULATE); | |
| if (extracted.isEmpty()) { | |
| continue; | |
| } | |
| ChemicalStack remaining = inserter.insertChemical(extracted); | |
| long inserted = extracted.getAmount() - remaining.getAmount(); | |
| if (inserted == 0) { | |
| continue; | |
| } | |
| needs -= inserted; | |
| inventoryFrom.extractChemical(i, inserted, Action.SIMULATE); | |
| if (needs <= 0) { | |
| break; | |
| } | |
| } |
Line 85 should be doing inventoryFrom.extractChemical(i, inserted, Action.EXECUTE); I guess.
In other places, extract functions actually executes extraction of something, for example, fluid.
AdvancedPeripherals/src/main/java/de/srendi/advancedperipherals/common/util/inventory/FluidUtil.java
Lines 48 to 64 in dbcefa4
| for (int i = 0; i < inventoryFrom.getTanks() && needs >= 0; i++) { | |
| FluidStack stack = inventoryFrom.getFluidInTank(i); | |
| if (!filter.test(stack)) { | |
| continue; | |
| } | |
| FluidStack extracted = inventoryFrom.drain(stack.copyWithAmount(needs), IFluidHandler.FluidAction.SIMULATE); | |
| if (extracted.isEmpty()) { | |
| continue; | |
| } | |
| int inserted = inventoryTo.fill(extracted, IFluidHandler.FluidAction.EXECUTE); | |
| if (inserted == 0) { | |
| continue; | |
| } | |
| needs -= inserted; | |
| extracted.setAmount(inserted); | |
| inventoryFrom.drain(extracted, IFluidHandler.FluidAction.EXECUTE); | |
| } |
Steps to reproduce
- Extract some chemicals from some chemical tank to ME storage using ME Bridge.
- If the tank contains some actual chemical to be extracted, chemical is "imported" to ME storage while not extracting anything from the tank.
- Infinite chemical glitch
Multiplayer?
Yes
Version
1.21.1-0.7.60b
Minecraft, Forge and maybe other related mods versions
Minecraft Java Edition 1.21.1, NeoForge 21.1.219, Mekanism 10.7.18, Applied Energistics 2 19.2.17, Applied Mekanistics 1.6.3, CC: Tweaked 1.117.1
Screenshots or Videos
No response
Crashlog/log
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
To Be Released