33import me .armar .plugins .autorank .Autorank ;
44import me .armar .plugins .autorank .language .Lang ;
55import me .armar .plugins .autorank .pathbuilder .builders .PathBuilder ;
6- import me .armar .plugins .autorank .pathbuilder .config .PlayerDataConfig ;
76import me .armar .plugins .autorank .pathbuilder .holders .CompositeRequirement ;
7+ import me .armar .plugins .autorank .pathbuilder .playerdata .local .LocalPlayerDataStorage ;
88import me .armar .plugins .autorank .pathbuilder .result .AbstractResult ;
99import org .bukkit .Bukkit ;
1010import org .bukkit .OfflinePlayer ;
@@ -103,7 +103,7 @@ public void setBuilder(final PathBuilder builder) {
103103 * @return paths that a player has chosen and is currently on.
104104 */
105105 public List <Path > getActivePaths (UUID uuid ) {
106- Collection <String > activePathNames = plugin .getPlayerData ().getActivePaths (uuid );
106+ Collection <String > activePathNames = plugin .getLocalPlayerDataStorage ().getActivePaths (uuid );
107107
108108 List <Path > activePaths = new ArrayList <>();
109109
@@ -126,7 +126,7 @@ public List<Path> getActivePaths(UUID uuid) {
126126 * @param uuid UUID of the player.
127127 */
128128 public void resetProgressOnActivePaths (UUID uuid ) {
129- plugin .getPlayerData ().setActivePaths (uuid , new ArrayList <>());
129+ plugin .getLocalPlayerDataStorage ().setActivePaths (uuid , new ArrayList <>());
130130 }
131131
132132 /**
@@ -137,8 +137,8 @@ public void resetProgressOnActivePaths(UUID uuid) {
137137 * @param path Path to reset progress of.
138138 */
139139 public void resetProgressOfPath (Path path , UUID uuid ) {
140- plugin .getPlayerData ().setCompletedPrerequisites (uuid , path .getInternalName (), new ArrayList <>());
141- plugin .getPlayerData ().setCompletedRequirements (uuid , path .getInternalName (), new ArrayList <>());
140+ plugin .getLocalPlayerDataStorage ().setCompletedPrerequisites (uuid , path .getInternalName (), new ArrayList <>());
141+ plugin .getLocalPlayerDataStorage ().setCompletedRequirements (uuid , path .getInternalName (), new ArrayList <>());
142142 }
143143
144144 /**
@@ -147,8 +147,8 @@ public void resetProgressOfPath(Path path, UUID uuid) {
147147 * @param uuid UUID of the player
148148 */
149149 public void resetActivePaths (UUID uuid ) {
150- for (String activePathName : plugin .getPlayerData ().getActivePaths (uuid )) {
151- plugin .getPlayerData ().removeActivePath (uuid , activePathName );
150+ for (String activePathName : plugin .getLocalPlayerDataStorage ().getActivePaths (uuid )) {
151+ plugin .getLocalPlayerDataStorage ().removeActivePath (uuid , activePathName );
152152 }
153153 }
154154
@@ -161,7 +161,7 @@ public void resetActivePaths(UUID uuid) {
161161 * @return a list of paths a player has completed.
162162 */
163163 public List <Path > getCompletedPaths (UUID uuid ) {
164- Collection <String > completedPathsNames = plugin .getPlayerData ().getCompletedPaths (uuid );
164+ Collection <String > completedPathsNames = plugin .getLocalPlayerDataStorage ().getCompletedPaths (uuid );
165165
166166 List <Path > completedPaths = new ArrayList <>();
167167
@@ -184,8 +184,8 @@ public List<Path> getCompletedPaths(UUID uuid) {
184184 * @param uuid UUID of the player
185185 */
186186 public void resetCompletedPaths (UUID uuid ) {
187- for (String completedPath : plugin .getPlayerData ().getCompletedPaths (uuid )) {
188- plugin .getPlayerData ().removeCompletedPath (uuid , completedPath );
187+ for (String completedPath : plugin .getLocalPlayerDataStorage ().getCompletedPaths (uuid )) {
188+ plugin .getLocalPlayerDataStorage ().removeCompletedPath (uuid , completedPath );
189189 }
190190 }
191191
@@ -198,7 +198,7 @@ public void resetCompletedPaths(UUID uuid) {
198198 * @param reqId Id of the requirement.
199199 */
200200 public void addCompletedRequirement (UUID uuid , Path path , int reqId ) {
201- plugin .getPlayerData ().addCompletedRequirement (uuid , path .getInternalName (), reqId );
201+ plugin .getLocalPlayerDataStorage ().addCompletedRequirement (uuid , path .getInternalName (), reqId );
202202 }
203203
204204 /**
@@ -210,7 +210,7 @@ public void addCompletedRequirement(UUID uuid, Path path, int reqId) {
210210 * @return true if the player has completed the requirement, false otherwise.
211211 */
212212 public boolean hasCompletedRequirement (UUID uuid , Path path , int reqId ) {
213- return plugin .getPlayerData ().hasCompletedRequirement (uuid , path .getInternalName (), reqId );
213+ return plugin .getLocalPlayerDataStorage ().hasCompletedRequirement (uuid , path .getInternalName (), reqId );
214214 }
215215
216216 /**
@@ -341,15 +341,15 @@ public void assignPath(Path path, UUID uuid, boolean byForce) throws IllegalArgu
341341 String internalName = path .getInternalName ();
342342
343343 // Add path as an active path.
344- plugin .getPlayerData ().addActivePath (uuid , internalName );
344+ plugin .getLocalPlayerDataStorage ().addActivePath (uuid , internalName );
345345
346346 // Only reset progress if there was no progress stored.
347347 if (!path .shouldStoreProgressOnDeactivation ()) {
348348 // Reset progress of requirements
349- plugin .getPlayerData ().setCompletedRequirements (uuid , internalName , new ArrayList <>());
349+ plugin .getLocalPlayerDataStorage ().setCompletedRequirements (uuid , internalName , new ArrayList <>());
350350
351351 // Reset progress of prerequisites for a path.
352- plugin .getPlayerData ().setCompletedPrerequisites (uuid , internalName , new ArrayList <>());
352+ plugin .getLocalPlayerDataStorage ().setCompletedPrerequisites (uuid , internalName , new ArrayList <>());
353353 }
354354
355355 OfflinePlayer offlinePlayer = Bukkit .getOfflinePlayer (uuid );
@@ -383,7 +383,7 @@ public void deassignPath(Path path, UUID uuid) {
383383 }
384384
385385 // Remove active path of a player.
386- plugin .getPlayerData ().removeActivePath (uuid , path .getInternalName ());
386+ plugin .getLocalPlayerDataStorage ().removeActivePath (uuid , path .getInternalName ());
387387 }
388388
389389 /**
@@ -435,10 +435,10 @@ public List<Path> autoAssignPaths(UUID uuid) {
435435 public boolean completePath (Path path , UUID uuid ) {
436436
437437 // Add progress of completed requirements
438- plugin .getPlayerData ().addCompletedPath (uuid , path .getInternalName ());
438+ plugin .getLocalPlayerDataStorage ().addCompletedPath (uuid , path .getInternalName ());
439439
440440 // Remove path from active paths.
441- plugin .getPlayerData ().removeActivePath (uuid , path .getInternalName ());
441+ plugin .getLocalPlayerDataStorage ().removeActivePath (uuid , path .getInternalName ());
442442
443443 OfflinePlayer offlinePlayer = Bukkit .getOfflinePlayer (uuid );
444444
@@ -464,9 +464,9 @@ public boolean completePath(Path path, UUID uuid) {
464464 /**
465465 * Get the storage of player data regarding paths and requirements.
466466 *
467- * @return {@link PlayerDataConfig } object.
467+ * @return {@link LocalPlayerDataStorage } object.
468468 */
469- protected PlayerDataConfig getPlayerDataStorage () {
470- return plugin .getPlayerData ();
469+ protected LocalPlayerDataStorage getPlayerDataStorage () {
470+ return plugin .getLocalPlayerDataStorage ();
471471 }
472472}
0 commit comments