Hbm's Nuclear Tech Mod

Hbm's Nuclear Tech Mod

1M Downloads

Laser Miner Item Dupe Exploit

OlorinIV opened this issue ยท 8 comments

commented
  1. Though the maximum was marked as lvl12 and lvl3 for red and black upgrades respectively for the laser miner, the actual level for both speed upgrades that could be active on the machine was seemingly unlimited.
  2. It is guessed that if the actual (or calculated?) duration for a block to be mined by the laser miner was less than one tick, that block may be mined twice (or more, depends on speed level) in the same tick, yielding that much of the result, whether it should be mined directly, smelt, shredded, centrifuged or crystallized.
  3. This works on all blocks mined by the laser miner, that could be mined in less than a tick under the speed level that the laser miner is running at. That includes containers, which would also drop their content multiplied when using the exploit.
commented

I can't really tell from the wording, but did you try this and did it actually work? Also what version, 1.7.10? 1.12.2? I think the reason that this works, is first it finds the next block that isn't air in the way, then it retrieves the mining duration from somewhere, then does the calculations for the upgrades it has, and applies them to the speed, then waits how long it takes to mine it, then drops the item after calculating with the upgrades that modify drops, like pulverize, then tells the game to remove the block. The game was to wait for a full tick to remove the block, but if the laser is faster, it sees the block, does all the steps, and drops it again, then tells the game to delete it again, and then the game finally removes it. I think I might be correct, but the simplest solution would be to do a check on the block after it tells it to be removed before looping to make sure it's gone before moving on.

commented

This was discovered with the newest 1.7.10 version. And I meant that the laser miner could duplicate block drops if mining fast enough, and the faster it is the more it could dupe.
You could read the code yourself if you wanted a proper explanation on this matter.

commented

I did read the code a bit, and I can understand some bits, but it's mixed in with a lot of vectors. I can tell that it does not tell it to drop, but just drops the item itself, and has an exception to air blocks. I actually cannot identify where it tells it to break the block, or if the thing to drop the block also breaks the block. I am probably very wrong still, but now I know something else

commented

Let's just leave the thing for bob to handle.
Talking about bob, he's been inactive for days.

commented

Yeah, can't blame him, from reading the code, mods are hard, and painful.

commented

I think to fix this you just gotta add a second check, to make sure the block at the position is indeed replaced with air before moving on, and if it isn't, then check again, or tell it to wait a tick and then check again.

commented

Confirmed: The upgrade limit for speed does work, but for overdrive it doesn't. Overdrive in general has the property of causing the item collection function to be called multiple times within the same tick, which wouldn't be a problem except that collected items only despawn on the next tick which means that items could be collected multiple times if it happened within one tick. Should be fixed in the upcoming version.

commented

Fixed in X4501.