File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/main/java/org/maxgamer/quickshop/util Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -83,10 +83,21 @@ public static void updateStashIfNeeded(Player player) {
8383 public static void doLargeOfflineCachingWork (QuickShop quickShop , OfflinePlayer [] offlinePlayers ) {
8484 quickShop .getLogger ().log (Level .INFO , "Large server detected (offline player > 2000), start offline player caching..." );
8585 useOfflineStash = true ;
86+ int amount = 0 ;
87+ int doneAmount = 0 ;
8688 for (OfflinePlayer offlinePlayer : quickShop .getServer ().getOfflinePlayers ()) {
87- String name = offlinePlayer .getName ();
88- if (name != null ) {
89- string2UUIDStash .put (name , offlinePlayer .getUniqueId ());
89+ try {
90+ String name = offlinePlayer .getName ();
91+ if (name != null ) {
92+ string2UUIDStash .put (name , offlinePlayer .getUniqueId ());
93+ }
94+ } catch (Throwable ignored ) {
95+ }
96+ amount ++;
97+ if (amount == 1000 ) {
98+ doneAmount += 1000 ;
99+ amount = 0 ;
100+ quickShop .getLogger ().log (Level .INFO , "Caching Offline player...cached " + doneAmount + "/" + offlinePlayers .length + " players." );
90101 }
91102 }
92103 quickShop .getLogger ().log (Level .INFO , "Done! cached " + offlinePlayers .length + " players." );
You can’t perform that action at this time.
0 commit comments