3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-03 16:31:14 +02:00

Proper warning about version/uuid changes

Dieser Commit ist enthalten in:
onebeastchris 2024-07-04 00:42:11 +02:00
Ursprung 1608746afd
Commit f1163828f8

Datei anzeigen

@ -285,8 +285,12 @@ public class ResourcePackLoader implements RegistryLoader<Path, Map<String, Reso
ResourcePack newPack = ResourcePackLoader.readPack(pathPackCodec.path()); ResourcePack newPack = ResourcePackLoader.readPack(pathPackCodec.path());
UUID newUUID = newPack.manifest().header().uuid(); UUID newUUID = newPack.manifest().header().uuid();
if (newUUID.toString().equals(packId)) { if (newUUID.toString().equals(packId)) {
GeyserImpl.getInstance().getLogger().info("Detected a new resource pack version (%s, old version %s) for pack at %s!" if (packVersion.equals(newPack.manifest().header().version().toString())) {
GeyserImpl.getInstance().getLogger().info("No version or pack change detected: Was the resource pack server down?");
} else {
GeyserImpl.getInstance().getLogger().info("Detected a new resource pack version (%s, old version %s) for pack at %s!"
.formatted(packVersion, newPack.manifest().header().version().toString(), url)); .formatted(packVersion, newPack.manifest().header().version().toString(), url));
}
} else { } else {
GeyserImpl.getInstance().getLogger().info("Detected a new resource pack at the url %s!".formatted(url)); GeyserImpl.getInstance().getLogger().info("Detected a new resource pack at the url %s!".formatted(url));
} }
@ -301,8 +305,8 @@ public class ResourcePackLoader implements RegistryLoader<Path, Map<String, Reso
Path path = geyserUrlPackCodec.getFallback().path(); Path path = geyserUrlPackCodec.getFallback().path();
try { try {
GeyserImpl.getInstance().getScheduledThread().schedule(() -> { GeyserImpl.getInstance().getScheduledThread().schedule(() -> {
deleteFile(path);
CACHED_FAILED_PACKS.invalidate(packId); CACHED_FAILED_PACKS.invalidate(packId);
deleteFile(path);
}, 5, TimeUnit.MINUTES); }, 5, TimeUnit.MINUTES);
} catch (RejectedExecutionException exception) { } catch (RejectedExecutionException exception) {
// No scheduling here, probably because we're shutting down? // No scheduling here, probably because we're shutting down?