fixed bug in ShrinkingBorder
This commit is contained in:
@ -42,8 +42,8 @@ public class ShrinkingBorderListener extends ApplianceListener<ShrinkingBorder>
|
|||||||
Location relativeLocation = playerLocation.clone().subtract(worldBorder.getCenter());
|
Location relativeLocation = playerLocation.clone().subtract(worldBorder.getCenter());
|
||||||
double playerBorderDistanceX = worldBorder.getSize()/2 - Math.abs(relativeLocation.getX());
|
double playerBorderDistanceX = worldBorder.getSize()/2 - Math.abs(relativeLocation.getX());
|
||||||
double playerBorderDistanceZ = worldBorder.getSize()/2 - Math.abs(relativeLocation.getZ());
|
double playerBorderDistanceZ = worldBorder.getSize()/2 - Math.abs(relativeLocation.getZ());
|
||||||
int xSteps = (int) Math.ceil(playerBorderDistanceX / 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 / this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY));
|
int zSteps = (int) Math.ceil(playerBorderDistanceZ / ((double) this.getAppliance().getOption(ShrinkingBorderCommand.Argument.SHRINK_PER_DAY) / 2));
|
||||||
return Math.min(xSteps, zSteps);
|
return Math.min(xSteps, zSteps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user