From 08e9958dcb945fdcf8fa29151e2f154f5b82dc78 Mon Sep 17 00:00:00 2001 From: Fiaguhop137 Date: Sat, 31 Oct 2026 12:23:17 -0400 Subject: [PATCH 1/3] 1f89a-2026.10.31-12.23.17-0400 --- .../dev/intensed/fallback/api/LoggerAPI.java | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/src/main/java/dev/intensed/fallback/api/LoggerAPI.java b/src/main/java/dev/intensed/fallback/api/LoggerAPI.java index 102da10..81da56b 100644 --- a/src/main/java/dev/intensed/fallback/api/LoggerAPI.java +++ b/src/main/java/dev/intensed/fallback/api/LoggerAPI.java @@ -1,39 +1,28 @@ package dev.intensed.fallback.api; - import net.minecraft.network.chat.Component; import net.minecraft.server.MinecraftServer; - -public final class LoggerAPI { +public final class LoggerAPI{ private static MinecraftServer server; - - private LoggerAPI() { + private LoggerAPI(){} + public static void initialize(MinecraftServer minecraftServer){server=minecraftServer;} + public static void info(String author,String message){ + if(author==null||message==null)return; + LoggerAPI.send(Component.literal(("["+DateAPI.time()+"] ")).withStyle(style->style.withColor(5476815)).append(Component.literal("[main/INFO] ").withStyle(style->style.withColor(6919485)).append(Component.literal(("(" + author + ") ")).withStyle(style->style.withColor(4759714)).append(Component.literal(message).withStyle(style->style.withColor(12369603)))))); } - - public static void initialize(MinecraftServer minecraftServer) { - server = minecraftServer; + public static void success(String author,String message){ + if(author==null||message==null)return; + LoggerAPI.send(Component.literal(("["+DateAPI.time()+"] ")).withStyle(style->style.withColor(5476815)).append(Component.literal("[main/SUCCESS] ").withStyle(style->style.withColor(6919485)).append(Component.literal(("("+author+") ")).withStyle(style->style.withColor(4759714)).append(Component.literal(message).withStyle(style->style.withColor(12369603)))))); } - - public static void info(String author, String message) { - LoggerAPI.send(Component.literal(("[" + DateAPI.time() + "] ")).withStyle(style -> style.withColor(5476815)).append(Component.literal("[main/INFO] ").withStyle(style -> style.withColor(6919485)).append(Component.literal(("(" + author + ") ")).withStyle(style -> style.withColor(4759714)).append(Component.literal(message).withStyle(style -> style.withColor(12369603)))))); + public static void warn(String author,String message){ + if(author==null||message==null)return; + LoggerAPI.send(Component.literal(("["+DateAPI.time()+"] ")).withStyle(style->style.withColor(5476815)).append(Component.literal("[main/WARN] ").withStyle(style->style.withColor(10586927)).append(Component.literal(("("+author+") ")).withStyle(style->style.withColor(4759714)).append(Component.literal(message).withStyle(style->style.withColor(12369603)))))); } - - public static void success(String author, String message) { - LoggerAPI.send(Component.literal(("[" + DateAPI.time() + "] ")).withStyle(style -> style.withColor(5476815)).append(Component.literal("[main/SUCCESS] ").withStyle(style -> style.withColor(6919485)).append(Component.literal(("(" + author + ") ")).withStyle(style -> style.withColor(4759714)).append(Component.literal(message).withStyle(style -> style.withColor(12369603)))))); + public static void error(String author,String message){ + if(author==null||message==null)return; + LoggerAPI.send(Component.literal(("["+DateAPI.time()+"] ")).withStyle(style->style.withColor(5476815)).append(Component.literal("[main/ERROR] ").withStyle(style->style.withColor(14572886)).append(Component.literal(("("+author+") ")).withStyle(style->style.withColor(4759714)).append(Component.literal(message).withStyle(style->style.withColor(12369603)))))); } - - public static void warn(String author, String message) { - LoggerAPI.send(Component.literal(("[" + DateAPI.time() + "] ")).withStyle(style -> style.withColor(5476815)).append(Component.literal("[main/WARN] ").withStyle(style -> style.withColor(10586927)).append(Component.literal(("(" + author + ") ")).withStyle(style -> style.withColor(4759714)).append(Component.literal(message).withStyle(style -> style.withColor(12369603)))))); - } - - public static void error(String author, String message) { - LoggerAPI.send(Component.literal(("[" + DateAPI.time() + "] ")).withStyle(style -> style.withColor(5476815)).append(Component.literal("[main/ERROR] ").withStyle(style -> style.withColor(14572886)).append(Component.literal(("(" + author + ") ")).withStyle(style -> style.withColor(4759714)).append(Component.literal(message).withStyle(style -> style.withColor(12369603)))))); - } - - private static void send(Component message) { - if (server == null) { - return; - } - server.getPlayerList().broadcastSystemMessage(message, false); + private static void send(Component message){ + if(message==null||server==null)return; + server.getPlayerList().broadcastSystemMessage(message,false); } } - From 7e29e026c444b6a447e6d1499ff8225967ad045c Mon Sep 17 00:00:00 2001 From: Fiaguhop137 Date: Sat, 31 Oct 2026 12:34:31 -0400 Subject: [PATCH 2/3] 1f89a-2026.10.31-12.34.31-0400 --- .../fallback/api/RandomDialogAPI.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/main/java/dev/intensed/fallback/api/RandomDialogAPI.java b/src/main/java/dev/intensed/fallback/api/RandomDialogAPI.java index a76d2d5..8951215 100644 --- a/src/main/java/dev/intensed/fallback/api/RandomDialogAPI.java +++ b/src/main/java/dev/intensed/fallback/api/RandomDialogAPI.java @@ -41,34 +41,26 @@ public static int execute(CommandSourceStack source, int from, int to, String pr available.add(number); } if (available.isEmpty()) { - source.sendFailure(Component.literal(("No unused dialogs are available for " + prefix + "."))); + source.sendFailure(Component.literal(("No unused dialogs are available for "+prefix+"."))); return 0; } - int selected = available.get(ThreadLocalRandom.current().nextInt(available.size())); - scoreName = RandomDialogAPI.getScoreName(prefix, selected); + int selected=available.get(ThreadLocalRandom.current().nextInt(available.size())); + scoreName=RandomDialogAPI.getScoreName(prefix, selected); + if(scoreName==null)return 0; // you can put smth else here if you want to handle null differently; this exists cuz i noticed your code would just have a heart attack and explode if scoreName was null so i added this to prevent that ^w^ scoreboard.getOrCreatePlayerScore(ScoreHolder.forNameOnly(scoreName), objective).set(1); - String command = "dialog show " + player + " " + prefix + ":" + selected; + String command="dialog show "+player+" "+prefix+":"+selected; server.getCommands().performPrefixedCommand(source, command); return 1; } - - private static String getScoreName(String prefix, int number) { - return prefix + ":" + number; + private static String getScoreName(String prefix,int number){ + return prefix+":"+number; } - public static List parseBlocked(String input) { - String[] values; - ArrayList blocked = new ArrayList(); - if (input == null || input.isBlank()) { - return blocked; - } - for (String value : values = input.split(",")) { - try { - blocked.add(Integer.parseInt(value.trim())); - } - catch (NumberFormatException numberFormatException) { - // empty catch block - } + ArrayList blocked=new ArrayList<>(); + if(input==null||input.isBlank())return blocked; + for(String value:input.split(",")){ + try{blocked.add(Integer.parseInt(value.trim()));} + catch(NumberFormatException ignored){/*empty catch block*/} } return blocked; } From a581d467b89f695e8639a1ff71a9f259dc394941 Mon Sep 17 00:00:00 2001 From: Fiaguhop137 Date: Sat, 31 Oct 2026 12:44:38 -0400 Subject: [PATCH 3/3] 1f89a-2026.10.31-12.44.38-0400 --- .../intensed/fallback/client/FallbackDataGenerator.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/dev/intensed/fallback/client/FallbackDataGenerator.java b/src/main/java/dev/intensed/fallback/client/FallbackDataGenerator.java index ae4372e..4054b64 100644 --- a/src/main/java/dev/intensed/fallback/client/FallbackDataGenerator.java +++ b/src/main/java/dev/intensed/fallback/client/FallbackDataGenerator.java @@ -1,12 +1,11 @@ package dev.intensed.fallback.client; - +import org.jspecify.annotations.NonNull; import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; - public class FallbackDataGenerator -implements DataGeneratorEntrypoint { - public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { - FabricDataGenerator.Pack pack = fabricDataGenerator.createPack(); +implements DataGeneratorEntrypoint{ + public void onInitializeDataGenerator(@NonNull FabricDataGenerator fabricDataGenerator){ + FabricDataGenerator.Pack pack=fabricDataGenerator.createPack(); } }