apace100 / apoli

MIT License
40 stars 46 forks source link

Significantly Improved ModifyPlayerSpawnPower #129

Closed Dahminh closed 1 year ago

Dahminh commented 1 year ago

The purpose of this pull request is to improve the ModifyPlayerSpawnPower as it was slow when it came to biomes that got farther away from spawn due to the function locateBiome() which checked every 8 blocks. locateBiome() now checks every 64 blocks, allowing it to check less frequently and thus find the specified biome much faster.

apace100 commented 1 year ago

How about making this a configurable parameter for players / server admins? I can definitely see the default being higher like here, but maybe some servers would appreciate their players spawning as close together as possible, or maybe even further apart, which is partially influenced by this parameter? For example servers with biome altering mods or those who choose to play the large biomes world type might want to increase this even further!

Dahminh commented 1 year ago

This commit does as what Apace suggested. There are 3 new configurable fields on the config. They are named: Radius: (Default value is 6400). If set to a negative value, it will go back to the default value. If set to 0, the power will not be able to search for biomes. HorizontalBlockCheckInterval: (Default value is 64). If set to a negative value or 0, it will go back to the default value. VerticalBlockCheckInterval: (Default value is 64). If set to a negative value or 0, it will go back to the default value.