EndGatewayFix
作者:rebot | 分类:模组
Minecraft 版本: 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.21.8 1.21.9 1.21.10 1.21.11
平台: neoforge
标签: worldgen
Fixes the End gateway generation to be symmetrical.
Technical Explanation - Whenever you kill the ender dragon and a gateway spawns, a chunk of code is run that roughly looks like this: ``` x = floor(diameter * cos(2 * (-pi + toRadians(9) * gatewayNum))); z = floor(diameter * sin(2 * (-pi + toRadians(9) * gatewayNum))); ``` - The issue lies in using `floor` over the entire equation for two reasons. 1. The floor method always rounds down to the nearest integer, which means it will always be offset on any point with a negative decimal that would otherwise be rounded up. 2. The floating point inaccuracies of `pi` cause it to be rounded down where it especially shouldn't, such as on a 0 (for example, creating -1 from -0.00000000000001). - This mod fixes this issue by instead opting to use the `round` method from the built-in Java Math class, which just rounds down when a number is 0.0 to 0.499…, and up when its 0.5 to 0.99….请登录后举报


暂无评论,抢个沙发吧~