Archiviert
13
0

Automatically delete empty JAR-files left over from upgrades.

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-01-27 16:42:30 +01:00
Ursprung eb996e73d8
Commit d109506cf2

Datei anzeigen

@ -19,6 +19,7 @@ package com.comphenix.protocol;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
@ -41,6 +42,7 @@ import com.comphenix.protocol.injector.PacketFilterManager.PlayerInjectHooks;
import com.comphenix.protocol.metrics.Statistics;
import com.comphenix.protocol.metrics.Updater;
import com.comphenix.protocol.reflect.compiler.BackgroundCompiler;
import com.google.common.collect.Lists;
/**
* The main entry point for ProtocolLib.
@ -297,7 +299,10 @@ public class ProtocolLibrary extends JavaPlugin {
if (match.matches()) {
MinecraftVersion version = new MinecraftVersion(match.group(1));
if (newestVersion == null || newestVersion.compareTo(version) < 0) {
if (candidate.length() == 0) {
// Delete and inform the user
logger.info((candidate.delete() ? "Deleted " : "Could not delete ") + candidate);
} else if (newestVersion == null || newestVersion.compareTo(version) < 0) {
newestVersion = version;
}
}