From cb3f380bd96f3cffda5d170bc17bbd81cffa6469 Mon Sep 17 00:00:00 2001 From: ash-burns Date: Sat, 4 Jan 2025 09:35:19 +0000 Subject: [PATCH] Save "AllowFlight" in Player Snapshot data Update project dependencies --- pom.xml | 14 +++++++++----- .../a5h73y/parkour/type/player/PlayerConfig.java | 3 +++ .../a5h73y/parkour/type/player/PlayerManager.java | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 17507d77..5d5ab4dd 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ org.bstats bstats-bukkit - 3.0.2 + 3.1.0 @@ -135,7 +135,7 @@ com.github.cryptomorin XSeries - 11.1.0 + 13.0.0 @@ -153,7 +153,7 @@ org.yaml snakeyaml - 2.2 + 2.3 provided @@ -165,7 +165,7 @@ org.json json - 20240303 + 20241224 provided @@ -177,7 +177,7 @@ com.google.guava guava - 33.2.1-jre + 33.4.0-jre provided @@ -229,6 +229,10 @@ *:* META-INF/ + com/cryptomorin/xseries/XBiome* + com/cryptomorin/xseries/NMSExtras* + com/cryptomorin/xseries/NoteBlockMusic* + com/cryptomorin/xseries/SkullCacheListener* diff --git a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerConfig.java b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerConfig.java index 257d0011..3806b13c 100644 --- a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerConfig.java +++ b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerConfig.java @@ -38,6 +38,7 @@ public class PlayerConfig extends Json { public static final String MANUAL_CHECKPOINTS_USED = "ManualCheckpointsUsed"; public static final String TOTAL_DEATHS = "TotalDeaths"; public static final String TOTAL_TIME = "TotalTime"; + public static final String ALLOW_FLIGHT = "AllowFlight"; public static final String SNAPSHOT_PREFIX = "Snapshot."; public static final String SESSION_PREFIX = "Session."; @@ -344,6 +345,8 @@ public String getSnapshotGameMode() { return this.getString(SNAPSHOT_PREFIX + GAMEMODE).toUpperCase(); } + public boolean getSnapshotAllowFlight() { return this.getBoolean(SNAPSHOT_PREFIX + ALLOW_FLIGHT); } + /** * Get the number of accumulated Parkoins for Player. * @return number of Parkoins diff --git a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java index 784dcaa4..ba71c1df 100644 --- a/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java +++ b/src/main/java/io/github/a5h73y/parkour/type/player/PlayerManager.java @@ -1301,6 +1301,7 @@ private void restorePlayerData(Player player, PlayerConfig playerConfig, boolean restoreInventoryArmor(player, playerConfig); items.forEach(itemStack -> player.getInventory().addItem(itemStack)); restoreGameMode(player); + player.setAllowFlight(playerConfig.getSnapshotAllowFlight()); } private List getItemsToRestore(Player player, PlayerConfig playerConfig, boolean finishedCourse) {