Skip to content

Commit

Permalink
Save "AllowFlight" in Player Snapshot data
Browse files Browse the repository at this point in the history
Update project dependencies
  • Loading branch information
ash-burns committed Jan 4, 2025
1 parent 65c8491 commit cb3f380
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
14 changes: 9 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<version>3.1.0</version>
</dependency>
<!-- MySQL Database -->
<dependency>
Expand All @@ -135,7 +135,7 @@
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>XSeries</artifactId>
<version>11.1.0</version>
<version>13.0.0</version>
</dependency>
<!-- Version Compare -->
<dependency>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>2.2</version>
<version>2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -165,7 +165,7 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20240303</version>
<version>20241224</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -177,7 +177,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-jre</version>
<version>33.4.0-jre</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -229,6 +229,10 @@
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/</exclude>
<exclude>com/cryptomorin/xseries/XBiome*</exclude>
<exclude>com/cryptomorin/xseries/NMSExtras*</exclude>
<exclude>com/cryptomorin/xseries/NoteBlockMusic*</exclude>
<exclude>com/cryptomorin/xseries/SkullCacheListener*</exclude>
</excludes>
</filter>
</filters>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ItemStack> getItemsToRestore(Player player, PlayerConfig playerConfig, boolean finishedCourse) {
Expand Down

0 comments on commit cb3f380

Please sign in to comment.