jsorrell / CarpetSkyAdditions

Empty world generation with new ways to obtain resources
MIT License
428 stars 87 forks source link

Inconsistent behavior in mass converting stone to deepslate #104

Closed vlad2305m closed 1 year ago

vlad2305m commented 1 year ago

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 uses Math.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(), 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.

jsorrell commented 1 year ago

Fixed in c546c19d10ad0fefd57392f38a81bc502c35c471