Because the Overpass services are graciously accessible for free, they are not always reliable and are often down or inaccessible, as we saw on multiple occasions. Build teams and other users have know they can switch the endpoint in the config for some time now, but it's a bit troublesome, and less knowledgeable users often have unpopulated chunks and have trouble to re-generate them. So here is what this pull request actually does to fix all of this;
Add a new fallback_overpass_interpreter field in the config
Removes the unused OVERPASS_INSTANCE static final field in OpenStreetMaps.java and replaces it with the overpassInstance static field, allowing multiple things: the user can change the endpoint in the config and see the effect immediately, and the mod can switch to the value of the new fallback_overpass_interpreter config entry automatically when it fails to download a region from the default overpass endpoint.
When such a change happens, a thread is started that will sleep for some time (using the value in the new overpass_fallback_check_delay config entry), before reverting the value of overpassInstance to the default one, in case it would usable again. If it isn't, the mod will just switch back to the fallback one anyway.
Additionally, the /overpass command is added. It can be used by operators to check which endpoint is being used and switch it from fallback to default, or the opposite, without restarting the server/client.
When the user changes the config from the mod menu or uses the /overpass command the fallback thread is interrupted as it is not needed anymore
Finally, the @RequiresMCRestart and @RequiresWorldRestart annotations have been added to the config fields for which it makes sens
Because the Overpass services are graciously accessible for free, they are not always reliable and are often down or inaccessible, as we saw on multiple occasions. Build teams and other users have know they can switch the endpoint in the config for some time now, but it's a bit troublesome, and less knowledgeable users often have unpopulated chunks and have trouble to re-generate them. So here is what this pull request actually does to fix all of this;
fallback_overpass_interpreter
field in the configOVERPASS_INSTANCE
static final field in OpenStreetMaps.java and replaces it with theoverpassInstance
static field, allowing multiple things: the user can change the endpoint in the config and see the effect immediately, and the mod can switch to the value of the newfallback_overpass_interpreter
config entry automatically when it fails to download a region from the default overpass endpoint.overpass_fallback_check_delay
config entry), before reverting the value ofoverpassInstance
to the default one, in case it would usable again. If it isn't, the mod will just switch back to the fallback one anyway./overpass
command is added. It can be used by operators to check which endpoint is being used and switch it from fallback to default, or the opposite, without restarting the server/client./overpass
command the fallback thread is interrupted as it is not needed anymore