fixed bug in ShrinkingBorder

This commit is contained in:
2025-06-23 20:28:13 +02:00
parent 7422a89d98
commit 03d4f4e6d8

View File

@ -42,8 +42,8 @@ public class ShrinkingBorderListener extends ApplianceListener<ShrinkingBorder>
Location relativeLocation = playerLocation.clone().subtract(worldBorder.getCenter());
double playerBorderDistanceX = worldBorder.getSize()/2 - Math.abs(relativeLocation.getX());
double playerBorderDistanceZ = worldBorder.getSize()/2 - Math.abs(relativeLocation.getZ());
int xSteps = (int) Math.ceil(playerBorderDistanceX / this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY));
int zSteps = (int) Math.ceil(playerBorderDistanceZ / this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY));
int xSteps = (int) Math.ceil(playerBorderDistanceX / ((double) this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY) / 2));
int zSteps = (int) Math.ceil(playerBorderDistanceZ / ((double) this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY) / 2));
return Math.min(xSteps, zSteps);
}