|
25 | 25 |
|
26 | 26 | package org.geysermc.geyser.pack.url; |
27 | 27 |
|
| 28 | +import java.io.IOException; |
| 29 | +import java.nio.channels.SeekableByteChannel; |
| 30 | +import java.util.Objects; |
28 | 31 | import lombok.Getter; |
29 | 32 | import org.checkerframework.checker.nullness.qual.NonNull; |
30 | 33 | import org.geysermc.geyser.GeyserImpl; |
|
36 | 39 | import org.geysermc.geyser.registry.loader.ResourcePackLoader; |
37 | 40 | import org.geysermc.geyser.text.GeyserLocale; |
38 | 41 |
|
39 | | -import java.io.IOException; |
40 | | -import java.nio.channels.SeekableByteChannel; |
41 | | -import java.util.Objects; |
42 | | - |
43 | 42 | public class GeyserUrlPackCodec extends UrlPackCodec { |
44 | 43 | private final @NonNull String url; |
45 | 44 | @Getter |
@@ -130,10 +129,11 @@ public void testForChanges(ResourcePackHolder holder) { |
130 | 129 | Registries.RESOURCE_PACKS.get().put(updatedPack.uuid(), holder.withPack(pack)); |
131 | 130 |
|
132 | 131 | }) |
133 | | - .exceptionally(throwable -> { |
134 | | - GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.resource_pack.broken", url), throwable); |
135 | | - Registries.RESOURCE_PACKS.get().remove(holder.uuid()); |
136 | | - return null; |
| 132 | + .whenComplete((result, throwable) -> { |
| 133 | + if (throwable != null) { |
| 134 | + GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.resource_pack.broken", url), throwable); |
| 135 | + Registries.RESOURCE_PACKS.get().remove(holder.uuid()); |
| 136 | + } |
137 | 137 | }); |
138 | 138 | } |
139 | 139 | } |
0 commit comments