Fix critical gameplay bugs in rewrite-v2

1. Fixed locale loading - changed from async to sync
   - Locales now load synchronously on startup
   - Prevents GUI showing stone items before locales load

2. Fixed infinite falling bug
   - Added player teleport to spawn in processFall()
   - Players now respawn correctly after falling

3. Fixed parkour generation not working
   - Added missing tick cycle in SessionStateManager
   - Generator now ticks every server tick (50ms)
   - Parkour blocks now generate continuously

All three major bugs fixed and tested.
This commit is contained in:
loki 2026-04-09 12:07:07 +02:00
parent e5dd567ca9
commit c142d21a26
3 changed files with 58 additions and 20 deletions

View file

@ -101,24 +101,20 @@ public class Locales {
private static void loadLocalesAsync() {
Plugin plugin = LoParkour.getPlugin();
Scheduler.get(plugin).runAsync(() -> {
try {
FileConfiguration embedded = YamlConfiguration.loadConfiguration(
new InputStreamReader(plugin.getResource("locales/en.yml"), StandardCharsets.UTF_8));
try {
FileConfiguration embedded = YamlConfiguration.loadConfiguration(
new InputStreamReader(plugin.getResource("locales/en.yml"), StandardCharsets.UTF_8));
Map<String, FileConfiguration> loaded = loadFromDisk(embedded);
Map<String, FileConfiguration> loaded = loadFromDisk(embedded);
Scheduler.get(plugin).run(() -> {
synchronized (locales) {
locales.clear();
locales.putAll(loaded);
}
LoParkour.log("Locales reloaded successfully (" + loaded.size() + " locales)");
});
} catch (Exception ex) {
plugin.getLogger().severe("Error while loading locale files: " + ex.getMessage());
synchronized (locales) {
locales.clear();
locales.putAll(loaded);
}
});
LoParkour.log("Locales loaded successfully (" + loaded.size() + " locales)");
} catch (Exception ex) {
plugin.getLogger().severe("Error while loading locale files: " + ex.getMessage());
}
}
@NotNull