Create: Tramways Hotfix
This is a temporary client-side only addon modification created for Create: Tramways, which fixes game crashes in the base mod until these fixes are incorporated into the main version of the mod.
The existing problem is related to the operation of the speaker block that plays sounds. When accessing the voice message system, the module forms a phrase based on the template from the settings and specific announcement data: train number, platform number, or other information. After this, hashing of the received message occurs, and the presence of a ready audio file with voice accompaniment in the game data folder is checked. If the required audio recording is not found, the system automatically creates a connection with an external text-to-speech conversion service via web sockets.
Previously, the third-party API reliably returned correct audio data, but approximately a month ago, periodic problems appeared - the server began returning 403 errors (access forbidden). In all existing versions of the Tramways module, there is no handling of such failures - the system tries to play and save the audio stream, which contains no information due to the connection error.
This situation leads to the Minecraft client freezing indefinitely until the program is forced to close. The server part of the game is completely unaffected by the problem - that's why this patch is necessary only for the client application.
The fix is implemented by adding proper error handling on the client side. The mod now correctly intercepts failed requests to the external service and terminates the voice accompaniment process without interrupting the gameplay. This required modification of the TTS class for proper response to connection errors.
The developers have already submitted a proposal to implement these fixes into the main Tramways mod. Due to the current inactivity of the main developer of the original mod and the critical nature of the problem (one of the key functionalities periodically causes freezes), it was decided to release a solution for promptly fixing the situation.
Important note: This modification is a temporary measure. When versions of Create: Tramways following 0.3.0 appear, this patch will become redundant, outdated, and unnecessary, since all necessary fixes are intended for inclusion directly in the main mod.