3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 15:00:11 +01:00

Ensure packs actually load

Dieser Commit ist enthalten in:
onebeastchris 2024-06-20 21:17:32 +02:00
Ursprung ba78dbaf34
Commit de54a5bde9
4 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -82,11 +82,12 @@ public class GeyserUrlPackCodec extends UrlPackCodec {
} else if (pack != null) { } else if (pack != null) {
this.fallback = pack; this.fallback = pack;
} }
}); }).join(); // Needed to ensure that we don't attempt to read a pack before downloading/checking it
} catch (Exception e) { } catch (Exception e) {
throw new IllegalArgumentException("Failed to download pack from the url %s (reason: %s)!".formatted(url, e.getMessage())); throw new IllegalArgumentException("Failed to download pack from the url %s (reason: %s)!".formatted(url, e.getMessage()));
} }
} }
return ResourcePackLoader.readPack(this); return ResourcePackLoader.readPack(this);
} }

Datei anzeigen

@ -235,11 +235,13 @@ public class ResourcePackLoader implements RegistryLoader<Path, Map<String, Reso
packMap.put(pack.manifest().header().uuid().toString(), pack); packMap.put(pack.manifest().header().uuid().toString(), pack);
} catch (Exception e) { } catch (Exception e) {
instance.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.resource_pack.broken", url)); instance.getLogger().error(GeyserLocale.getLocaleStringLog("geyser.resource_pack.broken", url));
instance.getLogger().error(e.getMessage());
if (instance.getLogger().isDebug()) { if (instance.getLogger().isDebug()) {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }
return packMap; return packMap;
} }

Datei anzeigen

@ -51,7 +51,7 @@ import java.util.stream.Collectors;
import static org.geysermc.geyser.scoreboard.UpdateType.*; import static org.geysermc.geyser.scoreboard.UpdateType.*;
public final class Scoreboard { public final class Scoreboard {
private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "false"));
private static final boolean ADD_TEAM_SUGGESTIONS = Boolean.parseBoolean(System.getProperty("Geyser.AddTeamSuggestions", "true")); private static final boolean ADD_TEAM_SUGGESTIONS = Boolean.parseBoolean(System.getProperty("Geyser.AddTeamSuggestions", "true"));
private final GeyserSession session; private final GeyserSession session;

Datei anzeigen

@ -48,7 +48,7 @@ public final class ScoreboardUpdater extends Thread {
static { static {
GeyserConfiguration config = GeyserImpl.getInstance().getConfig(); GeyserConfiguration config = GeyserImpl.getInstance().getConfig();
FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD = Math.min(config.getScoreboardPacketThreshold(), SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD); FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD = Math.min(config.getScoreboardPacketThreshold(), SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD);
DEBUG_ENABLED = config.isDebugMode(); DEBUG_ENABLED = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "false")) && config.isDebugMode();
} }
private final GeyserImpl geyser = GeyserImpl.getInstance(); private final GeyserImpl geyser = GeyserImpl.getInstance();