Mekanism

Mekanism

111M Downloads

Digital Miner Shulker Box Duplication Bug

focamacho opened this issue ยท 4 comments

commented

Issue description:
You can duplicate shulker boxes using a Digital Miner(It duplicates only the Shulker Box, not the items inside)

Steps to reproduce:

  1. Place a Digital Miner in the ground
  2. Place a Shulker Box in the ground
  3. Put any item inside the Shulker Box
  4. Set a filter in the Digital Miner to mine the Shulker Box(Fuzzy Mode:ON)
  5. Turn on the digital miner
  6. Digital Miner will collect a Shulker Box, and at the same time, one shulker box is dropped on the ground. (See the video for more info)

Version (make sure you are on the latest version before reporting):
Forge: 1.12.2 - 14.23.5.2836
Mekanism: Mekanism-1.12.2-9.7.3.374

If a (crash)log is relevant for this issue, link it here:

https://www.youtube.com/watch?v=ZESNiDCf_XA

commented

I tested some other mods:

Vertical Digger(Actually Additions): It is the same as digital miner, takes an empty box, and drops one with items.
Auto-Breaker(Actually Additions): Same thing.
Block Breaker(Industrial Foregoing): Drop all items on the floor and pick up an empty box (https://imgur.com/a/ikfpqr4)
Mechanical Miner(Extra Utilities 2): Works exactly how it should work, take the box with the items inside and do not drop anything.
Builder + Quarry Card(RFTools): Works the same as mechanical miner, without any problem.

commented

The only way to make things like this respond properly to a block break is to do it like AE does for annihilation planes: break the block then capture the dropped items in the blockspace.

commented

Started looking into this slightly, and a few different things seem to be going on.

  1. The reason there is no dupe of the items inside seems to be because shulker boxes handle that and drop themselves on the break event. (We need to somehow figure this out and have it so the items get stored. This will cause the items inside to also get duped, but that should already be happening and is a bug that it is not.)
  2. The reason the box itself is duping is that given it is manually dropping itself when we tell it that it was broken, a second one gets created by setting it to air.

I think what is likely going to need to be done is to have special handling for the shulker box where we duplicate the code so that we get the proper drop NBT, and then we clear the shulker box so that the one in world does not get dropped. The question I will have to look into however, is there some better way to do it so that we have better support if some modded block behaves the same way.

commented

#5456 (comment) for reference of what we ended up doing. We will release 9.7.4 later today with this fix and a few other fixes.