mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Cleanup progress feedback
This commit is contained in:
parent
dbd27b641e
commit
f4ff8518c2
@ -430,10 +430,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
|
||||
e.printStackTrace();
|
||||
}
|
||||
convertedUsers++;
|
||||
if ((convertedUsers % DatabaseManager.progressInterval) == 0) {
|
||||
// Can't use Bukkit.broadcastMessage because async
|
||||
System.out.println(String.format("[mcMMO] Conversion progress: %d users at %.2f users/second", convertedUsers, convertedUsers / ((System.currentTimeMillis() - startMillis) / 1000D)));
|
||||
}
|
||||
Misc.printProgress(convertedUsers, progressInterval, startMillis);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
@ -461,10 +461,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
||||
// Ignore
|
||||
}
|
||||
convertedUsers++;
|
||||
if ((convertedUsers % DatabaseManager.progressInterval) == 0) {
|
||||
// Can't use Bukkit.broadcastMessage because async
|
||||
System.out.println(String.format("[mcMMO] Conversion progress: %d users at %.2f users/second", convertedUsers, convertedUsers / ((System.currentTimeMillis() - startMillis) / 1000D)));
|
||||
}
|
||||
Misc.printProgress(convertedUsers, progressInterval, startMillis);
|
||||
}
|
||||
}
|
||||
catch (SQLException e) {
|
||||
|
@ -11,6 +11,7 @@ import com.gmail.nossr50.datatypes.player.McMMOPlayer;
|
||||
import com.gmail.nossr50.datatypes.player.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.skills.SkillType;
|
||||
import com.gmail.nossr50.locale.LocaleLoader;
|
||||
import com.gmail.nossr50.util.Misc;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
public class FormulaConversionTask extends BukkitRunnable {
|
||||
@ -47,10 +48,7 @@ public class FormulaConversionTask extends BukkitRunnable {
|
||||
editValues(profile);
|
||||
}
|
||||
convertedUsers++;
|
||||
if ((convertedUsers % DatabaseManager.progressInterval) == 0) {
|
||||
// Can't use Bukkit.broadcastMessage because async
|
||||
System.out.println(String.format("[mcMMO] Conversion progress: %d users at %.2f users/second", convertedUsers, convertedUsers / ((System.currentTimeMillis() - startMillis) / 1000D)));
|
||||
}
|
||||
Misc.printProgress(convertedUsers, DatabaseManager.progressInterval, startMillis);
|
||||
}
|
||||
mcMMO.getFormulaManager().setPreviousFormulaType(formulaType);
|
||||
|
||||
|
@ -22,8 +22,8 @@ import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
|
||||
@ -198,6 +198,12 @@ public final class Misc {
|
||||
}
|
||||
}
|
||||
|
||||
public static void printProgress(int convertedUsers, int progressInterval, long startMillis) {
|
||||
if ((convertedUsers % progressInterval) == 0) {
|
||||
mcMMO.p.getLogger().info(String.format("Conversion progress: %d users at %.2f users/second", convertedUsers, convertedUsers / ((System.currentTimeMillis() - startMillis) / TIME_CONVERSION_FACTOR)));
|
||||
}
|
||||
}
|
||||
|
||||
public static void resendChunkRadiusAt(Player player, int radius) {
|
||||
Chunk chunk = player.getLocation().getChunk();
|
||||
int chunkX = chunk.getX();
|
||||
|
Loading…
Reference in New Issue
Block a user