Offset generation bounds by teleportation scale

This commit is contained in:
s809
2025-02-26 22:12:59 +05:00
parent 34e5463718
commit cc4733b052
2 changed files with 5 additions and 1 deletions
@@ -151,8 +151,10 @@ public abstract class AbstractDhServerLevel extends AbstractDhLevel implements I
if (Config.Server.generationBoundsRadius.get() > 0)
{
double coordinateScale = this.serverLevelWrapper.getDimensionType().getCoordinateScale();
if (DhSectionPos.getChebyshevSignedBlockDistance(message.sectionPos, new DhBlockPos2D(
Config.Server.generationBoundsX.get(), Config.Server.generationBoundsZ.get()
(int) (Config.Server.generationBoundsX.get() * coordinateScale),
(int) (Config.Server.generationBoundsZ.get() * coordinateScale)
)) > Config.Server.generationBoundsRadius.get())
{
message.sendResponse(new RequestOutOfRangeException("Section out of allowed bounds"));
@@ -34,4 +34,6 @@ public interface IDimensionTypeWrapper extends IDhApiDimensionTypeWrapper, IBind
boolean isTheEnd();
double getCoordinateScale();
}