Also, are you aware that the bounding box you expand already has a size of 0.25 m, so the amount of deepslate depends on where exactly the potion lands?
If that is not intended, I recommend getting the Entity.getBlockPos(), subtracting dx from each coordinate inside the loop brackets, and iterating up to sum of it and dx, like it is done in the rest of the code.
https://github.com/jsorrell/CarpetSkyAdditions/blob/6cc30f488483c2b0bd3f544f6cabcb0dde361bab/src/main/java/com/jsorrell/carpetskyadditions/mixin/PotionEntityMixin.java#L36 There you cast to int, which is equivalent to
%1
, and that is a symmetrical function: it rounds up negative numbers instead. The entirety of Minecraft code usesMath.floor()
function to avoid that.Also, are you aware that the bounding box you expand already has a size of 0.25 m, so the amount of deepslate depends on where exactly the potion lands? If that is not intended, I recommend getting the
Entity.getBlockPos()
, subtractingdx
from each coordinate inside the loop brackets, and iterating up to sum of it anddx
, like it is done in the rest of the code.