From 976708d517f03ffd41b705e8443847e8636bb3dc Mon Sep 17 00:00:00 2001 From: CCr4ft3r <118105353+CCr4ft3r@users.noreply.github.com> Date: Thu, 13 Apr 2023 17:43:57 +0200 Subject: [PATCH] hiding title screen branding if others were removed --- gradle.properties | 2 +- .../ccr4ft3r/lightspeed/events/TitleScreenInjector.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 82c63aa..6acdc3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ org.gradle.daemon=false mc_version=1.18.2 forge_version=40.1.73 -mod_version=1.0.2 \ No newline at end of file +mod_version=1.0.3 \ No newline at end of file diff --git a/src/main/java/com/ccr4ft3r/lightspeed/events/TitleScreenInjector.java b/src/main/java/com/ccr4ft3r/lightspeed/events/TitleScreenInjector.java index 45ef7d8..957ec41 100644 --- a/src/main/java/com/ccr4ft3r/lightspeed/events/TitleScreenInjector.java +++ b/src/main/java/com/ccr4ft3r/lightspeed/events/TitleScreenInjector.java @@ -40,9 +40,11 @@ public class TitleScreenInjector { computeBranding.invoke(null); List brandings = new ArrayList<>((List) f.get(brandingControl)); - List newBrandings = new ArrayList<>(brandings); - f.set(brandingControl, newBrandings); - newBrandings.add("Lightspeed: Launch took " + secondsToStart + "s"); + if (brandings.size() > 1) { + List newBrandings = new ArrayList<>(brandings); + f.set(brandingControl, newBrandings); + newBrandings.add("Lightspeed: Launch took " + secondsToStart + "s"); + } } catch (NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { LogUtils.getLogger().error("Cannot add launch time to title screen", e);