Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Jul 27, 2023
1 parent ce50c3b commit e9d5645
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ private void get(CallbackInfoReturnable<SplashTextRenderer> cir) {
}

String splashText = SplashTextSupplier.getSplashes(session, splashTexts);
cir.setReturnValue(new SplashTextRenderer(splashText));
cir.setReturnValue(new SplashTextRenderer(splashText == null ? "" : splashText));

if (CONFIG.debugInfo && !(CONFIG.randomRate == SplasherConfig.RandomRate.JEB) && CONFIG.enableSplashTexts) {
if (CONFIG.followClientLanguage) Splasher.LOGGER.info("Splash mode: " + CONFIG.splashMode.getLocalizedName().toUpperCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.text.Text;
import org.apache.commons.compress.utils.Lists;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.nio.file.Path;
import java.util.*;
Expand All @@ -19,7 +20,7 @@
public class SplashTextSupplier {
private static int lastRandomIndex = -1;

@NotNull public static String getSplashes(Session session, List<String> splashTexts) {
@Nullable public static String getSplashes(Session session, List<String> splashTexts) {
Path path = FabricLoader.getInstance().getConfigDir().resolve(Splasher.ID);

if (CONFIG.colorful) {
Expand All @@ -38,7 +39,7 @@ public class SplashTextSupplier {
Splasher.LOGGER.warn("Minecraft has no splash loaded. Check your data as if it may be broken.");
}
Splasher.LOGGER.error("Empty stack!");
return "";
return null;
}

final int random = nextRandomIndex(customSplashTexts.size());
Expand Down Expand Up @@ -71,7 +72,7 @@ public class SplashTextSupplier {

if (CONFIG.splashMode.isCustom()) return customSplashTexts.get(random);

return "";
return null;
}

private static int nextRandomIndex(int size) {
Expand Down

0 comments on commit e9d5645

Please sign in to comment.