▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/EndGatewayFix
EndGatewayFix

EndGatewayFix

Fixes the alignment in end gateway generation.

40
1

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….

Before: An image depicting the 4 end gateways along the center line aligned improperly.

After: An image depicting the 4 end gateways along the center line aligned properly

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Сервер

Создатели

Детали

Лицензия:MIT
Опубликован:3 месяца назад
Обновлён:3 месяца назад
Главная