mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2025-02-04 14:41:23 +01:00
Fix possible integer-overflow when radius-rendering on big worlds
This commit is contained in:
parent
d509c48025
commit
6b2e845654
@ -30,6 +30,7 @@
|
||||
import java.util.StringJoiner;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import com.flowpowered.math.vector.Vector2l;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import com.flowpowered.math.GenericMath;
|
||||
@ -147,7 +148,8 @@ public void createMapRenderTask(CommandSource source, MapType map, Vector2i cent
|
||||
if (center == null || blockRadius < 0) {
|
||||
filter = c -> true;
|
||||
} else {
|
||||
filter = c -> c.mul(16).distanceSquared(center) <= blockRadius * blockRadius;
|
||||
Vector2l centerL = center.toLong(); //use longs to avoid int-overflow
|
||||
filter = c -> c.toLong().mul(16).distanceSquared(centerL) <= blockRadius * blockRadius;
|
||||
taskName = "radius-render";
|
||||
renderCenter = center;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user