pau101 / Fairy-Lights

A Forge mod for Minecraft: Java Edition that which introduces hanging lights and other decorations.
https://minecraft.curseforge.com/projects/fairy-lights
MIT License
36 stars 30 forks source link

Crash when fairy lights end position is too far from starting position (ArithmeticException: Negative infinity) #119

Open savvasdalkitsis opened 3 years ago

savvasdalkitsis commented 3 years ago

This crash keeps affecting our server. We've encountered it twice, once using proper in game mechanics and once using creative mode while cloning structures far from their original position.

It seems that if a fairy light has its end position somehow end up far away from the starting position (in the normal game mechanic this happened while a player started a fairy light but before finishing it they teleported away using ender pearls and in the creative mode we ended up cloning a section of the world where only starting positions where contained) a negative infinity exception is thrown (see attached file)

Looking at the code it wasn't very clear to me what the solution would be in such a case so I didn't attempt to come up with a PR but am more than happy to create one if one of the maintainers here can provide me with some sort of guidance

crash-2021-04-07_13.32.14-server.txt

savvasdalkitsis commented 3 years ago

Also, to clarify, when this happens, we are having problems starting the server up as the moment the chunks load, the server crashes again. With some fast server side commands at the same time the player logs in again to load the chunk we can replace the offending block and get the server running again but it's quite tricky to achieve and I can easily foresee a situation where it will not work meaning we'd have to restore a backup or maybe download the world and modify it with a third party program to remove the block

pau101 commented 3 years ago

Thanks for reporting, a fix is on the way.

MagnusHJensen commented 2 years ago

This is still occurring, as I've seen multiple times. It's happening on version 4.0.5-1.16.5 Could this be a case of a new build not being put where this (5f3c6fc) was fixed?

image