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:
parent
e5dd567ca9
commit
c142d21a26
3 changed files with 58 additions and 20 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue