kyrptonaught / DiggusMaximus

MIT License
25 stars 21 forks source link

Shape Excavate block counting is broken #67

Closed litoj closed 1 year ago

litoj commented 1 year ago

This was always the case for me. Whenever I try to dig 3x3tunnel shape and have maxMined > 18 the amount of mined blocks is incorrect. For example 27 should mine three blocks deep tunnel, but same as 28, it leaves all four corner blocks (mines only 23 blocks): image I don't have a clue how this is happening with the way the code is written, but it is.

litoj commented 1 year ago

STATE: 2 pos: class_2338{x=54, y=37, z=-59} STATE: 3 pos: class_2338{x=54, y=35, z=-59} STATE: 4 pos: class_2338{x=55, y=36, z=-59} STATE: 5 pos: class_2338{x=53, y=36, z=-59} STATE: 6 pos: class_2338{x=55, y=37, z=-59} STATE: 7 pos: class_2338{x=53, y=37, z=-59} STATE: 8 pos: class_2338{x=55, y=35, z=-59} STATE: 9 pos: class_2338{x=53, y=35, z=-59} STATE: 10 pos: class_2338{x=54, y=36, z=-60} STATE: 11 pos: class_2338 {x=54, y=37, z=-60} STATE: 12 pos: class_2338 {x=54, y=35, z=-60} STATE: 13 pos: class_2338 {x=55, y=36, z=-60} STATE: 14 pos: class_2338 {x=53, y=36, z=-60} STATE: 15 pos: class_2338{x=55, y=37, z=-60} STATE: 16 pos: class_2338{x=53, y=37, z=-60} STATE: 17 pos: class_2338{x=55, y=35, z=-60} STATE: 18 pos: class_2338{x=53, y=35, z=-60} STATE: 19 pos: class_2338{x=54, y=36, z=-61} STATE: 20 pos: class_2338 {x=54, y=37, z=-60} STATE: 21 pos: class_2338{x=54, y=37, z=-61} STATE: 22 pos: class_2338 {x=54, y=35, z=-60} STATE: 23 pos: class_2338{x=54, y=35, z=-61} STATE: 24 pos: class_2338 {x=55, y=36, z=-60} STATE: 25 pos: class_2338{x=55, y=36, z=-61} STATE: 26 pos: class_2338 {x=53, y=36, z=-60} STATE: 27 pos: class_2338{x=53, y=36, z=-61} MINED: 27

This probably could be fixed by testing if the block exists, (not sure whether it is the case already or not). But that would add extra overhead, so it should be done so these blocks are never tested twice.

litoj commented 1 year ago

BTW how can you get an invalid position? (ExcavateHelper.isValidPos)

litoj commented 1 year ago

It seems the blocks already broken aren't registred and are "mined" again. So even blocks that are already Air are used again.

I have never tried anything with mods so I don't understand properly the internals, so my only solution would be to save the mined positions and test against them but that is a very bad solution.

litoj commented 1 year ago

It works when different blocks are disabled. This would suggest that Air is considered breakable and therefore used as a block to mine, even though there is really nothing to mine.