mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-26 01:59:20 +00:00
Add configuration option to synchronise flight
This commit is contained in:
@@ -23,6 +23,7 @@ public class ConfigLoader {
|
||||
Settings.syncGameMode = config.getBoolean("synchronisation_settings.game_mode", true);
|
||||
Settings.syncAdvancements = config.getBoolean("synchronisation_settings.advancements", true);
|
||||
Settings.syncLocation = config.getBoolean("synchronisation_settings.location", false);
|
||||
Settings.syncFlight = config.getBoolean("synchronisation_settings.flight", false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -191,9 +191,14 @@ public class PlayerSetter {
|
||||
player.setGameMode(GameMode.valueOf(data.getGameMode()));
|
||||
}
|
||||
if (Settings.syncLocation) {
|
||||
player.setFlying(player.getAllowFlight() && data.isFlying());
|
||||
setPlayerLocation(player, DataSerializer.deserializePlayerLocationData(data.getSerializedLocation()));
|
||||
}
|
||||
if (Settings.syncFlight) {
|
||||
if (data.isFlying()) {
|
||||
player.setAllowFlight(true);
|
||||
}
|
||||
player.setFlying(player.getAllowFlight() && data.isFlying());
|
||||
}
|
||||
|
||||
// Handle the SyncCompleteEvent
|
||||
Bukkit.getPluginManager().callEvent(new SyncCompleteEvent(player, data));
|
||||
|
||||
Reference in New Issue
Block a user