AbdElAziz333 / Saturn

A performance mod designed to optimize Minecraft's memory usage.
https://www.curseforge.com/minecraft/mc-mods/saturn
GNU Lesser General Public License v3.0
16 stars 1 forks source link

Saturn clearing Vec2's static constants will break other mods #20

Closed TelepathicGrunt closed 7 months ago

TelepathicGrunt commented 9 months ago

This mixin is not safe https://github.com/AbdElAziz333/Saturn/blob/mc1.20.1/dev/src/main/java/com/abdelaziz/saturn/mixin/allocations/vec2/Vec2Mixin.java

All these fields are static which means any mod using these constants are going to get null instead of their desired values when they do Vec2.ONE and such. I assume you thought these were non static. But because they are static, all Vec2 objects point to the same reference for these fields. You aren't saving any memory as a result really. Just breaking mods instead.

Snownee commented 9 months ago

https://github.com/Snownee/Jade/issues/316 https://github.com/Snownee/Jade/issues/318 https://github.com/Snownee/Jade/issues/319

AbdElAziz333 commented 9 months ago

Yes, you are right this will break a lot of mods, This is fixed in 0.0.8 in 1.18.2, and 0.0.7 for the other versions 1.19.2, 1.19.3, 1.19.4, 1.20.1 and 1.20.2, i hope you have a good day.