From 1ad04bb3f2e796159f9e7d1cb7fc2c2f0f75da14 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 25 Jan 2025 19:41:00 +0200 Subject: [PATCH 01/89] Send logs to admins in chat --- .../GithubResourcepackManager.java | 12 ++-- .../platform/PlatformLogging.java | 19 +++++ .../platform/PlatformMain.java | 2 + .../fabric/FabricPlatformCommand.java | 41 ++++++++++- .../fabric/FabricPlatformLogging.java | 27 +++++++ .../platform/fabric/FabricPlatformMain.java | 72 +++++++++++++++++++ .../platform/paper/PaperPlatformCommand.java | 40 ++++++++++- .../platform/paper/PaperPlatformLogging.java | 28 ++++++++ .../platform/paper/PaperPlatformMain.java | 51 ++++++++++++- .../platform/paper/PaperPlugin.java | 22 +++++- 10 files changed, 302 insertions(+), 12 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 42f4c98..1abd458 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,16 +1,14 @@ package top.offsetmonkey538.githubresourcepackmanager; import org.apache.commons.io.FileUtils; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; import top.offsetmonkey538.githubresourcepackmanager.handler.PackHandler; import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import top.offsetmonkey538.githubresourcepackmanager.platform.*; import top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.githubresourcepackmanager.utils.*; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; @@ -18,6 +16,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.*; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; import java.util.regex.Pattern; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; @@ -44,6 +44,8 @@ private GithubResourcepackManager() { public static void initialize() { + PlatformMain.INSTANCE.registerLogToAdminListener(); + PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); ConfigManager.loadConfig(); @@ -142,7 +144,7 @@ public static void updatePack(final UpdateType updateType) { // Send chat message try { - sendUpdateMessage(wasUpdated, placeholders); + if (!failed) sendUpdateMessage(wasUpdated, placeholders); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java index 9cf032d..8a84d63 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java @@ -1,5 +1,9 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; +import org.jetbrains.annotations.Nullable; + +import java.util.function.BiConsumer; + import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformLogging { @@ -30,4 +34,19 @@ default void error(String message, Throwable error, Object... args) { void warn(String message, Throwable error); void error(String message); void error(String message, Throwable error); + + void addListener(LogLevel level, LogListener listener); + void removeListener(LogLevel level, LogListener listener); + + enum LogLevel { + DEBUG, + INFO, + WARN, + ERROR + } + + @FunctionalInterface + interface LogListener { + void accept(String message, @Nullable Throwable error); + } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index a3f80d6..93e5db8 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -23,4 +23,6 @@ public interface PlatformMain { * @param work the stuff to run */ void runOnServerStart(Runnable work); + + void registerLogToAdminListener(); } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 3e58206..2bee8e1 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -1,6 +1,7 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.context.CommandContext; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.command.ControlFlowAware; @@ -9,15 +10,24 @@ import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.text.HoverEvent; +import net.minecraft.text.MutableText; +import net.minecraft.text.Style; import net.minecraft.text.Text; +import net.minecraft.util.Colors; +import net.minecraft.util.Formatting; +import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import java.util.Optional; import static com.mojang.brigadier.arguments.BoolArgumentType.bool; +import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static net.minecraft.server.command.CommandManager.argument; import static net.minecraft.server.command.CommandManager.literal; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; public class FabricPlatformCommand implements PlatformCommand { @Override @@ -57,14 +67,14 @@ public static void register(CommandDispatcher dispatcher, C .requires(source -> source.hasPermissionLevel(2)) .executes( context -> { - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.COMMAND); + runTriggerUpdate(context, false); return 1; } ) .then(argument("force", bool()) .executes( context -> { - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.COMMAND_FORCE); + runTriggerUpdate(context, getBool(context, "force")); return 1; } ) @@ -72,4 +82,31 @@ public static void register(CommandDispatcher dispatcher, C ) ); } + + private static void runTriggerUpdate(CommandContext context, boolean force) { + final PlatformLogging.LogListener infoListener = (message, error) -> { + context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message))); + }; + final PlatformLogging.LogListener warnListener = (message, error) -> { + MutableText text = Text + .literal(String.format("[%s] %s", MOD_ID, message)) + .setStyle(Style.EMPTY.withColor(Formatting.YELLOW)); + + if (error != null) text.setStyle(Style.EMPTY.withColor(Formatting.YELLOW).withHoverEvent( + new HoverEvent( + HoverEvent.Action.SHOW_TEXT, + Text.literal(ExceptionUtils.getRootCauseMessage(error)) + ) + )); + + context.getSource().sendMessage(text); + }; + PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.INFO, infoListener); + PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.WARN, warnListener); + + GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); + + PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.INFO, infoListener); + PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.WARN, warnListener); + } } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java index 0184c28..45cb414 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java @@ -3,40 +3,67 @@ import org.slf4j.Logger; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class FabricPlatformLogging implements PlatformLogging { private static Logger logger; + private static final Map> listeners = new HashMap<>(Map.of( + LogLevel.DEBUG, new ArrayList<>(), + LogLevel.INFO, new ArrayList<>(), + LogLevel.WARN, new ArrayList<>(), + LogLevel.ERROR, new ArrayList<>() + )); @Override public void debug(String message) { + listeners.get(LogLevel.DEBUG).forEach(consumer -> consumer.accept(message, null)); logger.debug(message); } @Override public void info(String message) { + listeners.get(LogLevel.INFO).forEach(consumer -> consumer.accept(message, null)); logger.info(message); } @Override public void warn(String message) { + listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, null)); logger.warn(message); } @Override public void warn(String message, Throwable error) { + listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, error)); logger.warn(message, error); } @Override public void error(String message) { + listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, null)); logger.error(message); } @Override public void error(String message, Throwable error) { + listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, error)); logger.error(message, error); } + @Override + public void addListener(LogLevel level, LogListener listener) { + listeners.get(level).add(listener); + } + + @Override + public void removeListener(LogLevel level, LogListener listener) { + listeners.get(level).remove(listener); + } + public static void setLogger(Logger logger) { FabricPlatformLogging.logger = logger; } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 132aac0..9dfd416 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -1,22 +1,36 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; +import com.mojang.authlib.GameProfile; import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; +import net.minecraft.text.HoverEvent; +import net.minecraft.text.MutableText; +import net.minecraft.text.Style; +import net.minecraft.text.Text; +import net.minecraft.util.Colors; +import net.minecraft.util.Formatting; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import java.nio.file.Path; +import java.util.LinkedList; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { public static final FabricPlatformMain INSTANCE = (FabricPlatformMain) PlatformMain.INSTANCE; private static MinecraftServer minecraftServer; + private static final LinkedList messageQueue = new LinkedList<>(); @Override public void onInitializeServer() { @@ -25,6 +39,13 @@ public void onInitializeServer() { GithubResourcepackManager.initialize(); ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer1 -> minecraftServer = minecraftServer1); + ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { + if (!minecraftServer1.getPlayerManager().isOperator(serverPlayNetworkHandler.player.getGameProfile())) return; + + for (Text text : messageQueue) { + serverPlayNetworkHandler.player.sendMessage(text); + } + }); } public static MinecraftServer getServer() { @@ -41,4 +62,55 @@ public Path getConfigDir() { public void runOnServerStart(Runnable work) { ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer1 -> work.run()); } + + @Override + public void registerLogToAdminListener() { + LOGGER.addListener(PlatformLogging.LogLevel.ERROR, (message, error) -> { + MutableText text = Text + .literal(String.format("[%s] %s", MOD_ID, message)) + .setStyle(Style.EMPTY.withColor(Formatting.RED)); + if (error != null) text = text.setStyle(Style.EMPTY.withColor(Formatting.RED).withHoverEvent( + new HoverEvent( + HoverEvent.Action.SHOW_TEXT, + Text.literal(ExceptionUtils.getRootCauseMessage(error)) + ) + )); + + boolean sent = false; + for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { + if (!getServer().getPlayerManager().isOperator(player.getGameProfile())) continue; + player.sendMessage(text, false); + sent = true; + } + if (sent) return; + + messageQueue.addLast(text); + }); + } + + //public void registerLogToAdminListener() { + // LOGGER.addListener(PlatformLogging.LogLevel.ERROR, (message, error) -> { + // Component text = Component + // .text(String.format("[%s] %s", MOD_ID, message)) + // .color(NamedTextColor.RED); + // + // if (error != null) text = text.hoverEvent( + // HoverEvent.showText( + // Component.text(ExceptionUtils.getRootCauseMessage(error)) + // ) + // ); + // + // + // boolean sent = false; + // for (final OfflinePlayer operator : plugin.getServer().getOperators()) { + // if (operator.getPlayer() == null) continue; + // operator.getPlayer().sendMessage(text); + // sent = true; + // } + // + // if (sent) return; + // + // plugin.messageQueue.addLast(text); + // }); + //} } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index 36b7082..773c133 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -1,20 +1,29 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; import com.mojang.brigadier.Command; +import com.mojang.brigadier.context.CommandContext; +import io.papermc.paper.command.brigadier.CommandSourceStack; import io.papermc.paper.command.brigadier.Commands; import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents; import net.kyori.adventure.resource.ResourcePackInfo; import net.kyori.adventure.resource.ResourcePackRequest; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; import net.minecraft.server.MinecraftServer; +import org.apache.commons.lang.exception.ExceptionUtils; import org.bukkit.entity.Player; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import java.net.URI; import static com.mojang.brigadier.arguments.BoolArgumentType.bool; +import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static io.papermc.paper.command.brigadier.Commands.argument; import static io.papermc.paper.command.brigadier.Commands.literal; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; public class PaperPlatformCommand implements PlatformCommand { @SuppressWarnings("UnstableApiUsage") @@ -55,14 +64,14 @@ public void registerGithubRpManagerCommand() { .requires(source -> source.getSender().isOp()) .executes( context -> { - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.COMMAND); + runTriggerUpdate(context, false); return 1; } ) .then(argument("force", bool()) .executes( context -> { - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.COMMAND_FORCE); + runTriggerUpdate(context, getBool(context, "force")); return 1; } ) @@ -73,6 +82,33 @@ public void registerGithubRpManagerCommand() { }); } + @SuppressWarnings("UnstableApiUsage") + private void runTriggerUpdate(CommandContext context, boolean force) { + final PlatformLogging.LogListener infoListener = (message, error) -> { + context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message))); + }; + final PlatformLogging.LogListener warnListener = (message, error) -> { + Component text = Component + .text(String.format("[%s] %s", MOD_ID, message)) + .color(NamedTextColor.YELLOW); + + if (error != null) text = text.hoverEvent( + HoverEvent.showText( + Component.text(ExceptionUtils.getRootCauseMessage(error)) + ) + ); + + context.getSource().getSender().sendMessage(text); + }; + PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.INFO, infoListener); + PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.WARN, warnListener); + + GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); + + PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.INFO, infoListener); + PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.WARN, warnListener); + } + //@Override //public void registerGithubRpManagerCommand() { // CommandRegistrationCallback.EVENT.register(FabricPlatformCommand::register); diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java index e89673a..737d7b1 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java @@ -1,44 +1,72 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; import java.util.logging.Level; import java.util.logging.Logger; public class PaperPlatformLogging implements PlatformLogging { private static Logger logger; + private static final Map> listeners = new HashMap<>(Map.of( + LogLevel.DEBUG, new ArrayList<>(), + LogLevel.INFO, new ArrayList<>(), + LogLevel.WARN, new ArrayList<>(), + LogLevel.ERROR, new ArrayList<>() + )); @Override public void debug(String message) { + listeners.get(LogLevel.DEBUG).forEach(consumer -> consumer.accept(message, null)); logger.log(Level.FINE, message); } @Override public void info(String message) { + listeners.get(LogLevel.INFO).forEach(consumer -> consumer.accept(message, null)); logger.log(Level.INFO, message); } @Override public void warn(String message) { + listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, null)); logger.log(Level.WARNING, message); } @Override public void warn(String message, Throwable error) { + listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, error)); logger.log(Level.WARNING, message, error); } @Override public void error(String message) { + listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, null)); logger.log(Level.SEVERE, message); } @Override public void error(String message, Throwable error) { + listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, error)); logger.log(Level.SEVERE, message, error); } + @Override + public void addListener(LogLevel level, LogListener listener) { + listeners.get(level).add(listener); + } + + @Override + public void removeListener(LogLevel level, LogListener listener) { + listeners.get(level).remove(listener); + } + public static void setLogger(Logger logger) { PaperPlatformLogging.logger = logger; } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index c20d396..e1679f2 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -1,12 +1,32 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.format.TextColor; +import net.kyori.adventure.util.RGBLike; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.bukkit.OfflinePlayer; +import org.bukkit.entity.Player; import org.bukkit.plugin.java.JavaPlugin; +import org.jetbrains.annotations.Nullable; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; +import java.io.PrintStream; +import java.io.PrintWriter; import java.nio.file.Path; +import java.util.LinkedList; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.stream.Stream; + +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public class PaperPlatformMain implements PlatformMain { - private static JavaPlugin plugin; + private static PaperPlugin plugin; @Override public Path getConfigDir() { @@ -18,7 +38,34 @@ public void runOnServerStart(Runnable work) { work.run(); } - public static void setPlugin(JavaPlugin plugin) { + @Override + public void registerLogToAdminListener() { + LOGGER.addListener(PlatformLogging.LogLevel.ERROR, (message, error) -> { + Component text = Component + .text(String.format("[%s] %s", MOD_ID, message)) + .color(NamedTextColor.RED); + + if (error != null) text = text.hoverEvent( + HoverEvent.showText( + Component.text(ExceptionUtils.getRootCauseMessage(error)) + ) + ); + + + boolean sent = false; + for (final OfflinePlayer operator : plugin.getServer().getOperators()) { + if (operator.getPlayer() == null) continue; + operator.getPlayer().sendMessage(text); + sent = true; + } + + if (sent) return; + + plugin.messageQueue.addLast(text); + }); + } + + public static void setPlugin(PaperPlugin plugin) { PaperPlatformMain.plugin = plugin; } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java index caf4270..3428ea3 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java @@ -1,13 +1,23 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +import net.kyori.adventure.text.Component; +import org.bukkit.Bukkit; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.meshlib.MeshLib; -public class PaperPlugin extends JavaPlugin { +import java.util.LinkedList; + +public class PaperPlugin extends JavaPlugin implements Listener { + public final LinkedList messageQueue = new LinkedList<>(); @Override public void onEnable() { + Bukkit.getPluginManager().registerEvents(this, this); MeshLib.initialize(); PaperPlatformMain.setPlugin(this); @@ -15,4 +25,14 @@ public void onEnable() { GithubResourcepackManager.initialize(); } + + @EventHandler(priority = EventPriority.MONITOR) + public void onPlayerJoin(PlayerJoinEvent event) { + if (!event.getPlayer().isOp()) return; + + for (Component text : messageQueue) { + event.getPlayer().sendMessage(text); + } + messageQueue.clear(); + } } From f90eaa1addd65d82624dab0ae7ca21cadb1ae20c Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 14 Jun 2025 13:30:32 +0300 Subject: [PATCH 02/89] Restructure config Nothing is implemented yet :( --- .../GithubResourcepackManager.java | 7 +- .../config/ConfigManager.java | 14 +- .../config/ModConfig.java | 189 +++++++++++++++--- .../handler/GitHandler.java | 6 +- .../platform/fabric/FabricPlatformText.java | 6 +- .../platform/paper/PaperPlatformText.java | 6 +- 6 files changed, 183 insertions(+), 45 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 42f4c98..30f19a6 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -159,8 +159,9 @@ public static void updatePack(final UpdateType updateType) { } private static void triggerWebhook(boolean wasUpdated, Map placeholders, UpdateType updateType) throws GithubResourcepackManagerException { - if (config.webhookUrl == null || config.webhookBody == null) return; - if (config.webhookBody.contains("discord") && !wasUpdated) { + // todo: change logic to match enable/disable and fail/success webhooks + if (config.resourcePackProvider.successWebhook.url == null || config.resourcePackProvider.successWebhook.body == null) return; + if (config.resourcePackProvider.successWebhook.body.contains("discord") && !wasUpdated) { LOGGER.info("Not sending discord webhook because pack was not updated."); return; } @@ -172,7 +173,7 @@ private static void triggerWebhook(boolean wasUpdated, Map place WebhookSender.send(webhookBody, config.getWebhookUrl(), updateType, gitHandler.getWasUpdated()); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.webhookBody); + throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.resourcePackProvider.successWebhook.body); } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java index 87dc2d9..6fda41d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java @@ -74,14 +74,14 @@ public static void loadConfig() { private static @NotNull List checkConfigErrors() { final List errors = new ArrayList<>(); - if (config.serverPublicIp == null) errors.add("Field 'serverPublicIp' not set!"); - if (config.repoUrl == null) errors.add("Field 'repoUrl' not set!"); - if (config.isRepoPrivate) { - if (config.githubUsername == null) errors.add("Field 'githubUsername' not set, but 'isRepoPrivate' is true!"); - if (config.githubToken == null) errors.add("Field 'githubToken' not set, but 'isRepoPrivate' is true!"); + if (config.serverInfo.publicIp == null) errors.add("Field 'serverInfo.publicIp' not set!"); + if (config.repositoryInfo.url == null) errors.add("Field 'repositoryInfo.url' not set!"); + if (config.repositoryInfo.isPrivate) { + if (config.repositoryInfo.username == null) errors.add("Field 'repositoryInfo.username' not set, but 'repositoryInfo.isPrivate' is true!"); + if (config.repositoryInfo.token == null) errors.add("Field 'repositoryInfo.token' not set, but 'repositoryInfo.isPrivate' is true!"); } else { - if (config.githubUsername != null) errors.add("Field 'githubUsername' set, but 'isRepoPrivate' is false! Can be unset"); - if (config.githubToken != null) errors.add("Field 'githubToken' set, but 'isRepoPrivate' is false! Can be unset"); + if (config.repositoryInfo.username != null) errors.add("Field 'repositoryInfo.username' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); + if (config.repositoryInfo.token != null) errors.add("Field 'repositoryInfo.token' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); } return errors; } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 2cbb7fa..561376a 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -3,6 +3,7 @@ import blue.endless.jankson.Comment; import blue.endless.jankson.Jankson; import blue.endless.jankson.JsonGrammar; +import blue.endless.jankson.api.Marshaller; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.BasicWebhook; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.BasicMessage; @@ -21,24 +22,109 @@ import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public class ModConfig { + @Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") - public String packUpdateMessage = "Server resourcepack has been updated!\nPlease click {packUpdateCommand} to get the most up to date pack."; - public String packUpdateMessageHoverMessage = "{longDescription}"; - @Comment("The public ip of your server (\"123.45.67.89\" or \"play.coolserver.net\")") - public String serverPublicIp = null; - @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") - public String proxyPort = null; - @Comment("Should be \"[YOUR BRANCH NAME HERE]\". Common names include \"master\" and \"main\"") - public String branch = "master"; - public String repoUrl = null; - @Comment("Where the mod will search for resource packs in the cloned repository") - public String resourcePackRoot = ""; - public boolean isRepoPrivate = false; - public String githubUsername = null; - @Comment("PLEASE DON'T SHARE THIS WITH ANYONE EVER") - public String githubToken = null; - public String webhookUrl = null; - public String webhookBody = null; + public ServerInfo serverInfo = new ServerInfo(); + public RepositoryInfo repositoryInfo = new RepositoryInfo(); + public ResourcePackProvider resourcePackProvider = new ResourcePackProvider(); + public DataPackProvider dataPackProvider = new DataPackProvider(); + + + public static class ServerInfo { + @Comment("The public ip of your server (\"123.45.67.89\" or \"play.coolserver.net\")") + public String publicIp = null; + + @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") + public String proxyPort = null; + } + + public static class RepositoryInfo { + @Comment("Should be \"[YOUR BRANCH NAME HERE]\". Common names include \"master\" and \"main\"") + public String branch = "master"; + @Comment("The URL of your repository. For example \"https://github.com/MyName/MyRepository\"") + public String url = null; + + @Comment("Whether or not the repository is private. Username and token will need to be populated when this is set to 'true'!") + public boolean isPrivate = false; + + @Comment("The two values below only need to be set when 'isPrivate' is true!") + public String username = null; + @Comment("PLEASE DO NOT SHARE THIS WITH ANYONE") + public String token = null; + } + + public static class ResourcePackProvider { + @Comment("Whether or not the resource pack provider is enabled. Default: true") + public boolean enabled = true; + @Comment("Where the mod will search for resource packs in the cloned repository. MUST NOT be same as or child of the 'rootLocation' of the datapack provider") + public String rootLocation = "/resourcepacks"; + + @Comment("Message sent in chat when pack has been updated. May be 'null' to disable.") + public String updateMessage = "Server resourcepack has been updated!\nPlease click {packUpdateCommand} to get the most up to date pack."; + @Comment("Message shown when hovering over the 'updateMessage' text. May be 'null' to disable.") + public String updateMessageHoverMessage = "{longDescription}"; + + @Comment("Webhook to be sent when pack updating succeeded") + public WebhookInfo successWebhook = new WebhookInfo(); + @Comment("Webhook to be sent when pack updating failed") + public WebhookInfo failWebhook = new WebhookInfo(); + } + + public static class DataPackProvider { + @Comment("Whether or not the data pack provider is enabled. Default: false") + public boolean enabled = false; + @Comment("Where the mod will search for data packs in the cloned repository. MUST NOT be same as or child of the 'rootLocation' of the resourcepack provider") + public String rootLocation = "/datapacks"; + + @Comment("Message sent TO ADMINS in chat when pack has been updated. May be 'null' to disable.") + public String updateMessage = "Server datapacks has been updated!\nNew packs (if any) have been enabled automatically.\nPlease run '/reload' or restart the server to reload datapacks."; + @Comment("Message shown when hovering over the 'updateMessage' text. May be 'null' to disable.") + public String updateMessageHoverMessage = "{longDescription}"; + + @Comment("Webhook to be sent when pack updating succeeded") + public WebhookInfo successWebhook = new WebhookInfo(); + @Comment("Webhook to be sent when pack updating failed") + public WebhookInfo failWebhook = new WebhookInfo(); + } + + public static class WebhookInfo { + + public WebhookInfo() { + + } + public WebhookInfo(boolean enabled, String url, String body) { + this.enabled = enabled; + this.url = url; + this.body = body; + } + + @Comment("Whether or not this webhook is enabled") + public boolean enabled = false; + + @Comment("The URL to send the webhook to. For example \"https://discord.com/api/webhooks/1234567890123456789/eW91J3JlIG5vdCBzdGVhbGluZyBhIHRva2Vu_bm9wZQ==_eWVyJyBub3Q=\" or something custom like \"https://api.example.com/NDI6IHRoZSBtZWFuaW5nIG9mIGxpZmUsIHRoZSB1bml2ZXJzZSwgYW5kIGV2ZXJ5dGhpbmc=\"") + public String url = null; + @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") + public String body = null; + } + + //@Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") + //public String packUpdateMessage = "Server resourcepack has been updated!\nPlease click {packUpdateCommand} to get the most up to date pack."; + //public String packUpdateMessageHoverMessage = "{longDescription}"; + //@Comment("The public ip of your server (\"123.45.67.89\" or \"play.coolserver.net\")") + //public String serverPublicIp = null; + //@Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") + //public String proxyPort = null; + //@Comment("Should be \"[YOUR BRANCH NAME HERE]\". Common names include \"master\" and \"main\"") + //public String branch = "master"; + //public String repoUrl = null; + //@Comment("Where the mod will search for resource packs in the cloned repository") + //public String resourcePackRoot = ""; + //public boolean isRepoPrivate = false; + //public String githubUsername = null; + //@Comment("PLEASE DON'T SHARE THIS WITH ANYONE EVER") + //public String githubToken = null; + //public String webhookUrl = null; + //public String webhookBody = null; protected String getName() { @@ -46,7 +132,7 @@ protected String getName() { } protected int getConfigVersion() { - return 2; + return 3; } protected List getDatafixers() { @@ -60,6 +146,57 @@ protected List getDatafixers() { (original, jankson) -> { // 1 -> 2 // noop + }, + (original, jankson) -> { + // 2 -> 3 + + final Marshaller marsh = jankson.getMarshaller(); + + // Server Info + final ServerInfo serverInfo = new ServerInfo(); + + serverInfo.publicIp = marsh.marshall(String.class, original.get("serverPublicIp")); + serverInfo.proxyPort = marsh.marshall(String.class, original.get("proxyPort")); + + original.put("serverInfo", jankson.toJson(serverInfo)); + + // Repository Info + final RepositoryInfo repositoryInfo = new RepositoryInfo(); + + repositoryInfo.branch = marsh.marshall(String.class, original.get("branch")); + repositoryInfo.url = marsh.marshall(String.class, original.get("repoUrl")); + repositoryInfo.isPrivate = marsh.marshall(Boolean.class, original.get("isRepoPrivate")); + repositoryInfo.username = marsh.marshall(String.class, original.get("githubUsername")); + repositoryInfo.token = marsh.marshall(String.class, original.get("githubToken")); + + original.put("repositoryInfo", jankson.toJson(repositoryInfo)); + + // Resource Pack Provider + final ResourcePackProvider resourcePackProvider = new ResourcePackProvider(); + + resourcePackProvider.enabled = true; + resourcePackProvider.rootLocation = marsh.marshall(String.class, original.get("resourcePackRoot")); + resourcePackProvider.updateMessage = marsh.marshall(String.class, original.get("packUpdateMessage")); + resourcePackProvider.updateMessageHoverMessage = marsh.marshall(String.class, original.get("packUpdateMessageHoverMessage")); + + final String webhookUrl = marsh.marshall(String.class, original.get("webhookUrl")); + final String webhookBody = marsh.marshall(String.class, original.get("webhookBody")); + + if (webhookUrl != null && webhookBody != null) { + final WebhookInfo webhookInfo = new WebhookInfo( + true, + webhookUrl, + webhookBody + ); + + resourcePackProvider.successWebhook = webhookInfo; + + if (!webhookBody.contains("discord")) { + resourcePackProvider.failWebhook = webhookInfo; + } + } + + original.put("resourcePackProvider", jankson.toJson(resourcePackProvider)); } ); } @@ -85,31 +222,31 @@ public void createDefaultWebhooks() { public String getPackUrl(String outputFileName) { return String.format( "http://%s:%s/%s/%s", - serverPublicIp, - proxyPort == null ? PlatformServerProperties.INSTANCE.getServerPort() : proxyPort, + serverInfo.publicIp, + serverInfo.proxyPort == null ? PlatformServerProperties.INSTANCE.getServerPort() : serverInfo.proxyPort, MOD_URI, outputFileName ); } public URI getWebhookUrl() { - if (webhookUrl == null) return null; - return URI.create(webhookUrl); + if (resourcePackProvider.successWebhook.url == null) return null; + return URI.create(resourcePackProvider.successWebhook.url); } public Path getWebhookBody() { - if (webhookBody == null) return null; - return CURRENT_CONFIG_FILE_PATH.getParent().resolve(webhookBody); + if (resourcePackProvider.successWebhook.body == null) return null; + return CURRENT_CONFIG_FILE_PATH.getParent().resolve(resourcePackProvider.successWebhook.body); } public Path getResourcePackRoot() { - return REPO_ROOT_FOLDER.resolve(config.resourcePackRoot.startsWith("/") ? config.resourcePackRoot.substring(1) : config.resourcePackRoot); + return REPO_ROOT_FOLDER.resolve(config.resourcePackProvider.rootLocation.startsWith("/") ? config.resourcePackProvider.rootLocation.substring(1) : config.resourcePackProvider.rootLocation); } public Path getPacksDir() { return getResourcePackRoot().resolve("packs"); } public String getGithubRef() { - return "refs/heads/" + branch; + return "refs/heads/" + repositoryInfo.branch; } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index 94ed0c5..8a0f3db 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -68,8 +68,8 @@ private static CommitProperties getLatestCommitProperties(String lastCommitHash, private static void updateRepository(boolean retry) throws GithubResourcepackManagerException { // Create credentials provider if repository is private CredentialsProvider credentialsProvider = null; - if (config.isRepoPrivate) - credentialsProvider = new UsernamePasswordCredentialsProvider(config.githubUsername, config.githubToken); + if (config.repositoryInfo.isPrivate) + credentialsProvider = new UsernamePasswordCredentialsProvider(config.repositoryInfo.username, config.repositoryInfo.token); // If the repo folder doesn't exist, clone the repository. if (!REPO_ROOT_FOLDER.toFile().exists()) cloneRepository(credentialsProvider); @@ -119,7 +119,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan private static void cloneRepository(CredentialsProvider credentialsProvider) throws GithubResourcepackManagerException { try { Git git = Git.cloneRepository() - .setURI(config.repoUrl) + .setURI(config.repositoryInfo.url) .setDirectory(REPO_ROOT_FOLDER.toFile()) .setBranch(config.getGithubRef()) .setCredentialsProvider(credentialsProvider) diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index ab38519..e31d02e 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -17,15 +17,15 @@ public void sendUpdateMessage(Map placeholders) throws GithubRes final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); if (playerManager == null) return; - String message = config.packUpdateMessage; + String message = config.resourcePackProvider.updateMessage; final String[] splitMessage = message.split("\n"); final HoverEvent hoverEvent; try { - hoverEvent = config.packUpdateMessageHoverMessage == null ? null : new HoverEvent( + hoverEvent = config.resourcePackProvider.updateMessageHoverMessage == null ? null : new HoverEvent( HoverEvent.Action.SHOW_TEXT, TextUtils.INSTANCE.getStyledText( - StringUtils.replacePlaceholders(config.packUpdateMessageHoverMessage, placeholders).replace("\\n", "\n") + StringUtils.replacePlaceholders(config.resourcePackProvider.updateMessageHoverMessage, placeholders).replace("\\n", "\n") ) ); } catch (Exception e) { diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index e3e44a1..4e270c6 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -15,15 +15,15 @@ public class PaperPlatformText implements PlatformText { @Override public void sendUpdateMessage(Map placeholders) throws GithubResourcepackManagerException { - String message = config.packUpdateMessage; + String message = config.resourcePackProvider.updateMessage; final String[] splitMessage = message.split("\n"); final HoverEvent hoverEvent; try { - hoverEvent = config.packUpdateMessageHoverMessage == null ? null : new HoverEvent( + hoverEvent = config.resourcePackProvider.updateMessageHoverMessage == null ? null : new HoverEvent( HoverEvent.Action.SHOW_TEXT, getStyledText( - StringUtils.replacePlaceholders(config.packUpdateMessageHoverMessage, placeholders).replace("\\n", "\n") + StringUtils.replacePlaceholders(config.resourcePackProvider.updateMessageHoverMessage, placeholders).replace("\\n", "\n") ) ); } catch (Exception e) { From ef8a16343dfc28483b442992b1562ad524f14762 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:57:46 +0300 Subject: [PATCH 03/89] Restructure folders --- .../GithubResourcepackManager.java | 32 +++++++++++-------- .../config/ModConfig.java | 2 +- .../handler/GitHandler.java | 10 +++--- .../handler/PackHandler.java | 2 +- .../networking/WebhookHttpHandler.java | 1 - .../platform/PlatformServerProperties.java | 2 +- .../utils/StringUtils.java | 6 ++-- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 30f19a6..18640e2 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -30,12 +30,16 @@ private GithubResourcepackManager() { public static final String MOD_ID = "github-resourcepack-manager"; public static final String MOD_URI = "gh-rp-manager"; - public static final Path RESOURCEPACK_FOLDER = PlatformMain.INSTANCE.getConfigDir().resolve(".resource-pack"); - public static final Path REPO_ROOT_FOLDER = RESOURCEPACK_FOLDER.resolve("git"); - public static final Path OUTPUT_FOLDER = RESOURCEPACK_FOLDER.resolve("output"); - public static final Pattern PACK_NAME_PATTERN = Pattern.compile("\\d+-"); - public static final UUID PACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); + public static final Path DATA_FOLDER = PlatformMain.INSTANCE.getConfigDir().resolve(".packs"); + public static final Path GIT_FOLDER = DATA_FOLDER.resolve("git"); + public static final Path RESOURCEPACK_FOLDER = DATA_FOLDER.resolve("resource-pack"); + public static final Path DATAPACK_FOLDER = DATA_FOLDER.resolve("data-pack"); + + public static final Path RESOURCEPACK_OUTPUT_FOLDER = RESOURCEPACK_FOLDER.resolve("output"); + + public static final Pattern RESOURCEPACK_NAME_PATTERN = Pattern.compile("\\d+-"); + public static final UUID RESOURCEPACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); public static ModConfig config; @@ -61,19 +65,21 @@ public static void initialize() { private static void createFolderStructure() throws GithubResourcepackManagerException { try { - Files.createDirectories(OUTPUT_FOLDER); + Files.createDirectories(RESOURCEPACK_OUTPUT_FOLDER); + Files.createDirectories(DATAPACK_FOLDER); + Files.createDirectories(GIT_FOLDER); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to create directory '%s'!", OUTPUT_FOLDER); + throw new GithubResourcepackManagerException("Failed to create directory '%s'!", RESOURCEPACK_OUTPUT_FOLDER); } } public static void updatePack(final UpdateType updateType) { - LOGGER.info("Updating resourcepack..."); + LOGGER.info("Updating packs..."); if (updateType == UpdateType.COMMAND_FORCE) { LOGGER.warn("Forced pack update! Deleting data directory and continuing..."); try { - FileUtils.deleteDirectory(RESOURCEPACK_FOLDER.toFile()); + FileUtils.deleteDirectory(DATA_FOLDER.toFile()); } catch (IOException e) { LOGGER.error("Failed to delete directory!", e); return; @@ -101,12 +107,12 @@ public static void updatePack(final UpdateType updateType) { // Get the location of the old pack, if it exists. - final String oldPackName = getOldPackName(); - final Path oldPackPath = oldPackName == null ? null : OUTPUT_FOLDER.resolve(oldPackName); + final String oldResourcePackName = getOldPackName(); + final Path oldResourcePackPath = oldResourcePackName == null ? null : RESOURCEPACK_OUTPUT_FOLDER.resolve(oldResourcePackName); // Check if pack was updated - final boolean wasUpdated = gitHandler.getWasUpdated() || oldPackPath == null || !oldPackPath.toFile().exists(); + final boolean wasUpdated = gitHandler.getWasUpdated() || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); if (!wasUpdated) { LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); } @@ -117,7 +123,7 @@ public static void updatePack(final UpdateType updateType) { LOGGER.info("Getting pack location..."); failed = false; try { - packHandler.generatePack(wasUpdated, oldPackPath, oldPackName); + packHandler.generatePack(wasUpdated, oldResourcePackPath, oldResourcePackName); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to generate pack!", e); failed = true; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 561376a..7329ad9 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -240,7 +240,7 @@ public Path getWebhookBody() { } public Path getResourcePackRoot() { - return REPO_ROOT_FOLDER.resolve(config.resourcePackProvider.rootLocation.startsWith("/") ? config.resourcePackProvider.rootLocation.substring(1) : config.resourcePackProvider.rootLocation); + return GIT_FOLDER.resolve(config.resourcePackProvider.rootLocation.startsWith("/") ? config.resourcePackProvider.rootLocation.substring(1) : config.resourcePackProvider.rootLocation); } public Path getPacksDir() { return getResourcePackRoot().resolve("packs"); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index 8a0f3db..d62d79c 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -72,11 +72,11 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan credentialsProvider = new UsernamePasswordCredentialsProvider(config.repositoryInfo.username, config.repositoryInfo.token); // If the repo folder doesn't exist, clone the repository. - if (!REPO_ROOT_FOLDER.toFile().exists()) cloneRepository(credentialsProvider); + if (!GIT_FOLDER.toFile().exists()) cloneRepository(credentialsProvider); // Pull from the remote boolean updateFailed = false; - try (Git git = Git.open(REPO_ROOT_FOLDER.toFile())) { + try (Git git = Git.open(GIT_FOLDER.toFile())) { final PullResult result = git.pull() .setCredentialsProvider(credentialsProvider) .setContentMergeStrategy(ContentMergeStrategy.THEIRS) @@ -106,7 +106,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan LOGGER.info("Deleting git folder and trying again..."); try { - FileUtils.deleteDirectory(REPO_ROOT_FOLDER.toFile()); + FileUtils.deleteDirectory(GIT_FOLDER.toFile()); } catch (IOException e) { LOGGER.error("Failed to delete directory!", e); } @@ -120,7 +120,7 @@ private static void cloneRepository(CredentialsProvider credentialsProvider) thr try { Git git = Git.cloneRepository() .setURI(config.repositoryInfo.url) - .setDirectory(REPO_ROOT_FOLDER.toFile()) + .setDirectory(GIT_FOLDER.toFile()) .setBranch(config.getGithubRef()) .setCredentialsProvider(credentialsProvider) .call(); @@ -143,7 +143,7 @@ private static Ref getLatestCommit() throws GithubResourcepackManagerException { } private static Repository getRepository() throws GithubResourcepackManagerException { - try (Git git = Git.open(REPO_ROOT_FOLDER.toFile())) { + try (Git git = Git.open(GIT_FOLDER.toFile())) { return git.getRepository(); } catch (IOException e) { throw new GithubResourcepackManagerException("Failed to open repository!", e); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java index c20635f..91e7b9b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java @@ -184,7 +184,7 @@ private Path handleOldPackAndGetOutputPackPath(boolean wasUpdated, @Nullable Pat } catch (IOException e) { LOGGER.error("Failed to delete old pack!", new GithubResourcepackManagerException("Failed to delete old pack '%s'!", e, oldPackPath)); } - return OUTPUT_FOLDER.resolve(newPackName); + return RESOURCEPACK_OUTPUT_FOLDER.resolve(newPackName); } private String generateRandomPackName(@Nullable String oldPackNameString) { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java index 52bfd94..51f0f7d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java @@ -60,6 +60,5 @@ public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest requ LOGGER.debug("Tracked branch has been updated, updating local pack..."); GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK); - LOGGER.debug("Local pack has been updated."); } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java index bb728b0..833666e 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java @@ -34,7 +34,7 @@ default void updatePackProperties(PackHandler packHandler) throws GithubResource LOGGER.info("New resource pack url: '%s'", resourcePackUrl); LOGGER.info("New resource pack sha1: '%s'", resourcePackSha1); setProperties(Map.of( - "resource-pack-id", PACK_UUID.toString(), + "resource-pack-id", RESOURCEPACK_UUID.toString(), "resource-pack", resourcePackUrl, "resource-pack-sha1", resourcePackSha1 )); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java index 67a731b..3f8d63b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java @@ -6,7 +6,7 @@ import java.util.Map; import java.util.regex.Matcher; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.PACK_NAME_PATTERN; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public final class StringUtils { @@ -48,7 +48,7 @@ public static String replacePlaceholders(String string, Map plac public static int extractPriorityFromFile(File file) { final String filename = file.getName(); - final Matcher matcher = PACK_NAME_PATTERN.matcher(filename); + final Matcher matcher = RESOURCEPACK_NAME_PATTERN.matcher(filename); if (!matcher.find()) { LOGGER.error("File '%s' doesn't start with priority!", file); @@ -61,7 +61,7 @@ public static int extractPriorityFromFile(File file) { public static String nameWithoutPriorityString(File file) throws GithubResourcepackManagerException { final String filename = file.getName(); - final Matcher matcher = PACK_NAME_PATTERN.matcher(filename); + final Matcher matcher = RESOURCEPACK_NAME_PATTERN.matcher(filename); if (!matcher.find()) throw new GithubResourcepackManagerException("File '%s' doesn't start with priority!", file); From da9ab1bb4dc807e3c522fb1840feb572048ab6fe Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 14 Jun 2025 19:58:51 +0300 Subject: [PATCH 04/89] Add method for getting diff between a commit hash and the head. Will be used for detecting changes to resource and data packs independently --- .../handler/GitHandler.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index d62d79c..d9e8607 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -5,6 +5,8 @@ import org.eclipse.jgit.api.PullResult; import org.eclipse.jgit.api.errors.GitAPIException; import org.eclipse.jgit.errors.RepositoryNotFoundException; +import org.eclipse.jgit.lib.ObjectId; +import org.eclipse.jgit.lib.ObjectReader; import org.eclipse.jgit.lib.Ref; import org.eclipse.jgit.lib.Repository; import org.eclipse.jgit.merge.ContentMergeStrategy; @@ -13,10 +15,12 @@ import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; +import org.eclipse.jgit.treewalk.CanonicalTreeParser; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.git.CommitProperties; import java.io.IOException; +import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; @@ -142,6 +146,37 @@ private static Ref getLatestCommit() throws GithubResourcepackManagerException { } } + private static List getDiff(String startingHash) throws GithubResourcepackManagerException { + try (Git git = Git.open(GIT_FOLDER.toFile())) { + final Repository repository = git.getRepository(); + + final ObjectId headCommit = repository.resolve("HEAD^{tree}"); + final ObjectId startingCommit = repository.resolve("%s^{tree}".formatted(startingHash)); + + try (final ObjectReader repoReader = repository.newObjectReader()) { + final CanonicalTreeParser headTreeParser = new CanonicalTreeParser(); + headTreeParser.reset(repoReader, headCommit); + + final CanonicalTreeParser startingTreeParser = new CanonicalTreeParser(); + startingTreeParser.reset(repoReader, startingCommit); + + return git + .diff() + .setNewTree(headTreeParser) + .setOldTree(startingTreeParser) + .call() + + .stream() + .map(entry -> "/dev/null".equals(entry.getNewPath()) ? entry.getOldPath() : entry.getNewPath()) + .toList(); + } catch (GitAPIException e) { + throw new RuntimeException(e); + } + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to open repository!", e); + } + } + private static Repository getRepository() throws GithubResourcepackManagerException { try (Git git = Git.open(GIT_FOLDER.toFile())) { return git.getRepository(); From e450e669166ed2f9045f6fc54c41a8176ec053e8 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 14 Jun 2025 21:38:40 +0300 Subject: [PATCH 05/89] Refactor resourcepack handling --- .../GithubResourcepackManager.java | 81 +++++++++---------- .../config/ConfigManager.java | 17 ++++ .../config/ModConfig.java | 54 ++++++++++--- .../discord/basic/BasicFailMessage.java | 15 ++++ .../BasicSuccessMessage.java} | 6 +- .../discord/embed/EmbedFailMessage.java | 22 +++++ .../EmbedSuccessMessage.java} | 8 +- .../handler/GitHandler.java | 12 +-- ...kHandler.java => ResourcePackHandler.java} | 2 +- .../networking/FileHttpHandler.java | 4 +- .../platform/PlatformServerProperties.java | 4 +- .../utils/WebhookSender.java | 14 ++-- 12 files changed, 162 insertions(+), 77 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java rename common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/{BasicMessage.java => basic/BasicSuccessMessage.java} (81%) create mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java rename common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/{EmbedMessage.java => embed/EmbedSuccessMessage.java} (86%) rename common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/{PackHandler.java => ResourcePackHandler.java} (99%) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 18640e2..fdeefbc 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -4,14 +4,13 @@ import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; -import top.offsetmonkey538.githubresourcepackmanager.handler.PackHandler; +import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; import top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.githubresourcepackmanager.utils.*; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; import java.io.IOException; @@ -43,9 +42,7 @@ private GithubResourcepackManager() { public static ModConfig config; - public static GitHandler gitHandler; - public static PackHandler packHandler; - + public static ResourcePackHandler resourcePackHandler; public static void initialize() { PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); @@ -93,7 +90,7 @@ public static void updatePack(final UpdateType updateType) { } // Git stuff - gitHandler = new GitHandler(); + final GitHandler gitHandler = new GitHandler(); LOGGER.info("Updating git repository..."); boolean failed = false; @@ -105,35 +102,48 @@ public static void updatePack(final UpdateType updateType) { } if (!failed) LOGGER.info("Successfully updated git repository!"); + if (config.resourcePackProvider.enabled) { + LOGGER.info(""); + LOGGER.info("Updating resource pack..."); + updateResourcePack(gitHandler, updateType, failed); + LOGGER.info("Resource pack updated!"); + } + if (config.dataPackProvider.enabled) { + LOGGER.info(""); + LOGGER.info("Updating data pack..."); + // TODO: implement datapack stuff + LOGGER.info("Data pack updated!"); + } + } + private static void updateResourcePack(final GitHandler gitHandler, final UpdateType updateType, boolean updateFailed) { // Get the location of the old pack, if it exists. - final String oldResourcePackName = getOldPackName(); + final String oldResourcePackName = getOldResourcePackName(); final Path oldResourcePackPath = oldResourcePackName == null ? null : RESOURCEPACK_OUTPUT_FOLDER.resolve(oldResourcePackName); - // Check if pack was updated - final boolean wasUpdated = gitHandler.getWasUpdated() || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); + final boolean wasUpdated = gitHandler.getChangedFiles().stream().anyMatch(it -> it.startsWith(config.resourcePackProvider.getRootLocation())) || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); if (!wasUpdated) { LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); } // Generate pack - packHandler = new PackHandler(); + resourcePackHandler = new ResourcePackHandler(); LOGGER.info("Getting pack location..."); - failed = false; + boolean failed = false; try { - packHandler.generatePack(wasUpdated, oldResourcePackPath, oldResourcePackName); + resourcePackHandler.generatePack(wasUpdated, oldResourcePackPath, oldResourcePackName); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to generate pack!", e); - failed = true; + failed = updateFailed = true; } - if (!failed) LOGGER.info("Pack location is '%s'!", packHandler.getOutputPackPath()); + if (!failed) LOGGER.info("Pack location is '%s'!", resourcePackHandler.getOutputPackPath()); // Update server.properties file. try { - PlatformServerProperties.INSTANCE.updatePackProperties(packHandler); + PlatformServerProperties.INSTANCE.updatePackProperties(resourcePackHandler); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to update server.properties file!", e); } @@ -141,7 +151,7 @@ public static void updatePack(final UpdateType updateType) { // Generate placeholder map final Map placeholders = new HashMap<>(); if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); - placeholders.put("{downloadUrl}", config.getPackUrl(packHandler.getOutputPackName())); + placeholders.put("{downloadUrl}", config.getPackUrl(resourcePackHandler.getOutputPackName())); placeholders.put("{updateType}", updateType.name()); placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); LOGGER.info("Placeholders: %s", placeholders); @@ -153,33 +163,20 @@ public static void updatePack(final UpdateType updateType) { LOGGER.error("Failed to send update message in chat!", e); } - // Trigger webhook - try { - triggerWebhook(wasUpdated, placeholders, updateType); - } catch (GithubResourcepackManagerException e) { - LOGGER.error("Failed to trigger webhook!", e); - } - - - LOGGER.info("Resourcepack updated!"); - } - - private static void triggerWebhook(boolean wasUpdated, Map placeholders, UpdateType updateType) throws GithubResourcepackManagerException { - // todo: change logic to match enable/disable and fail/success webhooks - if (config.resourcePackProvider.successWebhook.url == null || config.resourcePackProvider.successWebhook.body == null) return; - if (config.resourcePackProvider.successWebhook.body.contains("discord") && !wasUpdated) { - LOGGER.info("Not sending discord webhook because pack was not updated."); + // Trigger webhooks + if (!wasUpdated) { + LOGGER.info("Not sending webhook because pack was not updated."); return; } - - try { - //noinspection DataFlowIssue: Only returns null when `config.webhookBody` is null, which we have already checked - String webhookBody = Files.readString(config.getWebhookBody()); - webhookBody = StringUtils.replacePlaceholders(webhookBody, placeholders, true); - - WebhookSender.send(webhookBody, config.getWebhookUrl(), updateType, gitHandler.getWasUpdated()); - } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.resourcePackProvider.successWebhook.body); + if (!updateFailed) try { + config.resourcePackProvider.successWebhook.trigger(true, placeholders, updateType); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to trigger success webhook!", e); + } + else try { + config.resourcePackProvider.failWebhook.trigger(false, placeholders, updateType); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to trigger fail webhook!", e); } } @@ -192,7 +189,7 @@ private static void sendUpdateMessage(boolean wasUpdated, final Map errors, final ModConfig.WebhookInfo webhook, final String webhookPath) { + if (!webhook.enabled) return; + + if (webhook.url == null) errors.add("Field '%s.url' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); + if (webhook.body == null) errors.add("Field '%s.body' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); + + final Path bodyPath = webhook.getBodyPath(); + if (bodyPath != null && !Files.exists(bodyPath)) errors.add("Field '%s.body' points to file '%s', which doesn't exist!".formatted(webhookPath, bodyPath.toAbsolutePath())); + } + private static ModConfig load() { final Jankson jankson = Jankson.builder().build(); final File configFile = CURRENT_CONFIG_FILE_PATH.toFile(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 7329ad9..93b19a0 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -4,17 +4,24 @@ import blue.endless.jankson.Jankson; import blue.endless.jankson.JsonGrammar; import blue.endless.jankson.api.Marshaller; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.BasicWebhook; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.BasicMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.EmbedMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicFailMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicSuccessMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedFailMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedSuccessMessage; +import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; +import top.offsetmonkey538.githubresourcepackmanager.utils.WebhookSender; import java.io.IOException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; @@ -68,6 +75,10 @@ public static class ResourcePackProvider { public WebhookInfo successWebhook = new WebhookInfo(); @Comment("Webhook to be sent when pack updating failed") public WebhookInfo failWebhook = new WebhookInfo(); + + public String getRootLocation() { + return rootLocation.startsWith("/") ? rootLocation.substring(1) : rootLocation; + } } public static class DataPackProvider { @@ -85,10 +96,13 @@ public static class DataPackProvider { public WebhookInfo successWebhook = new WebhookInfo(); @Comment("Webhook to be sent when pack updating failed") public WebhookInfo failWebhook = new WebhookInfo(); + + public String getRootLocation() { + return rootLocation.startsWith("/") ? rootLocation.substring(1) : rootLocation; + } } public static class WebhookInfo { - public WebhookInfo() { } @@ -105,6 +119,24 @@ public WebhookInfo(boolean enabled, String url, String body) { public String url = null; @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") public String body = null; + + public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GithubResourcepackManagerException { + if (!enabled) return; + + try { + //noinspection DataFlowIssue: Only returns null when `body` is null, which we have already checked + String webhookBody = Files.readString(getBodyPath()); + webhookBody = StringUtils.replacePlaceholders(webhookBody, placeholders, true); + + WebhookSender.send(webhookBody, config.getWebhookUrl(), updateType, updateSucceeded); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.resourcePackProvider.successWebhook.body); + } + } + + public @Nullable Path getBodyPath() { + return body == null ? null : CURRENT_CONFIG_FILE_PATH.getParent().resolve(body); + } } //@Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") @@ -203,7 +235,14 @@ protected List getDatafixers() { public void createDefaultWebhooks() { final Jankson jankson = new Jankson.Builder().build(); - final List webhookBodies = List.of(new BasicWebhook(), new BasicMessage(), new EmbedMessage()); + final List webhookBodies = List.of( + new BasicWebhook(), + + new BasicSuccessMessage(), + new BasicFailMessage(), + new EmbedSuccessMessage(), + new EmbedFailMessage() + ); for (DefaultWebhookBody webhook : webhookBodies) { final Path location = CURRENT_CONFIG_FILE_PATH.getParent().resolve(webhook.getName()); @@ -234,13 +273,8 @@ public URI getWebhookUrl() { return URI.create(resourcePackProvider.successWebhook.url); } - public Path getWebhookBody() { - if (resourcePackProvider.successWebhook.body == null) return null; - return CURRENT_CONFIG_FILE_PATH.getParent().resolve(resourcePackProvider.successWebhook.body); - } - public Path getResourcePackRoot() { - return GIT_FOLDER.resolve(config.resourcePackProvider.rootLocation.startsWith("/") ? config.resourcePackProvider.rootLocation.substring(1) : config.resourcePackProvider.rootLocation); + return GIT_FOLDER.resolve(config.resourcePackProvider.getRootLocation()); } public Path getPacksDir() { return getResourcePackRoot().resolve("packs"); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java new file mode 100644 index 0000000..a52ef58 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java @@ -0,0 +1,15 @@ +package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic; + +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; + +public final class BasicFailMessage implements DefaultWebhookBody { + + public final String username = "GitHub Resource Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final String content = "Pack update failed!"; + + @Override + public String getName() { + return "discord/basic/fail.json"; + } +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/BasicMessage.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java similarity index 81% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/BasicMessage.java rename to common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java index 640a4d4..6f29821 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/BasicMessage.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java @@ -1,8 +1,8 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord; +package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; -public final class BasicMessage implements DefaultWebhookBody { +public final class BasicSuccessMessage implements DefaultWebhookBody { public final String username = "GitHub Resource Pack Manager"; public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; @@ -10,6 +10,6 @@ public final class BasicMessage implements DefaultWebhookBody { @Override public String getName() { - return "discord/basic_message.json"; + return "discord/basic/success.json"; } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java new file mode 100644 index 0000000..11e7313 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java @@ -0,0 +1,22 @@ +package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed; + +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; + +public final class EmbedFailMessage implements DefaultWebhookBody { + + public final String username = "GitHub Resource Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final Embed[] embeds = new Embed[] { + new Embed( + "Pack update failed!", + 0xFF0000 + ) + }; + + public record Embed(String title, int color) {} + + @Override + public String getName() { + return "discord/embed/fail.json"; + } +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/EmbedMessage.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java similarity index 86% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/EmbedMessage.java rename to common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java index b5057d2..3af4d13 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/EmbedMessage.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java @@ -1,8 +1,8 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord; +package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed; import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; -public final class EmbedMessage implements DefaultWebhookBody { +public final class EmbedSuccessMessage implements DefaultWebhookBody { public final String username = "GitHub Resource Pack Manager"; public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; @@ -10,7 +10,7 @@ public final class EmbedMessage implements DefaultWebhookBody { new Embed( "New update for pack released!", "Download [here]({downloadUrl})!", - 16722304, + 0xFF2980, new Field[] { new Field( "Description", @@ -25,6 +25,6 @@ public record Field(String name, String value) {} @Override public String getName() { - return "discord/embed_message.json"; + return "discord/embed/success.json"; } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index d9e8607..6f55825 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager.handler; -import org.apache.commons.io.FileUtils; +import org.apache.commons.io.file.PathUtils; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.PullResult; import org.eclipse.jgit.api.errors.GitAPIException; @@ -28,7 +28,7 @@ public class GitHandler { private CommitProperties commitProperties; - private boolean wasUpdated; + private List changedFiles; public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcepackManagerException { String originalCommitHash; @@ -45,7 +45,7 @@ public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcep final String newCommitHash = getLatestCommitHash(); commitProperties = getLatestCommitProperties(originalCommitHash, newCommitHash); - wasUpdated = !newCommitHash.equals(originalCommitHash); + changedFiles = getDiff(originalCommitHash); } @@ -110,7 +110,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan LOGGER.info("Deleting git folder and trying again..."); try { - FileUtils.deleteDirectory(GIT_FOLDER.toFile()); + PathUtils.deleteDirectory(GIT_FOLDER); } catch (IOException e) { LOGGER.error("Failed to delete directory!", e); } @@ -189,7 +189,7 @@ public CommitProperties getCommitProperties() { return commitProperties; } - public boolean getWasUpdated() { - return wasUpdated; + public List getChangedFiles() { + return changedFiles; } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java similarity index 99% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java rename to common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index 91e7b9b..ac0eebb 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/PackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -20,7 +20,7 @@ import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; -public class PackHandler { +public class ResourcePackHandler { private Path outputPackPath; public void generatePack(boolean wasUpdated, Path oldPackPath, String oldPackName) throws GithubResourcepackManagerException { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java index 217b1a0..3ce42b4 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java @@ -10,14 +10,14 @@ import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE; import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.packHandler; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.resourcePackHandler; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public final class FileHttpHandler { private FileHttpHandler() {} public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { - final File fileToServe = packHandler.getOutputPackFile(); + final File fileToServe = resourcePackHandler.getOutputPackFile(); final long fileLength = fileToServe.length(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java index 833666e..98a82bd 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java @@ -2,7 +2,7 @@ import com.google.common.hash.Hashing; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.handler.PackHandler; +import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import java.io.IOException; import java.util.Map; @@ -19,7 +19,7 @@ public interface PlatformServerProperties { void setProperties(Map properties); void reload() throws GithubResourcepackManagerException; - default void updatePackProperties(PackHandler packHandler) throws GithubResourcepackManagerException { + default void updatePackProperties(ResourcePackHandler packHandler) throws GithubResourcepackManagerException { final String resourcePackUrl = config.getPackUrl(packHandler.getOutputPackName()); final String resourcePackSha1; try { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java index 9f88c8c..217655a 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java @@ -14,11 +14,11 @@ private WebhookSender() { } - public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean isUpdated) throws GithubResourcepackManagerException { + public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean updateSucceeded) throws GithubResourcepackManagerException { final HttpRequest request = HttpRequest.newBuilder(url) .header("Content-Type", "application/json") .header("X-Resource-Pack-Update-Type", updateType.name()) - .header("X-Resource-Pack-Is-Updated", String.valueOf(isUpdated)) + .header("X-Resource-Pack-Update-Succeeded", String.valueOf(updateSucceeded)) .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); @@ -31,11 +31,6 @@ public static void send(String body, URI url, GithubResourcepackManager.UpdateTy throw new GithubResourcepackManagerException("Failed to send http request!", e); } - final int statusCode = response.statusCode(); - if (!(statusCode >= 200 && statusCode < 300)) { - throw new GithubResourcepackManagerException("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); - } - // From JDK 21 the HttpClient class extends AutoCloseable, but as we want to support Minecraft versions // that use JDK 17, where HttpClient doesn't extend AutoCloseable, we need to check if it's // an instance of AutoCloseable before trying to close it. @@ -47,5 +42,10 @@ public static void send(String body, URI url, GithubResourcepackManager.UpdateTy throw new IllegalStateException(e); } } + + final int statusCode = response.statusCode(); + if (statusCode < 200 || statusCode >= 300) { + throw new GithubResourcepackManagerException("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); + } } } From 239eef867ce37112c29ba2cb831454ef0dc753e0 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:47:45 +0300 Subject: [PATCH 06/89] Fix crash when there's no previous commit. (Like a force update or fresh installation) Getting diff would fail --- .../GithubResourcepackManager.java | 7 ++++-- .../handler/GitHandler.java | 24 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index fdeefbc..1781107 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -122,7 +122,10 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update final Path oldResourcePackPath = oldResourcePackName == null ? null : RESOURCEPACK_OUTPUT_FOLDER.resolve(oldResourcePackName); // Check if pack was updated - final boolean wasUpdated = gitHandler.getChangedFiles().stream().anyMatch(it -> it.startsWith(config.resourcePackProvider.getRootLocation())) || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); + final boolean wasUpdated = + gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.resourcePackProvider.getRootLocation()))).orElse(true) + || oldResourcePackPath == null + || !oldResourcePackPath.toFile().exists(); if (!wasUpdated) { LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); } @@ -138,7 +141,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update LOGGER.error("Failed to generate pack!", e); failed = updateFailed = true; } - if (!failed) LOGGER.info("Pack location is '%s'!", resourcePackHandler.getOutputPackPath()); + if (!failed) LOGGER.info("Pack location is '%s'!", resourcePackHandler.getOutputPackPath().toAbsolutePath()); // Update server.properties file. diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index 6f55825..5dd0112 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -16,11 +16,13 @@ import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.CanonicalTreeParser; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.git.CommitProperties; import java.io.IOException; import java.util.List; +import java.util.Optional; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; @@ -28,7 +30,7 @@ public class GitHandler { private CommitProperties commitProperties; - private List changedFiles; + private @Nullable List changedFiles; public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcepackManagerException { String originalCommitHash; @@ -45,7 +47,14 @@ public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcep final String newCommitHash = getLatestCommitHash(); commitProperties = getLatestCommitProperties(originalCommitHash, newCommitHash); - changedFiles = getDiff(originalCommitHash); + + try { + changedFiles = getDiff(originalCommitHash); + } catch (Exception e) { + // Most likely to happen with a fresh install or a forced update so should be fine to just assume this + LOGGER.error("Failed to get diff between commit '%s' and '%s'! Assuming pack directories were updated anyway...", e, originalCommitHash, newCommitHash); + changedFiles = null; + } } @@ -146,12 +155,13 @@ private static Ref getLatestCommit() throws GithubResourcepackManagerException { } } - private static List getDiff(String startingHash) throws GithubResourcepackManagerException { + private static List getDiff(String startingHash) throws IOException, GitAPIException { try (Git git = Git.open(GIT_FOLDER.toFile())) { final Repository repository = git.getRepository(); final ObjectId headCommit = repository.resolve("HEAD^{tree}"); final ObjectId startingCommit = repository.resolve("%s^{tree}".formatted(startingHash)); + if (startingCommit == null) throw new IllegalArgumentException("Previous commit (hash '%s') doesn't exist!".formatted(startingHash)); try (final ObjectReader repoReader = repository.newObjectReader()) { final CanonicalTreeParser headTreeParser = new CanonicalTreeParser(); @@ -169,11 +179,9 @@ private static List getDiff(String startingHash) throws GithubResourcepa .stream() .map(entry -> "/dev/null".equals(entry.getNewPath()) ? entry.getOldPath() : entry.getNewPath()) .toList(); - } catch (GitAPIException e) { - throw new RuntimeException(e); } } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to open repository!", e); + throw new IOException("Failed to open repository!", e); } } @@ -189,7 +197,7 @@ public CommitProperties getCommitProperties() { return commitProperties; } - public List getChangedFiles() { - return changedFiles; + public Optional> getChangedFiles() { + return Optional.ofNullable(changedFiles); } } From 1d0ea71950706462c5ce81de3e316c5fb9b56fed Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 15 Jun 2025 12:51:09 +0300 Subject: [PATCH 07/89] Use resource pack root dir as 'packs' folder Makes more sense to have /resourcepack/0-pack.zip /resourcepack/1-pack.zip than /resourcepack/packs/0-pack.zip /resourcepack/packs/1-pack.zip --- .../config/ModConfig.java | 2 +- .../handler/ResourcePackHandler.java | 64 ++++++++++--------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 93b19a0..8718a3d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -276,7 +276,7 @@ public URI getWebhookUrl() { public Path getResourcePackRoot() { return GIT_FOLDER.resolve(config.resourcePackProvider.getRootLocation()); } - public Path getPacksDir() { + public Path getResourcePackPacksDir() { return getResourcePackRoot().resolve("packs"); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index ac0eebb..2304678 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -3,6 +3,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; import org.jetbrains.annotations.Nullable; +import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.utils.MyFileUtils; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; @@ -34,10 +35,10 @@ public void generatePack(boolean wasUpdated, Path oldPackPath, String oldPackNam } private void generateNewPack() throws GithubResourcepackManagerException { - final boolean isMultiPack; + final List sourcePacks; try { - isMultiPack = getPackType(); + sourcePacks = gatherSourcePacks(); } catch (GithubResourcepackManagerException e) { throw new GithubResourcepackManagerException("Failed to determine pack type!", e); } @@ -53,16 +54,15 @@ private void generateNewPack() throws GithubResourcepackManagerException { final File tempOutputDir = MyFileUtils.createDir(tmpDir.resolve("output").toFile()); // Extract packs into the temporary packs directory - final List sourcePacks; try { - sourcePacks = extractSourcePacks(isMultiPack, tempOutputDir); + extractSourcePacks(sourcePacks, tempOutputDir); } catch (GithubResourcepackManagerException e) { throw new GithubResourcepackManagerException("Failed to extract source packs!", e); } // Write file with source pack names try { - writeSourcePacksFile(isMultiPack, sourcePacks, tempOutputDir); + writeSourcePacksFile(sourcePacks, tempOutputDir); } catch (GithubResourcepackManagerException e) { throw new GithubResourcepackManagerException("Failed to write pack content file!", e); } @@ -82,8 +82,8 @@ private void generateNewPack() throws GithubResourcepackManagerException { } } - private void writeSourcePacksFile(boolean isMultiPack, List sourcePacks, File outputDir) throws GithubResourcepackManagerException { - if (!isMultiPack) return; + private void writeSourcePacksFile(List sourcePacks, File outputDir) throws GithubResourcepackManagerException { + if (sourcePacks.size() == 1) return; final Path sourcePacksFile = outputDir.toPath().resolve("content.txt"); MyFileUtils.createNewFile(sourcePacksFile.toFile()); @@ -101,13 +101,7 @@ private void writeSourcePacksFile(boolean isMultiPack, List sourcePacks, F } } - private List extractSourcePacks(boolean isMultiPack, File tempOutputDir) throws GithubResourcepackManagerException { - // Gather source packs - final List sourcePacks; - - if (!isMultiPack) sourcePacks = List.of(config.getResourcePackRoot().toFile()); - else sourcePacks = gatherSourcePacks(); - + private void extractSourcePacks(List sourcePacks, File tempOutputDir) throws GithubResourcepackManagerException { // Extract source packs for (File sourcePack : sourcePacks) { if (sourcePack.isDirectory()) { @@ -126,13 +120,11 @@ private List extractSourcePacks(boolean isMultiPack, File tempOutputDir) t LOGGER.error("'%s' is not a valid pack! Ignoring...", sourcePack); sourcePacks.remove(sourcePack); } - - return sourcePacks; } - private List gatherSourcePacks() throws GithubResourcepackManagerException { + private List gatherSourcePacksFrom(final Path packsDir) throws GithubResourcepackManagerException { // Gather resource packs - final File[] sourcePacksArray = config.getPacksDir().toFile().listFiles(); + final File[] sourcePacksArray = packsDir.toFile().listFiles(); if (sourcePacksArray == null) throw new GithubResourcepackManagerException("Repository contains empty 'packs' folder!"); // Return source packs sorted in correct order. @@ -142,35 +134,47 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException } /** - * Get the type of the pack. Either multi or single pack. + * Gather list of {@link File}s to construct the final pack from. + *

+ * If there's a {@code pack.mcmeta} file in the {@link ModConfig#getResourcePackRoot() resource pack root directory}, the root directory will be the only file. + *

+ *

+ * If there's a {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the packs directory will be returned. + *

+ *

+ * If there's neither a {@code pack.mcmeta} file or {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the pack root will be returned. + *

* - * @return true if type is multi pack, false if it's single pack. - * @throws GithubResourcepackManagerException when the type of the pack couldn't be determined. + * @return A list of {@link File}s to construct the final pack from. May include directories and .zip files. + * @throws GithubResourcepackManagerException when the source packs could not be determined. */ - private boolean getPackType() throws GithubResourcepackManagerException { - LOGGER.info("Checking for 'pack.mcmeta' in repository root..."); + private List gatherSourcePacks() throws GithubResourcepackManagerException { + LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); final boolean hasPackMcmeta = config.getResourcePackRoot().resolve("pack.mcmeta").toFile().exists(); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); - LOGGER.info("Checking for 'packs' directory in repository root..."); - final boolean hasPacksFolder = config.getPacksDir().toFile().exists() && config.getPacksDir().toFile().isDirectory(); + LOGGER.info("Checking for 'packs' directory in resource pack root..."); + Path packsDir = config.getResourcePackPacksDir(); + final boolean hasPacksFolder = Files.exists(packsDir) && Files.isDirectory(packsDir); LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in repository root '%s'!", config.getPacksDir().toAbsolutePath()); + throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.getResourcePackPacksDir().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { - throw new GithubResourcepackManagerException("Found neither 'pack.mcmeta' nor the 'packs' directory in repository root '%s'!", config.getPacksDir().toAbsolutePath()); + LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.getResourcePackPacksDir().toAbsolutePath()); + LOGGER.info("Assuming resource pack root '%s' as 'packs' directory.", config.getResourcePackPacksDir().toAbsolutePath()); + packsDir = config.getResourcePackRoot(); } if (hasPackMcmeta) { - LOGGER.info("Using repository root as resource pack."); - return false; + LOGGER.info("Using resource pack root as resource pack."); + return List.of(config.getResourcePackRoot().toFile()); } LOGGER.info("Using 'packs' directory for resource packs."); - return true; + return gatherSourcePacksFrom(packsDir); } From 95640aa6c1e40dd69c9d6b2b67fac84653a5c573 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 15 Jun 2025 14:34:23 +0300 Subject: [PATCH 08/89] Exclude hidden files from pack generation Using repository root as 'packs' dir would crash because '.git' isn't a valid pack lol --- .../handler/ResourcePackHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index 2304678..f927434 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -129,6 +129,12 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou // Return source packs sorted in correct order. return Stream.of(sourcePacksArray) + .filter(file -> { + final boolean hidden = file.getName().startsWith("."); + if (!hidden) return true; + LOGGER.warn("Excluding hidden file '%s'", file.getAbsolutePath()); + return false; + }) .sorted(Comparator.comparingInt(StringUtils::extractPriorityFromFile).reversed()) .toList(); } From ddd7619082fe0ad03f78648b7009c76481d35cbe Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 15 Jun 2025 14:36:21 +0300 Subject: [PATCH 09/89] Update gh workflows --- .github/workflows/build_artifacts.yml | 4 +++- .github/workflows/publish.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_artifacts.yml b/.github/workflows/build_artifacts.yml index 22007db..497f54c 100644 --- a/.github/workflows/build_artifacts.yml +++ b/.github/workflows/build_artifacts.yml @@ -20,7 +20,9 @@ jobs: distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 + with: + cache-read-only: false - name: Build with Gradle run: ./gradlew build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d7898d3..c75535a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 with: cache-read-only: false From deb6542bd8ec9861080866855e92f908ef7c35e2 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 15 Jun 2025 14:38:53 +0300 Subject: [PATCH 10/89] Cleanup --- .../GithubResourcepackManager.java | 2 +- .../config/ConfigManager.java | 1 - .../config/ModConfig.java | 21 ------------ .../platform/PlatformMain.java | 2 +- .../platform/fabric/FabricPlatformMain.java | 1 - .../platform/paper/PaperPlatformCommand.java | 34 ------------------- .../platform/paper/PaperPlatformMain.java | 33 ------------------ .../paper/PaperPlatformServerProperties.java | 17 ---------- 8 files changed, 2 insertions(+), 109 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 1781107..f374f41 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -42,7 +42,7 @@ private GithubResourcepackManager() { public static ModConfig config; - public static ResourcePackHandler resourcePackHandler; + public static ResourcePackHandler resourcePackHandler; public static void initialize() { PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java index 15dba31..3e6650b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java @@ -16,7 +16,6 @@ import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.List; -import java.util.stream.Stream; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 8718a3d..1b12dea 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -24,7 +24,6 @@ import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; import static top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager.CURRENT_CONFIG_FILE_PATH; import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; @@ -139,26 +138,6 @@ public void trigger(final boolean updateSucceeded, final Map pla } } - //@Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") - //public String packUpdateMessage = "Server resourcepack has been updated!\nPlease click {packUpdateCommand} to get the most up to date pack."; - //public String packUpdateMessageHoverMessage = "{longDescription}"; - //@Comment("The public ip of your server (\"123.45.67.89\" or \"play.coolserver.net\")") - //public String serverPublicIp = null; - //@Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") - //public String proxyPort = null; - //@Comment("Should be \"[YOUR BRANCH NAME HERE]\". Common names include \"master\" and \"main\"") - //public String branch = "master"; - //public String repoUrl = null; - //@Comment("Where the mod will search for resource packs in the cloned repository") - //public String resourcePackRoot = ""; - //public boolean isRepoPrivate = false; - //public String githubUsername = null; - //@Comment("PLEASE DON'T SHARE THIS WITH ANYONE EVER") - //public String githubToken = null; - //public String webhookUrl = null; - //public String webhookBody = null; - - protected String getName() { return MOD_ID + "/" + MOD_ID; } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index a3f80d6..07b9820 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -13,7 +13,7 @@ public interface PlatformMain { * Example: .minecraft/config/github-resourcepack-manager/ * Example: .minecraft/plugins/Github-Resourcepack-Manager/ * - * @return + * @return config directory for the mod */ Path getConfigDir(); diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 132aac0..f7f54a6 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -4,7 +4,6 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.server.MinecraftServer; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index 36b7082..ac2d89f 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -72,38 +72,4 @@ public void registerGithubRpManagerCommand() { ); }); } - - //@Override - //public void registerGithubRpManagerCommand() { - // CommandRegistrationCallback.EVENT.register(FabricPlatformCommand::register); - //} - - //public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { - // dispatcher.register(literal("gh-rp-manager") - // .requires(ServerCommandSource::isExecutedByPlayer) - // .then(literal("request-pack").executes( - // context -> { - // final ServerPlayerEntity player = context.getSource().getPlayerOrThrow(); - // final MinecraftServer.ServerResourcePackProperties resourcePackProperties = context.getSource().getServer().getResourcePackProperties().orElse(null); - // if (resourcePackProperties == null) { - // context.getSource().sendFeedback(() -> Text.literal("Failed to send pack update packet to client!"), true); - // return 0; - // } - - // player.networkHandler.send( - // new ResourcePackSendS2CPacket( - // resourcePackProperties.id(), - // resourcePackProperties.url(), - // resourcePackProperties.hash(), - // resourcePackProperties.isRequired(), - // Optional.ofNullable(resourcePackProperties.prompt()) - // ), - // null - // ); - - // return ControlFlowAware.Command.SINGLE_SUCCESS; - // }) - // ) - // ); - //} } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index c20d396..07068ae 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -25,37 +25,4 @@ public static void setPlugin(JavaPlugin plugin) { public static JavaPlugin getPlugin() { return plugin; } - - - //@Override - //public void onInitializeServer() { - // GithubResourcepackManager.initialize(); - - // ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer1 -> minecraftServer = minecraftServer1); - //} - - //public MinecraftServer getServer() { - // return minecraftServer; - //} - - - //@Override - //public Logger getLogger() { - // return LOGGER; - //} - - //@Override - //public Path getConfigDir() { - // return FabricLoader.getInstance().getConfigDir(); - //} - - //@Override - //public Path getGameDir() { - // return FabricLoader.getInstance().getGameDir(); - //} - - //@Override - //public void runOnServerStart(Runnable work) { - // ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer1 -> work.run()); - //} } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java index 45ef937..1021a6c 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java @@ -1,25 +1,17 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; -import joptsimple.OptionSet; import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; -import org.bukkit.packs.ResourcePack; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; import xyz.jpenilla.reflectionremapper.ReflectionRemapper; -import xyz.jpenilla.reflectionremapper.proxy.ReflectionProxyFactory; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldGetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.FieldSetter; -import xyz.jpenilla.reflectionremapper.proxy.annotation.Proxies; import java.lang.reflect.Field; import java.nio.file.Path; import java.util.Map; import java.util.Optional; -import java.util.Properties; public class PaperPlatformServerProperties implements PlatformServerProperties { @Override @@ -67,13 +59,4 @@ public void reload() throws GithubResourcepackManagerException { throw new GithubResourcepackManagerException("Failed to reload 'server.properties' file!", e); } } - - - //@Override - //public void reload() { - // final ServerPropertiesLoader propertiesLoader = ((MinecraftDedicatedServerAccessor) FabricPlatformMain.INSTANCE.getServer()).getPropertiesLoader(); - // final ServerPropertiesLoaderAccessor propertiesLoaderAccess = (ServerPropertiesLoaderAccessor) propertiesLoader; - - // propertiesLoaderAccess.setPropertiesHandler(ServerPropertiesHandler.load(propertiesLoaderAccess.getPath())); - //} } From 02af56a0e460d137d6d38d53a15ceae452f6c190 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:30:44 +0300 Subject: [PATCH 11/89] They.... they actually work? Implement datapack handling --- .../GithubResourcepackManager.java | 68 +++++- .../config/ModConfig.java | 21 +- .../handler/DataPackHandler.java | 209 ++++++++++++++++++ .../handler/ResourcePackHandler.java | 16 +- .../platform/PlatformServerProperties.java | 2 + .../platform/PlatformText.java | 3 +- .../utils/StringUtils.java | 15 +- .../platform/fabric/FabricPlatformMain.java | 3 + .../FabricPlatformServerProperties.java | 7 + .../platform/fabric/FabricPlatformText.java | 24 +- .../paper/PaperPlatformServerProperties.java | 6 + .../platform/paper/PaperPlatformText.java | 24 +- 12 files changed, 359 insertions(+), 39 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index f374f41..bee1ed4 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,8 +1,11 @@ package top.offsetmonkey538.githubresourcepackmanager; import org.apache.commons.io.FileUtils; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.githubresourcepackmanager.handler.DataPackHandler; import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; @@ -111,7 +114,7 @@ public static void updatePack(final UpdateType updateType) { if (config.dataPackProvider.enabled) { LOGGER.info(""); LOGGER.info("Updating data pack..."); - // TODO: implement datapack stuff + updateDataPack(gitHandler, updateType, failed); LOGGER.info("Data pack updated!"); } } @@ -126,9 +129,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.resourcePackProvider.getRootLocation()))).orElse(true) || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); - if (!wasUpdated) { - LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); - } + if (!wasUpdated) LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); // Generate pack resourcePackHandler = new ResourcePackHandler(); @@ -154,6 +155,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Generate placeholder map final Map placeholders = new HashMap<>(); if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); + placeholders.put("{packType}", "resource"); placeholders.put("{downloadUrl}", config.getPackUrl(resourcePackHandler.getOutputPackName())); placeholders.put("{updateType}", updateType.name()); placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); @@ -161,7 +163,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Send chat message try { - sendUpdateMessage(wasUpdated, placeholders); + sendUpdateMessage(config.resourcePackProvider.updateMessage, config.resourcePackProvider.updateMessageHoverMessage, wasUpdated, placeholders); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } @@ -183,13 +185,65 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update } } - private static void sendUpdateMessage(boolean wasUpdated, final Map placeholders) throws GithubResourcepackManagerException { + private static void updateDataPack(final GitHandler gitHandler, final UpdateType updateType, boolean updateFailed) { + // Check if pack was updated + final boolean wasUpdated = gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.dataPackProvider.getRootLocation()))).orElse(true); + if (!wasUpdated) { + LOGGER.info("Pack hasn't changed since last update. Datapack processing will be skipped."); + return; + } + + // Generate pack + final DataPackHandler dataPackHandler = new DataPackHandler(); + + LOGGER.info("Getting pack location..."); + try { + dataPackHandler.generatePack(); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to generate pack!", e); + updateFailed = true; + } + + + // Generate placeholder map + final Map placeholders = new HashMap<>(); + if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); + placeholders.put("{packType}", "data"); + placeholders.put("{updateType}", updateType.name()); + placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); + LOGGER.info("Placeholders: %s", placeholders); + + // Send chat message + try { + sendUpdateMessage(config.dataPackProvider.updateMessage, config.dataPackProvider.updateMessageHoverMessage, wasUpdated, placeholders, true); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to send update message in chat!", e); + } + + // Trigger webhooks + if (!updateFailed) try { + config.dataPackProvider.successWebhook.trigger(true, placeholders, updateType); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to trigger success webhook!", e); + } + else try { + config.dataPackProvider.failWebhook.trigger(false, placeholders, updateType); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to trigger fail webhook!", e); + } + } + + private static void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, boolean wasUpdated, final Map placeholders) throws GithubResourcepackManagerException { + sendUpdateMessage(updateMessage, updateHoverMessage, wasUpdated, placeholders, false); + } + + private static void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { if (!wasUpdated) { LOGGER.info("Not sending chat message because pack was not updated."); return; } - PlatformText.INSTANCE.sendUpdateMessage(placeholders); + PlatformText.INSTANCE.sendUpdateMessage(updateMessage, updateHoverMessage, placeholders, adminsOnly); } private static String getOldResourcePackName() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 1b12dea..645ad7f 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -78,6 +78,12 @@ public static class ResourcePackProvider { public String getRootLocation() { return rootLocation.startsWith("/") ? rootLocation.substring(1) : rootLocation; } + public Path getPackRoot() { + return GIT_FOLDER.resolve(getRootLocation()); + } + public Path getPackPacksDir() { + return getPackRoot().resolve("packs"); + } } public static class DataPackProvider { @@ -87,7 +93,7 @@ public static class DataPackProvider { public String rootLocation = "/datapacks"; @Comment("Message sent TO ADMINS in chat when pack has been updated. May be 'null' to disable.") - public String updateMessage = "Server datapacks has been updated!\nNew packs (if any) have been enabled automatically.\nPlease run '/reload' or restart the server to reload datapacks."; + public String updateMessage = "Server datapacks has been updated!\nNew packs (if any) have to be enabled with the '/datapack enable` command.\nPlease run '/reload' or restart the server to reload datapacks."; @Comment("Message shown when hovering over the 'updateMessage' text. May be 'null' to disable.") public String updateMessageHoverMessage = "{longDescription}"; @@ -99,6 +105,12 @@ public static class DataPackProvider { public String getRootLocation() { return rootLocation.startsWith("/") ? rootLocation.substring(1) : rootLocation; } + public Path getPackRoot() { + return GIT_FOLDER.resolve(getRootLocation()); + } + public Path getPackPacksDir() { + return getPackRoot().resolve("packs"); + } } public static class WebhookInfo { @@ -252,13 +264,6 @@ public URI getWebhookUrl() { return URI.create(resourcePackProvider.successWebhook.url); } - public Path getResourcePackRoot() { - return GIT_FOLDER.resolve(config.resourcePackProvider.getRootLocation()); - } - public Path getResourcePackPacksDir() { - return getResourcePackRoot().resolve("packs"); - } - public String getGithubRef() { return "refs/heads/" + repositoryInfo.branch; } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java new file mode 100644 index 0000000..4ec7adc --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -0,0 +1,209 @@ +package top.offsetmonkey538.githubresourcepackmanager.handler; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.apache.commons.io.file.PathUtils; +import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; +import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.githubresourcepackmanager.utils.MyFileUtils; +import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.stream.Stream; + +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; + +public class DataPackHandler { + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + + private static final Path STATE_FILE = DATAPACK_FOLDER.resolve("state.json"); + + public void generatePack() throws GithubResourcepackManagerException { + final Path datapacks = PlatformServerProperties.INSTANCE.getDatapacksDir(); + + + // Delete existing stuff + final State existingPacks; + try { + existingPacks = readStateFile(); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to read state file!", e); + } + + Arrays.stream(existingPacks.packs) + .map(datapacks::resolve) + .forEach(path -> { + if (Files.notExists(path)) { + LOGGER.warn("Not deleting pack at '%s' as it doesn't exist!", path.toAbsolutePath()); + return; + } + + try { + PathUtils.delete(path); + LOGGER.info("Deleted pack at '%s'!", path.toAbsolutePath()); + } catch (IOException e) { + LOGGER.error("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); + } + }); + + + // Get new packs + final List sourcePacks; + + try { + sourcePacks = gatherSourcePacks(); + } catch (GithubResourcepackManagerException e) { + throw new GithubResourcepackManagerException("Failed to gather source packs!", e); + } + + // Delete ones with same name from datapacks + for (final Path sourcePack : sourcePacks) { + final Path path = datapacks.resolve(sourcePack.getFileName()); + if (Files.notExists(path)) continue; + + LOGGER.info("Deleting pack at '%s' to replace it...", path.toAbsolutePath()); + try { + PathUtils.delete(path); + LOGGER.info("Deleted pack at '%s'!", path.toAbsolutePath()); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); + } + } + + // Finally copy over the new ones + for (final Path path : sourcePacks) { + try { + final Path destination = datapacks.resolve(path.getFileName()); + + if (Files.isDirectory(path)) PathUtils.copyDirectory(path, destination); + else Files.copy(path, destination); + + LOGGER.info("Copied pack from '%s' to '%s'.", path.toAbsolutePath(), destination.toAbsolutePath()); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to copy pack at '%s' to datapacks directory at '%s'!", e, path.toAbsolutePath(), datapacks.toAbsolutePath()); + } + } + + try { + writeStateFile(sourcePacks); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to write state file!", e); + } + } + + private void writeStateFile(List files) throws IOException { + Files.createDirectories(STATE_FILE.getParent()); + + final String json = GSON.toJson(new State(files.stream().map(Path::getFileName).map(Path::toString).toArray(String[]::new))); + + Files.writeString(STATE_FILE, json); + } + + private State readStateFile() throws IOException { + if (Files.notExists(STATE_FILE)) { + LOGGER.warn("State file '%s' not found! No datapacks will be deleted!"); + return new State(new String[]{}); + } + + return GSON.fromJson(Files.readString(STATE_FILE), State.class); + } + + private void copyPacksToDirectory(List sourcePacks, Path datapacksDir) throws GithubResourcepackManagerException { + for (Path sourcePack : sourcePacks) { + if (Files.isDirectory(sourcePack)) { + try { + PathUtils.copyDirectory(sourcePack, datapacksDir); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to copy pack '%s' into directory '%s'!", e, sourcePack, datapacksDir); + } + continue; + } + if (sourcePack.getFileName().endsWith(".zip")) { + try { + Files.copy(sourcePack, datapacksDir); + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to copy pack '%s' into directory '%s'!", e, sourcePack, datapacksDir); + } + continue; + } + + LOGGER.error("'%s' is not a valid pack! Ignoring...", sourcePack); + sourcePacks.remove(sourcePack); + } + } + + /** + * Gather list of {@link File}s to construct the final pack from. + *

+ * If there's a {@code pack.mcmeta} file in the {@link ModConfig#getResourcePackRoot() resource pack root directory}, the root directory will be the only file. + *

+ *

+ * If there's a {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the packs directory will be returned. + *

+ *

+ * If there's neither a {@code pack.mcmeta} file or {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the pack root will be returned. + *

+ * + * @return A list of {@link File}s to construct the final pack from. May include directories and .zip files. + * @throws GithubResourcepackManagerException when the source packs could not be determined. + */ + private List gatherSourcePacks() throws GithubResourcepackManagerException { + LOGGER.info("Checking for 'pack.mcmeta' in data pack root..."); + final boolean hasPackMcmeta = Files.exists(config.dataPackProvider.getPackRoot().resolve("pack.mcmeta")); + LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); + + LOGGER.info("Checking for 'packs' directory in data pack root..."); + Path packsDir = config.dataPackProvider.getPackPacksDir(); + final boolean hasPacksFolder = Files.exists(packsDir) && Files.isDirectory(packsDir); + LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); + + if (hasPackMcmeta && hasPacksFolder) { + throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.dataPackProvider.getPackRoot().toAbsolutePath()); + } + if (!hasPackMcmeta && !hasPacksFolder) { + LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in data pack root '%s'!", config.dataPackProvider.getPackPacksDir().toAbsolutePath()); + LOGGER.info("Assuming data pack root '%s' as 'packs' directory.", config.dataPackProvider.getPackPacksDir().toAbsolutePath()); + packsDir = config.dataPackProvider.getPackRoot(); + } + + + if (hasPackMcmeta) { + LOGGER.info("Using data pack root as data pack."); + return List.of(config.dataPackProvider.getPackRoot()); + } + + LOGGER.info("Using 'packs' directory for data packs."); + return gatherSourcePacksFrom(packsDir); + } + + private List gatherSourcePacksFrom(final Path packsDir) throws GithubResourcepackManagerException { + try (final Stream sourcePacks = Files.list(packsDir)) { + final List result = sourcePacks + .filter(path -> { + final boolean hidden = path.getFileName().startsWith("."); + if (!hidden) return true; + LOGGER.warn("Excluding hidden file '%s'", path.toAbsolutePath()); + return false; + }) + .toList(); + + if (result.isEmpty()) + throw new GithubResourcepackManagerException("Repository contains empty 'packs' folder!"); + + return result; + } catch (IOException e) { + throw new GithubResourcepackManagerException("Failed to list files in 'packs' folder'!", e); + } + } + + + private record State(String[] packs) { + + } +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index f927434..3ce9137 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -40,7 +40,7 @@ private void generateNewPack() throws GithubResourcepackManagerException { try { sourcePacks = gatherSourcePacks(); } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to determine pack type!", e); + throw new GithubResourcepackManagerException("Failed to gather source packs!", e); } @@ -156,27 +156,27 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou */ private List gatherSourcePacks() throws GithubResourcepackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); - final boolean hasPackMcmeta = config.getResourcePackRoot().resolve("pack.mcmeta").toFile().exists(); + final boolean hasPackMcmeta = config.resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); LOGGER.info("Checking for 'packs' directory in resource pack root..."); - Path packsDir = config.getResourcePackPacksDir(); + Path packsDir = config.resourcePackProvider.getPackPacksDir(); final boolean hasPacksFolder = Files.exists(packsDir) && Files.isDirectory(packsDir); LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.getResourcePackPacksDir().toAbsolutePath()); + throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { - LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.getResourcePackPacksDir().toAbsolutePath()); - LOGGER.info("Assuming resource pack root '%s' as 'packs' directory.", config.getResourcePackPacksDir().toAbsolutePath()); - packsDir = config.getResourcePackRoot(); + LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); + LOGGER.info("Assuming resource pack root '%s' as 'packs' directory.", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); + packsDir = config.resourcePackProvider.getPackRoot(); } if (hasPackMcmeta) { LOGGER.info("Using resource pack root as resource pack."); - return List.of(config.getResourcePackRoot().toFile()); + return List.of(config.resourcePackProvider.getPackRoot().toFile()); } LOGGER.info("Using 'packs' directory for resource packs."); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java index 98a82bd..c683a76 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java @@ -5,6 +5,7 @@ import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import java.io.IOException; +import java.nio.file.Path; import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; @@ -16,6 +17,7 @@ public interface PlatformServerProperties { String getResourcePackUrl(); String getServerPort(); + Path getDatapacksDir(); void setProperties(Map properties); void reload() throws GithubResourcepackManagerException; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java index 3a7341c..4757534 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java @@ -1,5 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import java.util.Map; @@ -9,5 +10,5 @@ public interface PlatformText { PlatformText INSTANCE = load(PlatformText.class); - void sendUpdateMessage(Map placeholders) throws GithubResourcepackManagerException; + void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException; } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java index 3f8d63b..cf811a3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java @@ -46,12 +46,25 @@ public static String replacePlaceholders(String string, Map plac } public static int extractPriorityFromFile(File file) { + final int result = extractPriorityFromFileInternal(file); + if (result != -1) return result; + LOGGER.error("File '%s' doesn't start with priority!", file); + return -1; + } + + public static int extractPriorityFromFileLenient(File file) { + final int result = extractPriorityFromFileInternal(file); + if (result != -1) return result; + LOGGER.warn("File '%s' doesn't start with priority!", file); + return 0; + } + + private static int extractPriorityFromFileInternal(File file) { final String filename = file.getName(); final Matcher matcher = RESOURCEPACK_NAME_PATTERN.matcher(filename); if (!matcher.find()) { - LOGGER.error("File '%s' doesn't start with priority!", file); return -1; } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index f7f54a6..7f9c7a0 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -3,9 +3,12 @@ import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.resource.ResourcePackManager; +import net.minecraft.resource.ResourcePackProfile; import net.minecraft.server.MinecraftServer; import org.slf4j.LoggerFactory; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import java.nio.file.Path; diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java index b0885bf..f4b816f 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java @@ -3,12 +3,14 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.ServerPropertiesHandler; import net.minecraft.server.dedicated.ServerPropertiesLoader; +import net.minecraft.util.WorldSavePath; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.mixin.AbstractPropertiesHandlerAccessor; import top.offsetmonkey538.githubresourcepackmanager.mixin.MinecraftDedicatedServerAccessor; import top.offsetmonkey538.githubresourcepackmanager.mixin.ServerPropertiesLoaderAccessor; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; +import java.nio.file.Path; import java.util.Map; import java.util.Optional; import java.util.Properties; @@ -27,6 +29,11 @@ public String getServerPort() { return String.valueOf(FabricPlatformMain.getServer().getServerPort()); } + @Override + public Path getDatapacksDir() { + return FabricPlatformMain.getServer().getSavePath(WorldSavePath.DATAPACKS); + } + @Override public void setProperties(Map properties) { final ServerPropertiesLoader propertiesLoader = ((MinecraftDedicatedServerAccessor) FabricPlatformMain.getServer()).getPropertiesLoader(); diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index e31d02e..4148723 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -1,31 +1,32 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; +import com.mojang.authlib.GameProfile; import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.monkeylib538.utils.TextUtils; +import java.io.IOException; import java.util.Map; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; - public class FabricPlatformText implements PlatformText { @Override - public void sendUpdateMessage(Map placeholders) throws GithubResourcepackManagerException { + public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); if (playerManager == null) return; - String message = config.resourcePackProvider.updateMessage; final String[] splitMessage = message.split("\n"); final HoverEvent hoverEvent; try { - hoverEvent = config.resourcePackProvider.updateMessageHoverMessage == null ? null : new HoverEvent( + hoverEvent = hoverMessage == null ? null : new HoverEvent( HoverEvent.Action.SHOW_TEXT, TextUtils.INSTANCE.getStyledText( - StringUtils.replacePlaceholders(config.resourcePackProvider.updateMessageHoverMessage, placeholders).replace("\\n", "\n") + StringUtils.replacePlaceholders(hoverMessage, placeholders).replace("\\n", "\n") ) ); } catch (Exception e) { @@ -65,7 +66,16 @@ public void sendUpdateMessage(Map placeholders) throws GithubRes throw new GithubResourcepackManagerException("Failed to style update message at line number '%s'!", e, lineNumber); } - playerManager.broadcast(currentLine, false); + + if (!adminsOnly) { + playerManager.broadcast(currentLine, false); + continue; + } + + for (final ServerPlayerEntity player : playerManager.getPlayerList()) { + if (!playerManager.isOperator(player.getGameProfile())) continue; + player.sendMessage(currentLine); + } } } } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java index 1021a6c..8a56c04 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java @@ -4,6 +4,7 @@ import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; +import net.minecraft.world.level.storage.LevelResource; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; import xyz.jpenilla.reflectionremapper.ReflectionRemapper; @@ -26,6 +27,11 @@ public String getServerPort() { return String.valueOf(MinecraftServer.getServer().getPort()); } + @Override + public Path getDatapacksDir() { + return MinecraftServer.getServer().getWorldPath(LevelResource.DATAPACK_DIR); + } + @Override public void setProperties(Map properties) { final DedicatedServerSettings settings = ((DedicatedServer) MinecraftServer.getServer()).settings; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index 4e270c6..623645b 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -3,6 +3,9 @@ import net.minecraft.ChatFormatting; import net.minecraft.network.chat.*; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.players.PlayerList; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; @@ -10,20 +13,17 @@ import java.util.List; import java.util.Map; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; - public class PaperPlatformText implements PlatformText { @Override - public void sendUpdateMessage(Map placeholders) throws GithubResourcepackManagerException { - String message = config.resourcePackProvider.updateMessage; + public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { final String[] splitMessage = message.split("\n"); final HoverEvent hoverEvent; try { - hoverEvent = config.resourcePackProvider.updateMessageHoverMessage == null ? null : new HoverEvent( + hoverEvent = hoverMessage == null ? null : new HoverEvent( HoverEvent.Action.SHOW_TEXT, getStyledText( - StringUtils.replacePlaceholders(config.resourcePackProvider.updateMessageHoverMessage, placeholders).replace("\\n", "\n") + StringUtils.replacePlaceholders(hoverMessage, placeholders).replace("\\n", "\n") ) ); } catch (Exception e) { @@ -63,7 +63,17 @@ public void sendUpdateMessage(Map placeholders) throws GithubRes throw new GithubResourcepackManagerException("Failed to style update message at line number '%s'!", e, lineNumber); } - MinecraftServer.getServer().getPlayerList().broadcastSystemMessage(currentLine, false); + + final PlayerList players = MinecraftServer.getServer().getPlayerList(); + if (!adminsOnly) { + players.broadcastSystemMessage(currentLine, false); + continue; + } + + for (final ServerPlayer player : players.players) { + if (!players.isOp(player.getGameProfile())) continue; + player.sendSystemMessage(currentLine); + } } } From e2715f23ad92cab3ffe03529736bfd471eaeaca8 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:31:28 +0300 Subject: [PATCH 12/89] Cleanup --- .../GithubResourcepackManager.java | 1 - .../githubresourcepackmanager/handler/DataPackHandler.java | 2 -- .../githubresourcepackmanager/utils/StringUtils.java | 7 ------- .../platform/fabric/FabricPlatformMain.java | 3 --- .../platform/fabric/FabricPlatformText.java | 2 -- 5 files changed, 15 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index bee1ed4..a6f9563 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,7 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager; import org.apache.commons.io.FileUtils; -import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java index 4ec7adc..3a1b62e 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -6,8 +6,6 @@ import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import top.offsetmonkey538.githubresourcepackmanager.utils.MyFileUtils; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java index cf811a3..fdbd903 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java @@ -52,13 +52,6 @@ public static int extractPriorityFromFile(File file) { return -1; } - public static int extractPriorityFromFileLenient(File file) { - final int result = extractPriorityFromFileInternal(file); - if (result != -1) return result; - LOGGER.warn("File '%s' doesn't start with priority!", file); - return 0; - } - private static int extractPriorityFromFileInternal(File file) { final String filename = file.getName(); diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 7f9c7a0..f7f54a6 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -3,12 +3,9 @@ import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.loader.api.FabricLoader; -import net.minecraft.resource.ResourcePackManager; -import net.minecraft.resource.ResourcePackProfile; import net.minecraft.server.MinecraftServer; import org.slf4j.LoggerFactory; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import java.nio.file.Path; diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index 4148723..e7e93e1 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -1,6 +1,5 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; -import com.mojang.authlib.GameProfile; import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; @@ -10,7 +9,6 @@ import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.monkeylib538.utils.TextUtils; -import java.io.IOException; import java.util.Map; public class FabricPlatformText implements PlatformText { From 3b4772b586735964c82bc36204e8ec1b6085fc78 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 16 Jun 2025 12:37:31 +0300 Subject: [PATCH 13/89] Automatically reload datapack list after datapack update --- .../GithubResourcepackManager.java | 3 +++ .../githubresourcepackmanager/platform/PlatformMain.java | 7 +++++++ .../platform/fabric/FabricPlatformMain.java | 7 +++++-- .../platform/paper/PaperPlatformMain.java | 6 ++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index a6f9563..4c82286 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -203,6 +203,9 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType updateFailed = true; } + // Refresh datapack list + PlatformMain.INSTANCE.refreshDatapacks(); + // Generate placeholder map final Map placeholders = new HashMap<>(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index 07b9820..deaf7d8 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -23,4 +23,11 @@ public interface PlatformMain { * @param work the stuff to run */ void runOnServerStart(Runnable work); + + /** + * Tell the server to refresh the list of available datapacks. + *

+ * This way the user won't have to run {@code /datapack list} before being able to enable them + */ + void refreshDatapacks(); } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index f7f54a6..bdd846d 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -13,8 +13,6 @@ import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { - public static final FabricPlatformMain INSTANCE = (FabricPlatformMain) PlatformMain.INSTANCE; - private static MinecraftServer minecraftServer; @Override @@ -40,4 +38,9 @@ public Path getConfigDir() { public void runOnServerStart(Runnable work) { ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer1 -> work.run()); } + + @Override + public void refreshDatapacks() { + getServer().getDataPackManager().scanPacks(); + } } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 07068ae..df65219 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -1,5 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +import net.minecraft.server.MinecraftServer; import org.bukkit.plugin.java.JavaPlugin; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; @@ -18,6 +19,11 @@ public void runOnServerStart(Runnable work) { work.run(); } + @Override + public void refreshDatapacks() { + MinecraftServer.getServer().getPackRepository().reload(); + } + public static void setPlugin(JavaPlugin plugin) { PaperPlatformMain.plugin = plugin; } From 389bf9de427d56a8c09be38aa1ea07b48e462e34 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 19 Jun 2025 23:19:35 +0300 Subject: [PATCH 14/89] Only request-pack command needs to be executed by player. Update triggering should be able to be done in console --- .../platform/fabric/FabricPlatformCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 3e58206..a6e46a6 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -27,8 +27,8 @@ public void registerGithubRpManagerCommand() { public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { dispatcher.register(literal("gh-rp-manager") - .requires(ServerCommandSource::isExecutedByPlayer) .then(literal("request-pack") + .requires(ServerCommandSource::isExecutedByPlayer) .executes( context -> { final ServerPlayerEntity player = context.getSource().getPlayerOrThrow(); From 004d441c79ce44225ddc67ac559f7da4321cb4b1 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 19 Jun 2025 23:34:57 +0300 Subject: [PATCH 15/89] Fix webhooks always sending using resource pack success url --- .../githubresourcepackmanager/config/ModConfig.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 645ad7f..33f3910 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -139,12 +139,17 @@ public void trigger(final boolean updateSucceeded, final Map pla String webhookBody = Files.readString(getBodyPath()); webhookBody = StringUtils.replacePlaceholders(webhookBody, placeholders, true); - WebhookSender.send(webhookBody, config.getWebhookUrl(), updateType, updateSucceeded); + WebhookSender.send(webhookBody, getWebhookUrl(), updateType, updateSucceeded); } catch (IOException e) { throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.resourcePackProvider.successWebhook.body); } } + public @Nullable URI getWebhookUrl() { + if (url == null) return null; + return URI.create(url); + } + public @Nullable Path getBodyPath() { return body == null ? null : CURRENT_CONFIG_FILE_PATH.getParent().resolve(body); } @@ -259,11 +264,6 @@ public String getPackUrl(String outputFileName) { ); } - public URI getWebhookUrl() { - if (resourcePackProvider.successWebhook.url == null) return null; - return URI.create(resourcePackProvider.successWebhook.url); - } - public String getGithubRef() { return "refs/heads/" + repositoryInfo.branch; } From 205c2bf3511a49c1365d8453bceb5e9505fb3b08 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Fri, 4 Jul 2025 17:42:44 +0300 Subject: [PATCH 16/89] Fix crash on older minecraft versions --- .../platform/fabric/FabricPlatformText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index e7e93e1..9631a18 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -72,7 +72,7 @@ public void sendUpdateMessage(final String message, @Nullable final String hover for (final ServerPlayerEntity player : playerManager.getPlayerList()) { if (!playerManager.isOperator(player.getGameProfile())) continue; - player.sendMessage(currentLine); + player.sendMessageToClient(currentLine, false); } } } From 1b40c65e417acf512db50080a989e432d2cc6b14 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 10 Jul 2025 00:10:32 +0300 Subject: [PATCH 17/89] Allow specifying protocol for public ip Should work for when the http server is behind a proxy that handles ssl? ill test it rn --- .../githubresourcepackmanager/config/ModConfig.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 33f3910..5753ead 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -37,10 +37,11 @@ public class ModConfig { public static class ServerInfo { - @Comment("The public ip of your server (\"123.45.67.89\" or \"play.coolserver.net\")") + @SuppressWarnings("HttpUrlsUsage") + @Comment("The public ip of your server, may also specify the protocol (\"123.45.67.89\" or \"http://play.coolserver.net\")") public String publicIp = null; - @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") + @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. The HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") public String proxyPort = null; } @@ -254,9 +255,11 @@ public void createDefaultWebhooks() { } } + @SuppressWarnings("HttpUrlsUsage") public String getPackUrl(String outputFileName) { return String.format( - "http://%s:%s/%s/%s", + "%s%s:%s/%s/%s", + (serverInfo.publicIp.startsWith("http://") || serverInfo.publicIp.startsWith("https://") ? "" : "http://"), serverInfo.publicIp, serverInfo.proxyPort == null ? PlatformServerProperties.INSTANCE.getServerPort() : serverInfo.proxyPort, MOD_URI, From e69ce9c747f1c4eb6ca456b5f73a9b454321b7ff Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:35:42 +0300 Subject: [PATCH 18/89] Cleanup --- .../GithubResourcepackManager.java | 7 ++----- .../handler/DataPackHandler.java | 17 ----------------- .../handler/ResourcePackHandler.java | 16 ---------------- .../platform/PlatformLogging.java | 2 -- .../platform/fabric/FabricPlatformCommand.java | 1 - .../platform/paper/PaperPlatformLogging.java | 2 -- 6 files changed, 2 insertions(+), 43 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index c155133..3fd4800 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -10,9 +10,6 @@ import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; import top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; import java.io.IOException; @@ -214,12 +211,12 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); placeholders.put("{packType}", "data"); placeholders.put("{updateType}", updateType.name()); - placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); + placeholders.put("{wasUpdated}", String.valueOf(true)); LOGGER.info("Placeholders: %s", placeholders); // Send chat message try { - sendUpdateMessage(config.dataPackProvider.updateMessage, config.dataPackProvider.updateMessageHoverMessage, wasUpdated, placeholders, true); + sendUpdateMessage(config.dataPackProvider.updateMessage, config.dataPackProvider.updateMessageHoverMessage, true, placeholders, true); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java index 3a1b62e..344aa2f 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -3,11 +3,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.file.PathUtils; -import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -136,21 +134,6 @@ private void copyPacksToDirectory(List sourcePacks, Path datapacksDir) thr } } - /** - * Gather list of {@link File}s to construct the final pack from. - *

- * If there's a {@code pack.mcmeta} file in the {@link ModConfig#getResourcePackRoot() resource pack root directory}, the root directory will be the only file. - *

- *

- * If there's a {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the packs directory will be returned. - *

- *

- * If there's neither a {@code pack.mcmeta} file or {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the pack root will be returned. - *

- * - * @return A list of {@link File}s to construct the final pack from. May include directories and .zip files. - * @throws GithubResourcepackManagerException when the source packs could not be determined. - */ private List gatherSourcePacks() throws GithubResourcepackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in data pack root..."); final boolean hasPackMcmeta = Files.exists(config.dataPackProvider.getPackRoot().resolve("pack.mcmeta")); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index 3ce9137..49052c3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -3,7 +3,6 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.utils.MyFileUtils; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; @@ -139,21 +138,6 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou .toList(); } - /** - * Gather list of {@link File}s to construct the final pack from. - *

- * If there's a {@code pack.mcmeta} file in the {@link ModConfig#getResourcePackRoot() resource pack root directory}, the root directory will be the only file. - *

- *

- * If there's a {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the packs directory will be returned. - *

- *

- * If there's neither a {@code pack.mcmeta} file or {@link ModConfig#getResourcePackPacksDir() packs directory} in the pack root, all files directly in the pack root will be returned. - *

- * - * @return A list of {@link File}s to construct the final pack from. May include directories and .zip files. - * @throws GithubResourcepackManagerException when the source packs could not be determined. - */ private List gatherSourcePacks() throws GithubResourcepackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); final boolean hasPackMcmeta = config.resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java index 8a84d63..c92931e 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java @@ -2,8 +2,6 @@ import org.jetbrains.annotations.Nullable; -import java.util.function.BiConsumer; - import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformLogging { diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index b991932..8fb9622 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -14,7 +14,6 @@ import net.minecraft.text.MutableText; import net.minecraft.text.Style; import net.minecraft.text.Text; -import net.minecraft.util.Colors; import net.minecraft.util.Formatting; import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java index 737d7b1..82bba96 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java @@ -1,13 +1,11 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; -import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.function.BiConsumer; import java.util.logging.Level; import java.util.logging.Logger; From c469ddea7162ef4375af92bd3d7a3136409f4595 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:01:49 +0300 Subject: [PATCH 19/89] Really? I just... delete a bunch of code and all of a sudden the mod becomes better? Support literally every git host that can send webhooks --- .../networking/WebhookHttpHandler.java | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java index 51f0f7d..7a754fd 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java @@ -1,64 +1,17 @@ package top.offsetmonkey538.githubresourcepackmanager.networking; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonObject; import io.netty.channel.*; import io.netty.handler.codec.http.*; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.meshlib.api.HttpHandler; - -import java.nio.charset.StandardCharsets; import static io.netty.handler.codec.http.HttpResponseStatus.*; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; public final class WebhookHttpHandler { private WebhookHttpHandler() {} - private static final Gson GSON = new GsonBuilder().create(); - public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { - if (!"application/json".contentEquals(HttpUtil.getMimeType(request))) { - LOGGER.warn(String.format("Bad request: POST request made with incorrect mime type '%s', expected 'application/json'", HttpUtil.getMimeType(request))); - HttpHandler.sendError(ctx, BAD_REQUEST); - return; - } - - - // Get the event header - final String githubEvent = request.headers().get("x-github-event"); - - if (githubEvent == null || githubEvent.isBlank()) { - HttpHandler.sendError(ctx, BAD_REQUEST, "Request headers don't contain 'x-github-event'"); - return; - } - - if (!githubEvent.contains("push")) { - HttpHandler.sendError(ctx, BAD_REQUEST, "Request isn't for push event"); - return; - } - LOGGER.debug("Received github push event"); - - // Get payload - final JsonObject payload = GSON.fromJson(request.content().toString(StandardCharsets.UTF_8), JsonObject.class); - if (payload == null) { - HttpHandler.sendError(ctx, BAD_REQUEST, "Request doesn't contain content"); - return; - } - - // Respond with "yeh bro everythins alright" ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, OK)).addListener(ChannelFutureListener.CLOSE); - - // Check which branch was pushed to - final String ref = payload.get("ref").getAsString(); - LOGGER.debug("Ref: %s", ref); - - if (!config.getGithubRef().equals(ref)) return; - - LOGGER.debug("Tracked branch has been updated, updating local pack..."); GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK); } } From 26141e13dbbcc81c564b0345d58ec5b2d9810da4 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:22:31 +0300 Subject: [PATCH 20/89] Fix crash introduced with #16 --- .../GithubResourcepackManager.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 3fd4800..75c1466 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -44,8 +44,6 @@ private GithubResourcepackManager() { public static ResourcePackHandler resourcePackHandler; public static void initialize() { - PlatformMain.INSTANCE.registerLogToAdminListener(); - PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); ConfigManager.loadConfig(); @@ -58,7 +56,10 @@ public static void initialize() { HttpHandlerRegistry.INSTANCE.register(MOD_URI, new MainHttpHandler()); - PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART)); + PlatformMain.INSTANCE.runOnServerStart(() -> { + PlatformMain.INSTANCE.registerLogToAdminListener(); + updatePack(UpdateType.RESTART); + }); } private static void createFolderStructure() throws GithubResourcepackManagerException { From fd18edd3797c4abd41e4640a27b3ddd1a0d080e3 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 26 Jul 2025 17:33:01 +0300 Subject: [PATCH 21/89] Update to monkeylib538 v3 --- common/build.gradle | 12 +- common/gradle.properties | 5 +- .../GithubResourcepackManager.java | 35 ++-- .../config/ConfigHandler.java | 99 ++++++++++ .../config/ConfigManager.java | 176 ------------------ .../config/ModConfig.java | 75 ++++---- .../handler/DataPackHandler.java | 40 +--- .../handler/GitHandler.java | 12 +- .../handler/ResourcePackHandler.java | 16 +- .../networking/FileHttpHandler.java | 2 +- .../networking/MainHttpHandler.java | 4 +- .../platform/PlatformLogging.java | 50 ----- .../platform/PlatformServerProperties.java | 4 +- .../utils/StringUtils.java | 2 +- fabric/build.gradle | 11 +- fabric/gradle.properties | 2 - .../fabric/FabricPlatformCommand.java | 25 ++- .../fabric/FabricPlatformLogging.java | 70 ------- .../platform/fabric/FabricPlatformMain.java | 9 +- .../platform/fabric/FabricPlatformText.java | 89 ++++++++- gradle.properties | 4 +- paper/build.gradle | 9 + .../platform/paper/PaperPlatformCommand.java | 14 +- .../platform/paper/PaperPlatformLogging.java | 71 ------- .../platform/paper/PaperPlatformMain.java | 6 +- .../platform/paper/PaperPlugin.java | 1 - 26 files changed, 329 insertions(+), 514 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java delete mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java delete mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java delete mode 100644 fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java delete mode 100644 paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java diff --git a/common/build.gradle b/common/build.gradle index 91a5e77..86dea47 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -4,18 +4,28 @@ plugins { repositories { mavenCentral() + maven { + name = "Mojang Libraries" + url = "https://libraries.minecraft.net" + content { + includeGroup "com.mojang" + } + } maven { name = "OffsetMods538" url = "https://maven.offsetmonkey538.top/releases" content { includeGroup "top.offsetmonkey538.meshlib" + includeGroup "top.offsetmonkey538.offsetconfig538" + includeGroup "top.offsetmonkey538.monkeylib538" } } } dependencies { implementation "org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}" - implementation "blue.endless:jankson:${project.jankson_version}" + implementation "top.offsetmonkey538.offsetconfig538:offsetconfig538:${project.offsetconfig538_version}" + shadow implementation("top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}") shadow compileOnly("top.offsetmonkey538.meshlib:mesh-lib-api:${project.meshlib_version}") diff --git a/common/gradle.properties b/common/gradle.properties index 8f66902..e8e57e3 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -2,7 +2,8 @@ jgit_version = 6.9.0.202403050737-r guava_version = 33.4.0-jre commons_version = 2.18.0 gson_version = 2.11.0 -# Jankson, check at https://github.com/falkreon/Jankson -jankson_version = 1.2.3 + +## OffsetConfig538, check at https://github.com/OffsetMods538/OffsetConfig538 +offsetconfig538_version = 1.0.0-2f5cd46 nameSuffix = api \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 75c1466..2f8f0c0 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -3,14 +3,18 @@ import org.apache.commons.io.FileUtils; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; +import top.offsetmonkey538.githubresourcepackmanager.config.ConfigHandler; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.handler.DataPackHandler; import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; -import top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLoggerProvider; +import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; +import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; import java.io.IOException; import java.nio.file.Files; @@ -18,14 +22,13 @@ import java.util.*; import java.util.regex.Pattern; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; - public final class GithubResourcepackManager { private GithubResourcepackManager() { } public static final String MOD_ID = "github-resourcepack-manager"; + public static final PlatformLogger LOGGER = PlatformLoggerProvider.INSTANCE.createLogger(MOD_ID); public static final String MOD_URI = "gh-rp-manager"; public static final Path DATA_FOLDER = PlatformMain.INSTANCE.getConfigDir().resolve(".packs"); @@ -39,14 +42,14 @@ private GithubResourcepackManager() { public static final Pattern RESOURCEPACK_NAME_PATTERN = Pattern.compile("\\d+-"); public static final UUID RESOURCEPACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); - public static ModConfig config; + public static ConfigHolder config = ConfigManager.INSTANCE.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); public static ResourcePackHandler resourcePackHandler; public static void initialize() { PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); - ConfigManager.loadConfig(); + ConfigHandler.handleConfig(); try { createFolderStructure(); @@ -104,13 +107,13 @@ public static void updatePack(final UpdateType updateType) { } if (!failed) LOGGER.info("Successfully updated git repository!"); - if (config.resourcePackProvider.enabled) { + if (config.get().resourcePackProvider.enabled) { LOGGER.info(""); LOGGER.info("Updating resource pack..."); updateResourcePack(gitHandler, updateType, failed); LOGGER.info("Resource pack updated!"); } - if (config.dataPackProvider.enabled) { + if (config.get().dataPackProvider.enabled) { LOGGER.info(""); LOGGER.info("Updating data pack..."); updateDataPack(gitHandler, updateType, failed); @@ -125,7 +128,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Check if pack was updated final boolean wasUpdated = - gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.resourcePackProvider.getRootLocation()))).orElse(true) + gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.get().resourcePackProvider.getRootLocation()))).orElse(true) || oldResourcePackPath == null || !oldResourcePackPath.toFile().exists(); if (!wasUpdated) LOGGER.info("Pack hasn't changed since last update. Skipping new pack generation."); @@ -155,14 +158,14 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update final Map placeholders = new HashMap<>(); if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); placeholders.put("{packType}", "resource"); - placeholders.put("{downloadUrl}", config.getPackUrl(resourcePackHandler.getOutputPackName())); + placeholders.put("{downloadUrl}", config.get().getPackUrl(resourcePackHandler.getOutputPackName())); placeholders.put("{updateType}", updateType.name()); placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); LOGGER.info("Placeholders: %s", placeholders); // Send chat message try { - if (!failed) sendUpdateMessage(config.resourcePackProvider.updateMessage, config.resourcePackProvider.updateMessageHoverMessage, wasUpdated, placeholders); + if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, config.get().resourcePackProvider.updateMessageHoverMessage, wasUpdated, placeholders); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } @@ -173,12 +176,12 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update return; } if (!updateFailed) try { - config.resourcePackProvider.successWebhook.trigger(true, placeholders, updateType); + config.get().resourcePackProvider.successWebhook.trigger(true, placeholders, updateType); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { - config.resourcePackProvider.failWebhook.trigger(false, placeholders, updateType); + config.get().resourcePackProvider.failWebhook.trigger(false, placeholders, updateType); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to trigger fail webhook!", e); } @@ -186,7 +189,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update private static void updateDataPack(final GitHandler gitHandler, final UpdateType updateType, boolean updateFailed) { // Check if pack was updated - final boolean wasUpdated = gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.dataPackProvider.getRootLocation()))).orElse(true); + final boolean wasUpdated = gitHandler.getChangedFiles().map(changes -> changes.stream().anyMatch(it -> it.startsWith(config.get().dataPackProvider.getRootLocation()))).orElse(true); if (!wasUpdated) { LOGGER.info("Pack hasn't changed since last update. Datapack processing will be skipped."); return; @@ -217,19 +220,19 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType // Send chat message try { - sendUpdateMessage(config.dataPackProvider.updateMessage, config.dataPackProvider.updateMessageHoverMessage, true, placeholders, true); + sendUpdateMessage(config.get().dataPackProvider.updateMessage, config.get().dataPackProvider.updateMessageHoverMessage, true, placeholders, true); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } // Trigger webhooks if (!updateFailed) try { - config.dataPackProvider.successWebhook.trigger(true, placeholders, updateType); + config.get().dataPackProvider.successWebhook.trigger(true, placeholders, updateType); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { - config.dataPackProvider.failWebhook.trigger(false, placeholders, updateType); + config.get().dataPackProvider.failWebhook.trigger(false, placeholders, updateType); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to trigger fail webhook!", e); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java new file mode 100644 index 0000000..78bbea3 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java @@ -0,0 +1,99 @@ +package top.offsetmonkey538.githubresourcepackmanager.config; + +import blue.endless.jankson.*; +import org.jetbrains.annotations.NotNull; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.BasicWebhook; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicFailMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicSuccessMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedFailMessage; +import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedSuccessMessage; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; + +public final class ConfigHandler { + private ConfigHandler() { + + } + + public static void handleConfig() { + LOGGER.info("Writing default webhook bodies"); + createDefaultWebhooks(); + + // Checking if config is valid + final List errors = checkConfigErrors(); + + // Return when nothing's wrong + if (errors.isEmpty()) return; + + // There were errors, time to log em. + LOGGER.error("There were problems with the config for GitHub Resourcepack Manager, see below for more details!"); + errors.stream().map(string -> "\t" + string).forEach(LOGGER::error); + LOGGER.error("There were problems with the config for Github Resourcepack Manager, see above for more details!"); + + throw new RuntimeException("There were problems with the config for Github Resourcepack Manager, see above for more details!"); + } + + private static void createDefaultWebhooks() { + final Jankson jankson = new Jankson.Builder().build(); + final List webhookBodies = List.of( + new BasicWebhook(), + + new BasicSuccessMessage(), + new BasicFailMessage(), + new EmbedSuccessMessage(), + new EmbedFailMessage() + ); + + for (DefaultWebhookBody webhook : webhookBodies) { + final Path location = config.get().getFilePath().getParent().resolve(webhook.getName()); + + if (Files.exists(location)) continue; + + try { + Files.createDirectories(location.getParent()); + Files.writeString(location, jankson.toJson(webhook).toJson(JsonGrammar.STRICT)); + } catch (IOException e) { + LOGGER.error("Failed to write default webhook body '%s'!", webhook.getName(), e); + } + } + } + + private static @NotNull List checkConfigErrors() { + final List errors = new ArrayList<>(); + + if (config.get().serverInfo.publicIp == null) errors.add("Field 'serverInfo.publicIp' not set!"); + if (config.get().repositoryInfo.url == null) errors.add("Field 'repositoryInfo.url' not set!"); + if (config.get().repositoryInfo.isPrivate) { + if (config.get().repositoryInfo.username == null) errors.add("Field 'repositoryInfo.username' not set, but 'repositoryInfo.isPrivate' is true!"); + if (config.get().repositoryInfo.token == null) errors.add("Field 'repositoryInfo.token' not set, but 'repositoryInfo.isPrivate' is true!"); + } else { + if (config.get().repositoryInfo.username != null) errors.add("Field 'repositoryInfo.username' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); + if (config.get().repositoryInfo.token != null) errors.add("Field 'repositoryInfo.token' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); + } + + checkWebhookErrors(errors, config.get().resourcePackProvider.successWebhook, "resourcePackProvider.successWebhook"); + checkWebhookErrors(errors, config.get().resourcePackProvider.failWebhook, "resourcePackProvider.failWebhook"); + checkWebhookErrors(errors, config.get().dataPackProvider.successWebhook, "dataPackProvider.successWebhook"); + checkWebhookErrors(errors, config.get().dataPackProvider.failWebhook, "dataPackProvider.failWebhook"); + + return errors; + } + + private static void checkWebhookErrors(final List errors, final ModConfig.WebhookInfo webhook, final String webhookPath) { + if (!webhook.enabled) return; + + if (webhook.url == null) errors.add("Field '%s.url' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); + if (webhook.body == null) errors.add("Field '%s.body' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); + + final Path bodyPath = webhook.getBodyPath(); + if (bodyPath != null && !Files.exists(bodyPath)) errors.add("Field '%s.body' points to file '%s', which doesn't exist!".formatted(webhookPath, bodyPath.toAbsolutePath())); + } +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java deleted file mode 100644 index 3e6650b..0000000 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigManager.java +++ /dev/null @@ -1,176 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.config; - -import blue.endless.jankson.Jankson; -import blue.endless.jankson.JsonElement; -import blue.endless.jankson.JsonObject; -import blue.endless.jankson.JsonPrimitive; -import blue.endless.jankson.api.SyntaxError; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.ArrayList; -import java.util.List; - -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; - -public final class ConfigManager { - private ConfigManager() { - - } - - public static final String VERSION_KEY = "!!!version"; - - public static final Path OLD_CONFIG_FILE_PATH = PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"); - public static final Path NEW_CONFIG_FILE_PATH = PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json"); - public static final Path CURRENT_CONFIG_FILE_PATH = PlatformMain.INSTANCE.getConfigDir().resolve("config").resolve("main.json"); - - - public static void loadConfig() { - if (Files.exists(OLD_CONFIG_FILE_PATH)) { - try { - Files.createDirectories(NEW_CONFIG_FILE_PATH.getParent()); - Files.move(OLD_CONFIG_FILE_PATH, NEW_CONFIG_FILE_PATH); - } catch (IOException e) { - throw new RuntimeException("Failed to move config file to new location!", e); - } - } - if (Files.exists(NEW_CONFIG_FILE_PATH)) { - try { - Files.createDirectories(CURRENT_CONFIG_FILE_PATH.getParent()); - Files.move(NEW_CONFIG_FILE_PATH, CURRENT_CONFIG_FILE_PATH); - } catch (IOException e) { - throw new RuntimeException("Failed to move config file to new location!", e); - } - } - - config = new ModConfig(); - if (CURRENT_CONFIG_FILE_PATH.toFile().exists()) config = load(); - save(config); - - LOGGER.info("Writing default webhook bodies"); - config.createDefaultWebhooks(); - - // Checking if config is valid - final List errors = checkConfigErrors(); - - // Return when nothing's wrong - if (errors.isEmpty()) return; - - // There were errors, time to log em. - LOGGER.error("There were problems with the config for GitHub Resourcepack Manager, see below for more details!"); - errors.stream().map(string -> "\t" + string).forEach(LOGGER::error); - LOGGER.error("There were problems with the config for Github Resourcepack Manager, see above for more details!"); - - throw new RuntimeException("There were problems with the config for Github Resourcepack Manager, see above for more details!"); - } - - private static @NotNull List checkConfigErrors() { - final List errors = new ArrayList<>(); - - if (config.serverInfo.publicIp == null) errors.add("Field 'serverInfo.publicIp' not set!"); - if (config.repositoryInfo.url == null) errors.add("Field 'repositoryInfo.url' not set!"); - if (config.repositoryInfo.isPrivate) { - if (config.repositoryInfo.username == null) errors.add("Field 'repositoryInfo.username' not set, but 'repositoryInfo.isPrivate' is true!"); - if (config.repositoryInfo.token == null) errors.add("Field 'repositoryInfo.token' not set, but 'repositoryInfo.isPrivate' is true!"); - } else { - if (config.repositoryInfo.username != null) errors.add("Field 'repositoryInfo.username' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); - if (config.repositoryInfo.token != null) errors.add("Field 'repositoryInfo.token' set, but 'repositoryInfo.isPrivate' is false! Can be unset"); - } - - checkWebhookErrors(errors, config.resourcePackProvider.successWebhook, "resourcePackProvider.successWebhook"); - checkWebhookErrors(errors, config.resourcePackProvider.failWebhook, "resourcePackProvider.failWebhook"); - checkWebhookErrors(errors, config.dataPackProvider.successWebhook, "dataPackProvider.successWebhook"); - checkWebhookErrors(errors, config.dataPackProvider.failWebhook, "dataPackProvider.failWebhook"); - - return errors; - } - - private static void checkWebhookErrors(final List errors, final ModConfig.WebhookInfo webhook, final String webhookPath) { - if (!webhook.enabled) return; - - if (webhook.url == null) errors.add("Field '%s.url' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); - if (webhook.body == null) errors.add("Field '%s.body' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); - - final Path bodyPath = webhook.getBodyPath(); - if (bodyPath != null && !Files.exists(bodyPath)) errors.add("Field '%s.body' points to file '%s', which doesn't exist!".formatted(webhookPath, bodyPath.toAbsolutePath())); - } - - private static ModConfig load() { - final Jankson jankson = Jankson.builder().build(); - final File configFile = CURRENT_CONFIG_FILE_PATH.toFile(); - - // Load the config from disk - final JsonObject json; - try { - json = jankson.load(configFile); - } catch (IOException e) { - LOGGER.error("Config file '%s' could not be read!", CURRENT_CONFIG_FILE_PATH, e); - return config; - } catch (SyntaxError e) { - LOGGER.error("Config file '%s' is formatted incorrectly!", CURRENT_CONFIG_FILE_PATH, e); - return config; - } - - // Check if version matches the latest version - applyDatafixers(config, configFile.toPath(), json, jankson); - - // Load config class from the final json - return jankson.fromJson(json, config.getClass()); - } - - private static void applyDatafixers(ModConfig config, Path configFile, JsonObject json, Jankson jankson) { - int last_version = json.getInt(VERSION_KEY, 0); - int current_version = config.getConfigVersion(); - if (last_version < current_version) try { - final Path backupPath = configFile.resolveSibling(String.format("%s-%s-backup.json", configFile.getFileName(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy_MM_dd-HH_mm_ss")))); - Files.copy(configFile, backupPath); - - for (Datafixer datafixer : config.getDatafixers().subList(last_version, current_version)) { - datafixer.apply(json, jankson); - } - save(config); - } catch (IOException e) { - LOGGER.error("Unable to create backup of config file '%s'! Continuing anyway cause I don't care if your config gets messed up and I can't think of a reason for this even happening cause like the initial config file has to be there so I'd imagine that the directory is writeable so like why wouldn't it be possible to write the backup of the file?", configFile, e); - } - - if (last_version > current_version) { - throw new IllegalStateException(String.format("Config file '%s' is for a newer version of the mod, please update! Expected config version '%s', found '%s'!", CURRENT_CONFIG_FILE_PATH, current_version, last_version)); - } - } - - private static void save(ModConfig config) { - final Jankson jankson = Jankson.builder().build(); - - // Convert config to json - final JsonElement jsonAsElement = jankson.toJson(config); - if (!(jsonAsElement instanceof final JsonObject json)) { - LOGGER.error("Could not cast '%s' to 'JsonObject'! Config will not be saved!", jsonAsElement.getClass().getName()); - return; - } - - // Write config version - json.put(VERSION_KEY, new JsonPrimitive(config.getConfigVersion()), "!!!!! DO NOT MODIFY THIS VALUE !!!!"); - - // Convert final json to string - final String result = json.toJson(true, true); - - try { - Files.createDirectories(CURRENT_CONFIG_FILE_PATH.getParent()); - Files.writeString(CURRENT_CONFIG_FILE_PATH, result); - } catch (IOException e) { - LOGGER.error("Config file '%s' could not be written to!", CURRENT_CONFIG_FILE_PATH, e); - } - } - - @FunctionalInterface - public interface Datafixer { - void apply(JsonObject original, Jankson jankson); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 5753ead..7242aa3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -1,33 +1,26 @@ package top.offsetmonkey538.githubresourcepackmanager.config; import blue.endless.jankson.Comment; -import blue.endless.jankson.Jankson; -import blue.endless.jankson.JsonGrammar; import blue.endless.jankson.api.Marshaller; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.BasicWebhook; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicFailMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicSuccessMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedFailMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedSuccessMessage; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.githubresourcepackmanager.utils.WebhookSender; +import top.offsetmonkey538.offsetconfig538.api.config.Config; +import top.offsetmonkey538.offsetconfig538.api.config.Datafixer; import java.io.IOException; import java.net.URI; import java.nio.file.Files; import java.nio.file.Path; -import java.util.List; import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.config.ConfigManager.CURRENT_CONFIG_FILE_PATH; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; -public class ModConfig { +public class ModConfig implements Config { @Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") public ServerInfo serverInfo = new ServerInfo(); @@ -142,7 +135,7 @@ public void trigger(final boolean updateSucceeded, final Map pla WebhookSender.send(webhookBody, getWebhookUrl(), updateType, updateSucceeded); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.resourcePackProvider.successWebhook.body); + throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.get().resourcePackProvider.successWebhook.body); } } @@ -152,20 +145,13 @@ public void trigger(final boolean updateSucceeded, final Map pla } public @Nullable Path getBodyPath() { - return body == null ? null : CURRENT_CONFIG_FILE_PATH.getParent().resolve(body); + return body == null ? null : config.get().getFilePath().getParent().resolve(body); } } - protected String getName() { - return MOD_ID + "/" + MOD_ID; - } - - protected int getConfigVersion() { - return 3; - } - - protected List getDatafixers() { - return List.of( + @Override + public @NotNull Datafixer[] getDatafixers() { + return new Datafixer[]{ (original, jankson) -> { // 0 -> 1 original.put("branch", jankson.toJson(jankson.getMarshaller().marshall(String.class, original.get("githubRef")).replace("refs/heads/", ""))); @@ -227,30 +213,35 @@ protected List getDatafixers() { original.put("resourcePackProvider", jankson.toJson(resourcePackProvider)); } - ); + }; } - public void createDefaultWebhooks() { - final Jankson jankson = new Jankson.Builder().build(); - final List webhookBodies = List.of( - new BasicWebhook(), - - new BasicSuccessMessage(), - new BasicFailMessage(), - new EmbedSuccessMessage(), - new EmbedFailMessage() - ); - - for (DefaultWebhookBody webhook : webhookBodies) { - final Path location = CURRENT_CONFIG_FILE_PATH.getParent().resolve(webhook.getName()); + @Override + public int getConfigVersion() { + return 3; + } - if (Files.exists(location)) continue; + @Override + public @NotNull Path getFilePath() { + return PlatformMain.INSTANCE.getConfigDir().resolve("config").resolve("main.json"); + } + @Override + public void beforeLoadStart() { + if (Files.exists(PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"))) { + try { + Files.createDirectories(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json").getParent()); + Files.move(PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"), PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json")); + } catch (IOException e) { + throw new RuntimeException("Failed to move config file to new location!", e); + } + } + if (Files.exists(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json"))) { try { - Files.createDirectories(location.getParent()); - Files.writeString(location, jankson.toJson(webhook).toJson(JsonGrammar.STRICT)); + Files.createDirectories(getFilePath().getParent()); + Files.move(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json"), getFilePath()); } catch (IOException e) { - LOGGER.error("Failed to write default webhook body '%s'!", webhook.getName(), e); + throw new RuntimeException("Failed to move config file to new location!", e); } } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java index 344aa2f..177a535 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -13,7 +13,7 @@ import java.util.stream.Stream; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class DataPackHandler { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); @@ -110,53 +110,29 @@ private State readStateFile() throws IOException { return GSON.fromJson(Files.readString(STATE_FILE), State.class); } - private void copyPacksToDirectory(List sourcePacks, Path datapacksDir) throws GithubResourcepackManagerException { - for (Path sourcePack : sourcePacks) { - if (Files.isDirectory(sourcePack)) { - try { - PathUtils.copyDirectory(sourcePack, datapacksDir); - } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to copy pack '%s' into directory '%s'!", e, sourcePack, datapacksDir); - } - continue; - } - if (sourcePack.getFileName().endsWith(".zip")) { - try { - Files.copy(sourcePack, datapacksDir); - } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to copy pack '%s' into directory '%s'!", e, sourcePack, datapacksDir); - } - continue; - } - - LOGGER.error("'%s' is not a valid pack! Ignoring...", sourcePack); - sourcePacks.remove(sourcePack); - } - } - private List gatherSourcePacks() throws GithubResourcepackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in data pack root..."); - final boolean hasPackMcmeta = Files.exists(config.dataPackProvider.getPackRoot().resolve("pack.mcmeta")); + final boolean hasPackMcmeta = Files.exists(config.get().dataPackProvider.getPackRoot().resolve("pack.mcmeta")); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); LOGGER.info("Checking for 'packs' directory in data pack root..."); - Path packsDir = config.dataPackProvider.getPackPacksDir(); + Path packsDir = config.get().dataPackProvider.getPackPacksDir(); final boolean hasPacksFolder = Files.exists(packsDir) && Files.isDirectory(packsDir); LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.dataPackProvider.getPackRoot().toAbsolutePath()); + throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackRoot().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { - LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in data pack root '%s'!", config.dataPackProvider.getPackPacksDir().toAbsolutePath()); - LOGGER.info("Assuming data pack root '%s' as 'packs' directory.", config.dataPackProvider.getPackPacksDir().toAbsolutePath()); - packsDir = config.dataPackProvider.getPackRoot(); + LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackPacksDir().toAbsolutePath()); + LOGGER.info("Assuming data pack root '%s' as 'packs' directory.", config.get().dataPackProvider.getPackPacksDir().toAbsolutePath()); + packsDir = config.get().dataPackProvider.getPackRoot(); } if (hasPackMcmeta) { LOGGER.info("Using data pack root as data pack."); - return List.of(config.dataPackProvider.getPackRoot()); + return List.of(config.get().dataPackProvider.getPackRoot()); } LOGGER.info("Using 'packs' directory for data packs."); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index 5dd0112..018250b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -25,7 +25,7 @@ import java.util.Optional; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class GitHandler { @@ -81,8 +81,8 @@ private static CommitProperties getLatestCommitProperties(String lastCommitHash, private static void updateRepository(boolean retry) throws GithubResourcepackManagerException { // Create credentials provider if repository is private CredentialsProvider credentialsProvider = null; - if (config.repositoryInfo.isPrivate) - credentialsProvider = new UsernamePasswordCredentialsProvider(config.repositoryInfo.username, config.repositoryInfo.token); + if (config.get().repositoryInfo.isPrivate) + credentialsProvider = new UsernamePasswordCredentialsProvider(config.get().repositoryInfo.username, config.get().repositoryInfo.token); // If the repo folder doesn't exist, clone the repository. if (!GIT_FOLDER.toFile().exists()) cloneRepository(credentialsProvider); @@ -94,7 +94,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan .setCredentialsProvider(credentialsProvider) .setContentMergeStrategy(ContentMergeStrategy.THEIRS) .setStrategy(MergeStrategy.THEIRS) - .setRemoteBranchName(config.getGithubRef()) + .setRemoteBranchName(config.get().getGithubRef()) .call(); // Handle errors @@ -132,9 +132,9 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan private static void cloneRepository(CredentialsProvider credentialsProvider) throws GithubResourcepackManagerException { try { Git git = Git.cloneRepository() - .setURI(config.repositoryInfo.url) + .setURI(config.get().repositoryInfo.url) .setDirectory(GIT_FOLDER.toFile()) - .setBranch(config.getGithubRef()) + .setBranch(config.get().getGithubRef()) .setCredentialsProvider(credentialsProvider) .call(); git.close(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index 49052c3..bf0e027 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -18,7 +18,7 @@ import java.util.stream.Stream; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class ResourcePackHandler { private Path outputPackPath; @@ -140,27 +140,27 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou private List gatherSourcePacks() throws GithubResourcepackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); - final boolean hasPackMcmeta = config.resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); + final boolean hasPackMcmeta = config.get().resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); LOGGER.info("Checking for 'packs' directory in resource pack root..."); - Path packsDir = config.resourcePackProvider.getPackPacksDir(); + Path packsDir = config.get().resourcePackProvider.getPackPacksDir(); final boolean hasPacksFolder = Files.exists(packsDir) && Files.isDirectory(packsDir); LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); + throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { - LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); - LOGGER.info("Assuming resource pack root '%s' as 'packs' directory.", config.resourcePackProvider.getPackPacksDir().toAbsolutePath()); - packsDir = config.resourcePackProvider.getPackRoot(); + LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); + LOGGER.info("Assuming resource pack root '%s' as 'packs' directory.", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); + packsDir = config.get().resourcePackProvider.getPackRoot(); } if (hasPackMcmeta) { LOGGER.info("Using resource pack root as resource pack."); - return List.of(config.resourcePackProvider.getPackRoot().toFile()); + return List.of(config.get().resourcePackProvider.getPackRoot().toFile()); } LOGGER.info("Using 'packs' directory for resource packs."); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java index 3ce42b4..a534078 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java @@ -11,7 +11,7 @@ import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.resourcePackHandler; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public final class FileHttpHandler { private FileHttpHandler() {} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java index 4771df9..4d1b182 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java @@ -7,7 +7,7 @@ import top.offsetmonkey538.meshlib.api.HttpHandler; import static io.netty.handler.codec.http.HttpResponseStatus.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class MainHttpHandler implements HttpHandler { @@ -18,7 +18,7 @@ public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpR return; } - LOGGER.debug("Received Request: " + request); + LOGGER.debug("Received Request: &s", request); final HttpMethod method = request.method(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java deleted file mode 100644 index c92931e..0000000 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformLogging.java +++ /dev/null @@ -1,50 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; - -import org.jetbrains.annotations.Nullable; - -import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; - -public interface PlatformLogging { - PlatformLogging LOGGER = load(PlatformLogging.class); - - default void debug(String message, Object... args) { - debug(String.format(message, args)); - } - default void info(String message, Object... args) { - info(String.format(message, args)); - } - default void warn(String message, Object... args) { - warn(String.format(message, args)); - } - default void warn(String message, Throwable error, Object... args) { - warn(String.format(message, args), error); - } - default void error(String message, Object... args) { - error(String.format(message, args)); - } - default void error(String message, Throwable error, Object... args) { - error(String.format(message, args), error); - } - - void debug(String message); - void info(String message); - void warn(String message); - void warn(String message, Throwable error); - void error(String message); - void error(String message, Throwable error); - - void addListener(LogLevel level, LogListener listener); - void removeListener(LogLevel level, LogListener listener); - - enum LogLevel { - DEBUG, - INFO, - WARN, - ERROR - } - - @FunctionalInterface - interface LogListener { - void accept(String message, @Nullable Throwable error); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java index c683a76..5621e7c 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java @@ -9,7 +9,7 @@ import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformServerProperties { @@ -22,7 +22,7 @@ public interface PlatformServerProperties { void reload() throws GithubResourcepackManagerException; default void updatePackProperties(ResourcePackHandler packHandler) throws GithubResourcepackManagerException { - final String resourcePackUrl = config.getPackUrl(packHandler.getOutputPackName()); + final String resourcePackUrl = config.get().getPackUrl(packHandler.getOutputPackName()); final String resourcePackSha1; try { // Ignore the fact that sha1 hashing is deprecated as Minecraft uses it for validating server resource packs. diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java index fdbd903..10153cf 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java @@ -7,7 +7,7 @@ import java.util.regex.Matcher; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public final class StringUtils { private StringUtils() { diff --git a/fabric/build.gradle b/fabric/build.gradle index f671054..87ce2ff 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -59,8 +59,9 @@ repositories { name = "OffsetMods538" url = "https://maven.offsetmonkey538.top/releases" content { - includeGroup "top.offsetmonkey538.monkeylib538" includeGroup "top.offsetmonkey538.meshlib" + includeGroup "top.offsetmonkey538.monkeylib538" + includeGroup "top.offsetmonkey538.offsetconfig538" } } } @@ -91,9 +92,13 @@ dependencies { modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${devauth_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" + compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}" + modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}+1.21.5") { + exclude(group: "net.fabricmc.fabric-api") + exclude(group: "top.offsetmonkey538.monkeylib538:monkeylib538-fabric") + } - modImplementation "top.offsetmonkey538.monkeylib538:monkeylib538:${project.monkeylib538_version}" + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" include runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}") diff --git a/fabric/gradle.properties b/fabric/gradle.properties index fccff0f..94117ba 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -10,6 +10,4 @@ fapi_version = 0.119.3+1.21.4 ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth devauth_version = 1.2.1 -monkeylib538_version = 2.0.2+1.21 - nameSuffix = fabric diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 8fb9622..6e1a971 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -1,6 +1,8 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; import com.mojang.brigadier.CommandDispatcher; +import com.mojang.brigadier.builder.ArgumentBuilder; +import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.minecraft.command.CommandRegistryAccess; @@ -18,7 +20,8 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; +import top.offsetmonkey538.monkeylib538.api.ConfigCommandApi; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import java.util.Optional; @@ -27,6 +30,7 @@ import static net.minecraft.server.command.CommandManager.argument; import static net.minecraft.server.command.CommandManager.literal; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; public class FabricPlatformCommand implements PlatformCommand { @Override @@ -35,7 +39,12 @@ public void registerGithubRpManagerCommand() { } public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { - dispatcher.register(literal("gh-rp-manager") + final LiteralArgumentBuilder command = literal("gh-rp-manager"); + + //noinspection unchecked + command.then((ArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config)); + + dispatcher.register(command .then(literal("request-pack") .requires(ServerCommandSource::isExecutedByPlayer) .executes( @@ -83,10 +92,10 @@ public static void register(CommandDispatcher dispatcher, C } private static void runTriggerUpdate(CommandContext context, boolean force) { - final PlatformLogging.LogListener infoListener = (message, error) -> { + final PlatformLogger.LogListener infoListener = (message, error) -> { context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message))); }; - final PlatformLogging.LogListener warnListener = (message, error) -> { + final PlatformLogger.LogListener warnListener = (message, error) -> { MutableText text = Text .literal(String.format("[%s] %s", MOD_ID, message)) .setStyle(Style.EMPTY.withColor(Formatting.YELLOW)); @@ -100,12 +109,12 @@ private static void runTriggerUpdate(CommandContext context context.getSource().sendMessage(text); }; - PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.INFO, infoListener); - PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.WARN, warnListener); GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.INFO, infoListener); - PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.WARN, warnListener); } } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java deleted file mode 100644 index 45cb414..0000000 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformLogging.java +++ /dev/null @@ -1,70 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; - -import org.slf4j.Logger; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class FabricPlatformLogging implements PlatformLogging { - - private static Logger logger; - private static final Map> listeners = new HashMap<>(Map.of( - LogLevel.DEBUG, new ArrayList<>(), - LogLevel.INFO, new ArrayList<>(), - LogLevel.WARN, new ArrayList<>(), - LogLevel.ERROR, new ArrayList<>() - )); - - @Override - public void debug(String message) { - listeners.get(LogLevel.DEBUG).forEach(consumer -> consumer.accept(message, null)); - logger.debug(message); - } - - @Override - public void info(String message) { - listeners.get(LogLevel.INFO).forEach(consumer -> consumer.accept(message, null)); - logger.info(message); - } - - @Override - public void warn(String message) { - listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, null)); - logger.warn(message); - } - - @Override - public void warn(String message, Throwable error) { - listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, error)); - logger.warn(message, error); - } - - @Override - public void error(String message) { - listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, null)); - logger.error(message); - } - - @Override - public void error(String message, Throwable error) { - listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, error)); - logger.error(message, error); - } - - @Override - public void addListener(LogLevel level, LogListener listener) { - listeners.get(level).add(listener); - } - - @Override - public void removeListener(LogLevel level, LogListener listener) { - listeners.get(level).remove(listener); - } - - public static void setLogger(Logger logger) { - FabricPlatformLogging.logger = logger; - } -} diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 06d059c..b60c462 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -12,16 +12,15 @@ import net.minecraft.text.Text; import net.minecraft.util.Formatting; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.slf4j.LoggerFactory; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import java.nio.file.Path; import java.util.LinkedList; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { private static MinecraftServer minecraftServer; @@ -29,8 +28,6 @@ public class FabricPlatformMain implements PlatformMain, DedicatedServerModIniti @Override public void onInitializeServer() { - FabricPlatformLogging.setLogger(LoggerFactory.getLogger(MOD_ID)); - GithubResourcepackManager.initialize(); ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer1 -> minecraftServer = minecraftServer1); @@ -60,7 +57,7 @@ public void runOnServerStart(Runnable work) { @Override public void registerLogToAdminListener() { - LOGGER.addListener(PlatformLogging.LogLevel.ERROR, (message, error) -> { + LOGGER.addListener(PlatformLogger.LogLevel.ERROR, (message, error) -> { MutableText text = Text .literal(String.format("[%s] %s", MOD_ID, message)) .setStyle(Style.EMPTY.withColor(Formatting.RED)); diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index 9631a18..7a7a199 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -3,15 +3,19 @@ import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; +import net.minecraft.util.Formatting; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; -import top.offsetmonkey538.monkeylib538.utils.TextUtils; +import java.util.List; import java.util.Map; public class FabricPlatformText implements PlatformText { + Style DEFAULT_STYLE = Style.EMPTY.withItalic(false).withColor(Formatting.WHITE); + + @Override public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); @@ -23,7 +27,7 @@ public void sendUpdateMessage(final String message, @Nullable final String hover try { hoverEvent = hoverMessage == null ? null : new HoverEvent( HoverEvent.Action.SHOW_TEXT, - TextUtils.INSTANCE.getStyledText( + getStyledText( StringUtils.replacePlaceholders(hoverMessage, placeholders).replace("\\n", "\n") ) ); @@ -35,7 +39,7 @@ public void sendUpdateMessage(final String message, @Nullable final String hover final String currentLineString = StringUtils.replacePlaceholders(splitMessage[lineNumber], placeholders).replace("\\n", "\n"); final MutableText currentLine = Text.empty(); try { - for (Text currentLineSibling : TextUtils.INSTANCE.getStyledText(currentLineString).getSiblings()) { + for (Text currentLineSibling : getStyledText(currentLineString).getSiblings()) { final MutableText sibling = currentLineSibling.copy(); if (hoverEvent != null) sibling.setStyle(sibling.getStyle().withHoverEvent(hoverEvent)); @@ -76,4 +80,83 @@ public void sendUpdateMessage(final String message, @Nullable final String hover } } } + + private MutableText getStyledText(String text) throws Exception { + final MutableText result = Text.empty(); + Style style = DEFAULT_STYLE; + + boolean isFormattingCode = false; + boolean isEscaped = false; + char[] characters = text.toCharArray(); + for (int characterIndex = 0; characterIndex < characters.length; characterIndex++) { + char currentChar = characters[characterIndex]; + + if (isFormattingCode) { + // Hex color + if (currentChar == '#') { + if (characterIndex + 7 >= characters.length) throw new Exception("Unfinished hex code starting at character number '" + characterIndex + "'!"); + + try { + style = style.withColor(parseHexColor(text.substring(characterIndex, characterIndex + 7))); + } catch (Exception e) { + throw new Exception("Failed to parse hex color starting at character number '" + characterIndex + "'!", e); + } + + // Move pointer 6 characters ahead as we already read the whole hex code + characterIndex += 6; + isFormattingCode = false; + continue; + } + + style = getStyleForFormattingCode(currentChar, style); + + if (style == null) throw new Exception("Invalid formatting code at character number '" + characterIndex + "'!"); + + isFormattingCode = false; + continue; + } + + if (!isEscaped){ + switch (currentChar){ + case '&': + isFormattingCode = true; + continue; + case '\\': + isEscaped = true; + continue; + } + } + isEscaped = false; + + + final List siblings = result.getSiblings(); + final int lastSiblingIndex = siblings.size() - 1; + final Text lastSibling = siblings.isEmpty() ? Text.empty() : siblings.get(lastSiblingIndex); + + // Check if the style of the last sibling is the same as the current one + if (!siblings.isEmpty() && lastSibling.getStyle().equals(style)) { + // If so, set the last sibling to itself plus the new character + siblings.set(lastSiblingIndex, Text.literal(lastSibling.getString() + currentChar).setStyle(style)); + } else { + // Otherwise, just append a new sibling to the result + result.append(Text.literal(String.valueOf(currentChar)).setStyle(style)); + } + } + + return result; + } + + + private Style getStyleForFormattingCode(char formattingCode, Style currentStyle) { + if (formattingCode == 'r') return DEFAULT_STYLE; + + final Formatting formatting = Formatting.byCode(formattingCode); + if (formatting == null) return null; + + return currentStyle.withFormatting(formatting); + } + + public TextColor parseHexColor(String hexColor) throws Exception { + return TextColor.parse(hexColor).getOrThrow(Exception::new); + } } diff --git a/gradle.properties b/gradle.properties index 512ef06..212b7aa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,9 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 1.0.5+1.21.4 +# MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 +monkeylib538_version = 3.0.0-1753538770838 # Mod Properties -mod_version = 4.0.1 +mod_version = 5.0.0 supported_minecraft_versions = >=1.19.2 diff --git a/paper/build.gradle b/paper/build.gradle index 540f806..66104b1 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -18,11 +18,20 @@ repositories { includeGroup "io.papermc.paper" } } + maven { + name = "Mojang Libraries" + url = "https://libraries.minecraft.net" + content { + includeGroup "com.mojang" + } + } maven { name = "OffsetMods538" url = "https://maven.offsetmonkey538.top/releases" content { includeGroup "top.offsetmonkey538.meshlib" + includeGroup "top.offsetmonkey538.monkeylib538" + includeGroup "top.offsetmonkey538.offsetconfig538" } } } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index f95974a..4597476 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -15,7 +15,7 @@ import org.bukkit.entity.Player; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import java.net.URI; @@ -84,10 +84,10 @@ public void registerGithubRpManagerCommand() { @SuppressWarnings("UnstableApiUsage") private void runTriggerUpdate(CommandContext context, boolean force) { - final PlatformLogging.LogListener infoListener = (message, error) -> { + final PlatformLogger.LogListener infoListener = (message, error) -> { context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message))); }; - final PlatformLogging.LogListener warnListener = (message, error) -> { + final PlatformLogger.LogListener warnListener = (message, error) -> { Component text = Component .text(String.format("[%s] %s", MOD_ID, message)) .color(NamedTextColor.YELLOW); @@ -100,12 +100,12 @@ private void runTriggerUpdate(CommandContext context, boolea context.getSource().getSender().sendMessage(text); }; - PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.INFO, infoListener); - PlatformLogging.LOGGER.addListener(PlatformLogging.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.WARN, warnListener); GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.INFO, infoListener); - PlatformLogging.LOGGER.removeListener(PlatformLogging.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.WARN, warnListener); } } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java deleted file mode 100644 index 82bba96..0000000 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformLogging.java +++ /dev/null @@ -1,71 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; - -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class PaperPlatformLogging implements PlatformLogging { - - private static Logger logger; - private static final Map> listeners = new HashMap<>(Map.of( - LogLevel.DEBUG, new ArrayList<>(), - LogLevel.INFO, new ArrayList<>(), - LogLevel.WARN, new ArrayList<>(), - LogLevel.ERROR, new ArrayList<>() - )); - - @Override - public void debug(String message) { - listeners.get(LogLevel.DEBUG).forEach(consumer -> consumer.accept(message, null)); - logger.log(Level.FINE, message); - } - - @Override - public void info(String message) { - listeners.get(LogLevel.INFO).forEach(consumer -> consumer.accept(message, null)); - logger.log(Level.INFO, message); - } - - @Override - public void warn(String message) { - listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, null)); - logger.log(Level.WARNING, message); - } - - @Override - public void warn(String message, Throwable error) { - listeners.get(LogLevel.WARN).forEach(consumer -> consumer.accept(message, error)); - logger.log(Level.WARNING, message, error); - } - - @Override - public void error(String message) { - listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, null)); - logger.log(Level.SEVERE, message); - } - - @Override - public void error(String message, Throwable error) { - listeners.get(LogLevel.ERROR).forEach(consumer -> consumer.accept(message, error)); - logger.log(Level.SEVERE, message, error); - } - - @Override - public void addListener(LogLevel level, LogListener listener) { - listeners.get(level).add(listener); - } - - @Override - public void removeListener(LogLevel level, LogListener listener) { - listeners.get(level).remove(listener); - } - - public static void setLogger(Logger logger) { - PaperPlatformLogging.logger = logger; - } -} diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 45c5b85..0487b87 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -6,13 +6,13 @@ import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang.exception.ExceptionUtils; import org.bukkit.OfflinePlayer; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; +import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import java.nio.file.Path; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging.LOGGER; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class PaperPlatformMain implements PlatformMain { private static PaperPlugin plugin; @@ -34,7 +34,7 @@ public void refreshDatapacks() { @Override public void registerLogToAdminListener() { - LOGGER.addListener(PlatformLogging.LogLevel.ERROR, (message, error) -> { + LOGGER.addListener(PlatformLogger.LogLevel.ERROR, (message, error) -> { Component text = Component .text(String.format("[%s] %s", MOD_ID, message)) .color(NamedTextColor.RED); diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java index 3428ea3..5dc7a85 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java @@ -21,7 +21,6 @@ public void onEnable() { MeshLib.initialize(); PaperPlatformMain.setPlugin(this); - PaperPlatformLogging.setLogger(getLogger()); GithubResourcepackManager.initialize(); } From 40ba893a589eba4e9651bd53b9bf172900e950ec Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 4 Aug 2025 01:30:34 +0200 Subject: [PATCH 22/89] Update monke to 992e97c --- .../GithubResourcepackManager.java | 14 ++++++++ .../config/ModConfig.java | 5 +++ fabric/build.gradle | 2 +- fabric/gradle.properties | 2 +- .../fabric/FabricPlatformCommand.java | 36 +++++++++++++++++-- gradle.properties | 4 +-- 6 files changed, 57 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 2f8f0c0..3703439 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -11,6 +11,8 @@ import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; +import top.offsetmonkey538.monkeylib538.api.command.CommandRegistrationApi; +import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import top.offsetmonkey538.monkeylib538.api.log.PlatformLoggerProvider; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; @@ -63,6 +65,18 @@ public static void initialize() { PlatformMain.INSTANCE.registerLogToAdminListener(); updatePack(UpdateType.RESTART); }); + + + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test1"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test2", "sub1"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test3", "sub1", "sub2"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test4", "sub1", "sub2", "sub3"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test5", "sub1", "sub2", "sub3", "sub4"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test6", "sub1", "sub2", "sub3", "sub4", "sub5"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test7", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test8", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test9", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7", "sub8"); + ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test10", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7", "sub8", "sub9"); } private static void createFolderStructure() throws GithubResourcepackManagerException { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index 7242aa3..d92d3a5 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -226,6 +226,11 @@ public int getConfigVersion() { return PlatformMain.INSTANCE.getConfigDir().resolve("config").resolve("main.json"); } + @Override + public @NotNull String getId() { + return MOD_ID + "/main"; + } + @Override public void beforeLoadStart() { if (Files.exists(PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"))) { diff --git a/fabric/build.gradle b/fabric/build.gradle index 87ce2ff..28b205a 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -93,7 +93,7 @@ dependencies { modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${devauth_version}" compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}" - modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}+1.21.5") { + modImplementation("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}+1.21.5") { exclude(group: "net.fabricmc.fabric-api") exclude(group: "top.offsetmonkey538.monkeylib538:monkeylib538-fabric") } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index 94117ba..c0ef59c 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -3,7 +3,7 @@ # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. yarn_version = 1.21.4+build.8 -loader_version = 0.16.14 +loader_version = 0.17.0 fapi_version = 0.119.3+1.21.4 # Dependencies diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 6e1a971..453a01a 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -4,6 +4,8 @@ import com.mojang.brigadier.builder.ArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.LiteralCommandNode; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; import net.minecraft.command.CommandRegistryAccess; import net.minecraft.command.ControlFlowAware; @@ -20,7 +22,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.ConfigCommandApi; +import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; import java.util.Optional; @@ -38,11 +40,41 @@ public void registerGithubRpManagerCommand() { CommandRegistrationCallback.EVENT.register(FabricPlatformCommand::register); } + /* + private static class TestArgumentBuilder extends LiteralArgumentBuilder { + + protected TestArgumentBuilder(String literal) { + super(literal); + } + + @Override + public LiteralCommandNode build() { + final LiteralCommandNode result = new LiteralCommandNode<>(getLiteral(), getCommand(), getRequirement(), getRedirect(), getRedirectModifier(), isFork()); + + for (final CommandNode argument : getArguments()) { + result.addChild(argument); + } + + return result; + } + } + */ + public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { final LiteralArgumentBuilder command = literal("gh-rp-manager"); //noinspection unchecked - command.then((ArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config)); + + + + //final LiteralArgumentBuilder configCommandImpl = (LiteralArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config); + //noinspection unchecked + //command.then((LiteralArgumentBuilder) (LiteralArgumentBuilder) configCommandImpl); + + //noinspection unchecked + command.then((LiteralArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config)); + + //command.then((LiteralArgumentBuilder) ); dispatcher.register(command .then(literal("request-pack") diff --git a/gradle.properties b/gradle.properties index 212b7aa..532872c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 1.0.5+1.21.4 +meshlib_version = 1.0.5+1.21.4 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-1753538770838 +monkeylib538_version = 3.0.0-992e97c # Mod Properties mod_version = 5.0.0 From 588c8fe2c5cf197c00df4b5027074eda9143489a Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:59:10 +0200 Subject: [PATCH 23/89] Update monke to eb3e2e1 Also fixes #21 --- common/gradle.properties | 2 +- .../GithubResourcepackManager.java | 38 +++++++------- .../config/ConfigHandler.java | 12 ++--- .../fabric/FabricPlatformCommand.java | 49 +++---------------- .../platform/fabric/FabricPlatformMain.java | 11 +++-- gradle.properties | 2 +- .../platform/paper/PaperPlatformCommand.java | 14 +++--- .../platform/paper/PaperPlatformMain.java | 4 +- 8 files changed, 46 insertions(+), 86 deletions(-) diff --git a/common/gradle.properties b/common/gradle.properties index e8e57e3..41b5d26 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -4,6 +4,6 @@ commons_version = 2.18.0 gson_version = 2.11.0 ## OffsetConfig538, check at https://github.com/OffsetMods538/OffsetConfig538 -offsetconfig538_version = 1.0.0-2f5cd46 +offsetconfig538_version = 1.0.0-946f4f7 nameSuffix = api \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 3703439..90cbd8c 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -11,10 +11,8 @@ import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; -import top.offsetmonkey538.monkeylib538.api.command.CommandRegistrationApi; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLoggerProvider; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; @@ -30,7 +28,7 @@ private GithubResourcepackManager() { } public static final String MOD_ID = "github-resourcepack-manager"; - public static final PlatformLogger LOGGER = PlatformLoggerProvider.INSTANCE.createLogger(MOD_ID); + public static final MonkeyLibLogger LOGGER = MonkeyLibLogger.create(MOD_ID); public static final String MOD_URI = "gh-rp-manager"; public static final Path DATA_FOLDER = PlatformMain.INSTANCE.getConfigDir().resolve(".packs"); @@ -48,10 +46,18 @@ private GithubResourcepackManager() { public static ResourcePackHandler resourcePackHandler; + private static boolean disabled; + public static void initialize() { + PlatformMain.INSTANCE.registerLogToAdminListener(); PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); + ConfigCommandApi.registerConfigCommand( + config, + () -> disabled = ConfigHandler.handleConfig(), + "gh-rp-manager", "config" + ); - ConfigHandler.handleConfig(); + disabled = ConfigHandler.handleConfig(); try { createFolderStructure(); @@ -61,22 +67,7 @@ public static void initialize() { HttpHandlerRegistry.INSTANCE.register(MOD_URI, new MainHttpHandler()); - PlatformMain.INSTANCE.runOnServerStart(() -> { - PlatformMain.INSTANCE.registerLogToAdminListener(); - updatePack(UpdateType.RESTART); - }); - - - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test1"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test2", "sub1"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test3", "sub1", "sub2"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test4", "sub1", "sub2", "sub3"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test5", "sub1", "sub2", "sub3", "sub4"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test6", "sub1", "sub2", "sub3", "sub4", "sub5"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test7", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test8", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test9", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7", "sub8"); - ConfigCommandApi.INSTANCE.registerConfigCommand(config, "test10", "sub1", "sub2", "sub3", "sub4", "sub5", "sub6", "sub7", "sub8", "sub9"); + PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART)); } private static void createFolderStructure() throws GithubResourcepackManagerException { @@ -90,6 +81,11 @@ private static void createFolderStructure() throws GithubResourcepackManagerExce } public static void updatePack(final UpdateType updateType) { + if (disabled) { + LOGGER.warn("Skipping pack updating because config was invalid!"); + return; + } + LOGGER.info("Updating packs..."); if (updateType == UpdateType.COMMAND_FORCE) { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java index 78bbea3..e7b24fc 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java @@ -23,22 +23,20 @@ private ConfigHandler() { } - public static void handleConfig() { + public static boolean handleConfig() { LOGGER.info("Writing default webhook bodies"); createDefaultWebhooks(); // Checking if config is valid final List errors = checkConfigErrors(); - // Return when nothing's wrong - if (errors.isEmpty()) return; + // Return false when nothing's wrong (disables the mod) + if (errors.isEmpty()) return false; // There were errors, time to log em. LOGGER.error("There were problems with the config for GitHub Resourcepack Manager, see below for more details!"); - errors.stream().map(string -> "\t" + string).forEach(LOGGER::error); - LOGGER.error("There were problems with the config for Github Resourcepack Manager, see above for more details!"); - - throw new RuntimeException("There were problems with the config for Github Resourcepack Manager, see above for more details!"); + errors.stream().map(string -> " " + string).forEach(LOGGER::error); + return true; } private static void createDefaultWebhooks() { diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 453a01a..97743ac 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -22,8 +22,7 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import java.util.Optional; @@ -32,7 +31,6 @@ import static net.minecraft.server.command.CommandManager.argument; import static net.minecraft.server.command.CommandManager.literal; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.config; public class FabricPlatformCommand implements PlatformCommand { @Override @@ -40,42 +38,9 @@ public void registerGithubRpManagerCommand() { CommandRegistrationCallback.EVENT.register(FabricPlatformCommand::register); } - /* - private static class TestArgumentBuilder extends LiteralArgumentBuilder { - - protected TestArgumentBuilder(String literal) { - super(literal); - } - - @Override - public LiteralCommandNode build() { - final LiteralCommandNode result = new LiteralCommandNode<>(getLiteral(), getCommand(), getRequirement(), getRedirect(), getRedirectModifier(), isFork()); - - for (final CommandNode argument : getArguments()) { - result.addChild(argument); - } - - return result; - } - } - */ - public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { final LiteralArgumentBuilder command = literal("gh-rp-manager"); - //noinspection unchecked - - - - //final LiteralArgumentBuilder configCommandImpl = (LiteralArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config); - //noinspection unchecked - //command.then((LiteralArgumentBuilder) (LiteralArgumentBuilder) configCommandImpl); - - //noinspection unchecked - command.then((LiteralArgumentBuilder) ConfigCommandApi.INSTANCE.createConfigCommand("config", config)); - - //command.then((LiteralArgumentBuilder) ); - dispatcher.register(command .then(literal("request-pack") .requires(ServerCommandSource::isExecutedByPlayer) @@ -124,10 +89,10 @@ public static void register(CommandDispatcher dispatcher, C } private static void runTriggerUpdate(CommandContext context, boolean force) { - final PlatformLogger.LogListener infoListener = (message, error) -> { + final MonkeyLibLogger.LogListener infoListener = (message, error) -> { context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message))); }; - final PlatformLogger.LogListener warnListener = (message, error) -> { + final MonkeyLibLogger.LogListener warnListener = (message, error) -> { MutableText text = Text .literal(String.format("[%s] %s", MOD_ID, message)) .setStyle(Style.EMPTY.withColor(Formatting.YELLOW)); @@ -141,12 +106,12 @@ private static void runTriggerUpdate(CommandContext context context.getSource().sendMessage(text); }; - GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); } } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index b60c462..501db61 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -12,9 +12,10 @@ import net.minecraft.text.Text; import net.minecraft.util.Formatting; import org.apache.commons.lang3.exception.ExceptionUtils; +import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import java.nio.file.Path; import java.util.LinkedList; @@ -23,7 +24,7 @@ import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { - private static MinecraftServer minecraftServer; + private static @Nullable MinecraftServer minecraftServer = null; private static final LinkedList messageQueue = new LinkedList<>(); @Override @@ -40,7 +41,7 @@ public void onInitializeServer() { }); } - public static MinecraftServer getServer() { + public static @Nullable MinecraftServer getServer() { return minecraftServer; } @@ -57,7 +58,7 @@ public void runOnServerStart(Runnable work) { @Override public void registerLogToAdminListener() { - LOGGER.addListener(PlatformLogger.LogLevel.ERROR, (message, error) -> { + LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, (message, error) -> { MutableText text = Text .literal(String.format("[%s] %s", MOD_ID, message)) .setStyle(Style.EMPTY.withColor(Formatting.RED)); @@ -69,7 +70,7 @@ public void registerLogToAdminListener() { )); boolean sent = false; - for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { + if (getServer() != null) for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { if (!getServer().getPlayerManager().isOperator(player.getGameProfile())) continue; player.sendMessage(text, false); sent = true; diff --git a/gradle.properties b/gradle.properties index 532872c..6d2e36c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 1.0.5+1.21.4 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-992e97c +monkeylib538_version = 3.0.0-eb3e2e1 # Mod Properties mod_version = 5.0.0 diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index 4597476..4c2b685 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -15,7 +15,7 @@ import org.bukkit.entity.Player; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import java.net.URI; @@ -84,10 +84,10 @@ public void registerGithubRpManagerCommand() { @SuppressWarnings("UnstableApiUsage") private void runTriggerUpdate(CommandContext context, boolean force) { - final PlatformLogger.LogListener infoListener = (message, error) -> { + final MonkeyLibLogger.LogListener infoListener = (message, error) -> { context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message))); }; - final PlatformLogger.LogListener warnListener = (message, error) -> { + final MonkeyLibLogger.LogListener warnListener = (message, error) -> { Component text = Component .text(String.format("[%s] %s", MOD_ID, message)) .color(NamedTextColor.YELLOW); @@ -100,12 +100,12 @@ private void runTriggerUpdate(CommandContext context, boolea context.getSource().getSender().sendMessage(text); }; - GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(PlatformLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(PlatformLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); } } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 0487b87..43195f7 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -7,7 +7,7 @@ import org.apache.commons.lang.exception.ExceptionUtils; import org.bukkit.OfflinePlayer; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.log.PlatformLogger; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import java.nio.file.Path; @@ -34,7 +34,7 @@ public void refreshDatapacks() { @Override public void registerLogToAdminListener() { - LOGGER.addListener(PlatformLogger.LogLevel.ERROR, (message, error) -> { + LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, (message, error) -> { Component text = Component .text(String.format("[%s] %s", MOD_ID, message)) .color(NamedTextColor.RED); From c640319eb27d3ecc670bb8dfe189f32372b605be Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:36:35 +0200 Subject: [PATCH 24/89] Update monke to 30682cc Use mankeee for styling text. Hover message and update command not supported there yet --- build.gradle | 11 +- common/build.gradle | 16 +- common/gradle.properties | 3 - .../GithubResourcepackManager.java | 8 +- .../platform/PlatformText.java | 6 +- fabric/build.gradle | 23 ++- fabric/gradle.properties | 2 +- .../platform/fabric/FabricPlatformText.java | 146 +----------------- gradle.properties | 4 +- paper/build.gradle | 9 -- .../platform/paper/PaperPlatformText.java | 26 +++- 11 files changed, 64 insertions(+), 190 deletions(-) diff --git a/build.gradle b/build.gradle index d0be512..780ac0c 100644 --- a/build.gradle +++ b/build.gradle @@ -11,13 +11,22 @@ allprojects { repositories { mavenLocal() + maven { + name = "OffsetMods538" + url = "https://maven.offsetmonkey538.top/releases" + content { + includeGroup "top.offsetmonkey538.meshlib" + includeGroup "top.offsetmonkey538.monkeylib538" + includeGroup "top.offsetmonkey538.offsetconfig538" + } + } } } subprojects { apply plugin: "java" - archivesBaseName = "github-resourcepack-manager-${project.nameSuffix}" + base.archivesName = "github-resourcepack-manager-${project.nameSuffix}" version = "${project.mod_version}+${project.minecraft_version}" java { diff --git a/common/build.gradle b/common/build.gradle index 86dea47..fb89666 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,4 +1,5 @@ plugins { + id 'java-library' id 'com.gradleup.shadow' version '9.0.0-beta4' } @@ -11,25 +12,16 @@ repositories { includeGroup "com.mojang" } } - maven { - name = "OffsetMods538" - url = "https://maven.offsetmonkey538.top/releases" - content { - includeGroup "top.offsetmonkey538.meshlib" - includeGroup "top.offsetmonkey538.offsetconfig538" - includeGroup "top.offsetmonkey538.monkeylib538" - } - } } dependencies { implementation "org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}" - implementation "top.offsetmonkey538.offsetconfig538:offsetconfig538:${project.offsetconfig538_version}" - shadow implementation("top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}") + + shadow compileOnlyApi("top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}") shadow compileOnly("top.offsetmonkey538.meshlib:mesh-lib-api:${project.meshlib_version}") - // should be bundeled with minecraft + // should be bundled with minecraft shadow compileOnly("com.google.guava:guava:${project.guava_version}") shadow compileOnly("commons-io:commons-io:${project.commons_version}") shadow compileOnly("com.google.code.gson:gson:${project.gson_version}") diff --git a/common/gradle.properties b/common/gradle.properties index 41b5d26..0f283af 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -3,7 +3,4 @@ guava_version = 33.4.0-jre commons_version = 2.18.0 gson_version = 2.11.0 -## OffsetConfig538, check at https://github.com/OffsetMods538/OffsetConfig538 -offsetconfig538_version = 1.0.0-946f4f7 - nameSuffix = api \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 90cbd8c..c8fad89 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -10,9 +10,11 @@ import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; +import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; @@ -258,7 +260,11 @@ private static void sendUpdateMessage(final String updateMessage, @Nullable fina return; } - PlatformText.INSTANCE.sendUpdateMessage(updateMessage, updateHoverMessage, placeholders, adminsOnly); + try { + PlatformText.INSTANCE.sendUpdateMessage(TextFormattingApi.styleTextMultiline(StringUtils.replacePlaceholders(updateMessage, placeholders)), adminsOnly); + } catch (Exception e) { + throw new GithubResourcepackManagerException("Failed to style update message!", e); + } } private static String getOldResourcePackName() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java index 4757534..405dd71 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java @@ -1,14 +1,12 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; -import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; - -import java.util.Map; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformText { PlatformText INSTANCE = load(PlatformText.class); - void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException; + void sendUpdateMessage(final MonkeyLibText[] updateMessage, boolean adminsOnly); } diff --git a/fabric/build.gradle b/fabric/build.gradle index 28b205a..52d5ead 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -55,15 +55,6 @@ repositories { includeGroup "me.djtheredstoner" } } - maven { - name = "OffsetMods538" - url = "https://maven.offsetmonkey538.top/releases" - content { - includeGroup "top.offsetmonkey538.meshlib" - includeGroup "top.offsetmonkey538.monkeylib538" - includeGroup "top.offsetmonkey538.offsetconfig538" - } - } } configurations { @@ -90,13 +81,21 @@ dependencies { mappings "net.fabricmc:yarn:${project.yarn_version}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${devauth_version}" + modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${project.devauth_version}" - compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}" - modImplementation("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}+1.21.5") { + modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-1.20.5:${project.monkeylib538_version}+1.20.5") { exclude(group: "net.fabricmc.fabric-api") exclude(group: "top.offsetmonkey538.monkeylib538:monkeylib538-fabric") } + modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { + exclude(group: "net.fabricmc.fabric-api") + } + //modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { + // exclude(group: "net.fabricmc.fabric-api") + //} + //modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { + // exclude(group: "net.fabricmc.fabric-api") + //} modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" diff --git a/fabric/gradle.properties b/fabric/gradle.properties index c0ef59c..94ec4f1 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -3,7 +3,7 @@ # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. yarn_version = 1.21.4+build.8 -loader_version = 0.17.0 +loader_version = 0.17.1 fapi_version = 0.119.3+1.21.4 # Dependencies diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index 7a7a199..5e852a5 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -3,160 +3,28 @@ import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; -import net.minecraft.util.Formatting; -import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; - -import java.util.List; -import java.util.Map; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; public class FabricPlatformText implements PlatformText { - Style DEFAULT_STYLE = Style.EMPTY.withItalic(false).withColor(Formatting.WHITE); - - @Override - public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { + public void sendUpdateMessage(MonkeyLibText[] updateMessage, boolean adminsOnly) { + assert FabricPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); if (playerManager == null) return; - final String[] splitMessage = message.split("\n"); - - final HoverEvent hoverEvent; - try { - hoverEvent = hoverMessage == null ? null : new HoverEvent( - HoverEvent.Action.SHOW_TEXT, - getStyledText( - StringUtils.replacePlaceholders(hoverMessage, placeholders).replace("\\n", "\n") - ) - ); - } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update hover message!", e); - } - - for (int lineNumber = 0; lineNumber < splitMessage.length; lineNumber++) { - final String currentLineString = StringUtils.replacePlaceholders(splitMessage[lineNumber], placeholders).replace("\\n", "\n"); - final MutableText currentLine = Text.empty(); - try { - for (Text currentLineSibling : getStyledText(currentLineString).getSiblings()) { - final MutableText sibling = currentLineSibling.copy(); - - if (hoverEvent != null) sibling.setStyle(sibling.getStyle().withHoverEvent(hoverEvent)); - - final String siblingString = sibling.getString(); - if (!siblingString.contains("{packUpdateCommand}")) { - currentLine.append(sibling); - continue; - } - - final Style siblingStyle = sibling.getStyle(); - final String[] splitSibling = siblingString.split("\\{packUpdateCommand}"); - - if (splitSibling.length > 0) - currentLine.append(Text.literal(splitSibling[0]).setStyle(siblingStyle)); - - currentLine.append(Text.literal("[HERE]").setStyle(siblingStyle - .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.of("Click to update pack"))) - .withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/gh-rp-manager request-pack")) - )); - - if (splitSibling.length > 1) - currentLine.append(Text.literal(splitSibling[1]).setStyle(siblingStyle)); - } - } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update message at line number '%s'!", e, lineNumber); - } - - + for (final MonkeyLibText currentLine : updateMessage) { if (!adminsOnly) { - playerManager.broadcast(currentLine, false); + playerManager.broadcast(FabricMonkeyLibText.of(currentLine).getText(), false); continue; } for (final ServerPlayerEntity player : playerManager.getPlayerList()) { if (!playerManager.isOperator(player.getGameProfile())) continue; - player.sendMessageToClient(currentLine, false); + player.sendMessageToClient(FabricMonkeyLibText.of(currentLine).getText(), false); } } } - - private MutableText getStyledText(String text) throws Exception { - final MutableText result = Text.empty(); - Style style = DEFAULT_STYLE; - - boolean isFormattingCode = false; - boolean isEscaped = false; - char[] characters = text.toCharArray(); - for (int characterIndex = 0; characterIndex < characters.length; characterIndex++) { - char currentChar = characters[characterIndex]; - - if (isFormattingCode) { - // Hex color - if (currentChar == '#') { - if (characterIndex + 7 >= characters.length) throw new Exception("Unfinished hex code starting at character number '" + characterIndex + "'!"); - - try { - style = style.withColor(parseHexColor(text.substring(characterIndex, characterIndex + 7))); - } catch (Exception e) { - throw new Exception("Failed to parse hex color starting at character number '" + characterIndex + "'!", e); - } - - // Move pointer 6 characters ahead as we already read the whole hex code - characterIndex += 6; - isFormattingCode = false; - continue; - } - - style = getStyleForFormattingCode(currentChar, style); - - if (style == null) throw new Exception("Invalid formatting code at character number '" + characterIndex + "'!"); - - isFormattingCode = false; - continue; - } - - if (!isEscaped){ - switch (currentChar){ - case '&': - isFormattingCode = true; - continue; - case '\\': - isEscaped = true; - continue; - } - } - isEscaped = false; - - - final List siblings = result.getSiblings(); - final int lastSiblingIndex = siblings.size() - 1; - final Text lastSibling = siblings.isEmpty() ? Text.empty() : siblings.get(lastSiblingIndex); - - // Check if the style of the last sibling is the same as the current one - if (!siblings.isEmpty() && lastSibling.getStyle().equals(style)) { - // If so, set the last sibling to itself plus the new character - siblings.set(lastSiblingIndex, Text.literal(lastSibling.getString() + currentChar).setStyle(style)); - } else { - // Otherwise, just append a new sibling to the result - result.append(Text.literal(String.valueOf(currentChar)).setStyle(style)); - } - } - - return result; - } - - - private Style getStyleForFormattingCode(char formattingCode, Style currentStyle) { - if (formattingCode == 'r') return DEFAULT_STYLE; - - final Formatting formatting = Formatting.byCode(formattingCode); - if (formatting == null) return null; - - return currentStyle.withFormatting(formatting); - } - - public TextColor parseHexColor(String hexColor) throws Exception { - return TextColor.parse(hexColor).getOrThrow(Exception::new); - } } diff --git a/gradle.properties b/gradle.properties index 6d2e36c..e0a5b25 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,8 +7,8 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 1.0.5+1.21.4 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-eb3e2e1 +monkeylib538_version = 3.0.0-30682cc # Mod Properties mod_version = 5.0.0 -supported_minecraft_versions = >=1.19.2 +supported_minecraft_versions = >=1.20.5 diff --git a/paper/build.gradle b/paper/build.gradle index 66104b1..b49d520 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -25,15 +25,6 @@ repositories { includeGroup "com.mojang" } } - maven { - name = "OffsetMods538" - url = "https://maven.offsetmonkey538.top/releases" - content { - includeGroup "top.offsetmonkey538.meshlib" - includeGroup "top.offsetmonkey538.monkeylib538" - includeGroup "top.offsetmonkey538.offsetconfig538" - } - } } configurations { diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index 623645b..e9b1953 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -1,20 +1,33 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; -import net.minecraft.ChatFormatting; import net.minecraft.network.chat.*; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; -import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; - -import java.util.List; -import java.util.Map; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; public class PaperPlatformText implements PlatformText { @Override + public void sendUpdateMessage(MonkeyLibText[] updateMessage, boolean adminsOnly) { + for (final MonkeyLibText currentLine : updateMessage) { + final PlayerList players = MinecraftServer.getServer().getPlayerList(); + if (!adminsOnly) { + players.broadcastSystemMessage(Component.empty(), false); + // TODO: once I implement paper version of monke: players.broadcastSystemMessage(PaperMonkeyLibText.of(currentLine).getText(), false); + continue; + } + + for (final ServerPlayer player : players.players) { + if (!players.isOp(player.getGameProfile())) continue; + player.sendSystemMessage(Component.empty()); + // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(currentLine).getText()); + } + } + } + + /* public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { final String[] splitMessage = message.split("\n"); @@ -155,4 +168,5 @@ private static Style getStyleForFormattingCode(char formattingCode, Style curren return currentStyle.applyFormat(formatting); } + */ } From 71c06a44ecc34b39e6e5e5a0ce6ed59f3d8adb9b Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:37:48 +0200 Subject: [PATCH 25/89] Unused import --- .../githubresourcepackmanager/platform/PlatformText.java | 1 - .../platform/fabric/FabricPlatformText.java | 1 - .../platform/paper/PaperPlatformText.java | 1 - 3 files changed, 3 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java index 405dd71..3ad7527 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java @@ -1,6 +1,5 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index 5e852a5..2b3c0d7 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -3,7 +3,6 @@ import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.*; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index e9b1953..b6356e7 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -4,7 +4,6 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; From a07de908b1a785c818367b3504cc16f9e537848b Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:43:49 +0200 Subject: [PATCH 26/89] Use gray text for info logging in chat from trigger update command --- .../platform/fabric/FabricPlatformCommand.java | 2 +- .../platform/paper/PaperPlatformCommand.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index 97743ac..be4c826 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -90,7 +90,7 @@ public static void register(CommandDispatcher dispatcher, C private static void runTriggerUpdate(CommandContext context, boolean force) { final MonkeyLibLogger.LogListener infoListener = (message, error) -> { - context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message))); + context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message)).formatted(Formatting.GRAY)); }; final MonkeyLibLogger.LogListener warnListener = (message, error) -> { MutableText text = Text diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index 4c2b685..c5d60d6 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -85,7 +85,7 @@ public void registerGithubRpManagerCommand() { @SuppressWarnings("UnstableApiUsage") private void runTriggerUpdate(CommandContext context, boolean force) { final MonkeyLibLogger.LogListener infoListener = (message, error) -> { - context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message))); + context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message)).color(NamedTextColor.GRAY)); }; final MonkeyLibLogger.LogListener warnListener = (message, error) -> { Component text = Component From a3071e5a22743b62945cb0e6a898be9169a3c0a2 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Wed, 6 Aug 2025 20:06:04 +0200 Subject: [PATCH 27/89] Update monke to 7adde5c Use maonyk for command --- common/build.gradle | 3 +- common/gradle.properties | 3 +- .../GithubResourcepackManager.java | 3 +- .../command/GitPackManagerCommand.java | 74 +++++++++++ .../platform/PlatformCommand.java | 6 +- .../fabric/FabricPlatformCommand.java | 120 ++++------------- gradle.properties | 2 +- .../platform/paper/PaperPlatformCommand.java | 121 ++++-------------- 8 files changed, 136 insertions(+), 196 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java diff --git a/common/build.gradle b/common/build.gradle index fb89666..da64765 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -23,7 +23,8 @@ dependencies { // should be bundled with minecraft shadow compileOnly("com.google.guava:guava:${project.guava_version}") - shadow compileOnly("commons-io:commons-io:${project.commons_version}") + shadow compileOnly("commons-io:commons-io:${project.commonsio_version}") + shadow compileOnly("org.apache.commons:commons-lang3:${project.commonslang_version}") shadow compileOnly("com.google.code.gson:gson:${project.gson_version}") // Jetbrains annotations for gud code diff --git a/common/gradle.properties b/common/gradle.properties index 0f283af..9cd2a8d 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -1,6 +1,7 @@ jgit_version = 6.9.0.202403050737-r guava_version = 33.4.0-jre -commons_version = 2.18.0 +commonsio_version = 2.18.0 +commonslang_version = 3.18.0 gson_version = 2.11.0 nameSuffix = api \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index c8fad89..830b655 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -2,6 +2,7 @@ import org.apache.commons.io.FileUtils; import org.jetbrains.annotations.Nullable; +import top.offsetmonkey538.githubresourcepackmanager.command.GitPackManagerCommand; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; import top.offsetmonkey538.githubresourcepackmanager.config.ConfigHandler; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; @@ -52,7 +53,7 @@ private GithubResourcepackManager() { public static void initialize() { PlatformMain.INSTANCE.registerLogToAdminListener(); - PlatformCommand.INSTANCE.registerGithubRpManagerCommand(); + GitPackManagerCommand.register(); ConfigCommandApi.registerConfigCommand( config, () -> disabled = ConfigHandler.handleConfig(), diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java new file mode 100644 index 0000000..c8d083b --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java @@ -0,0 +1,74 @@ +package top.offsetmonkey538.githubresourcepackmanager.command; + +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import com.mojang.brigadier.context.CommandContext; +import org.apache.commons.lang3.exception.ExceptionUtils; +import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi; +import top.offsetmonkey538.monkeylib538.api.command.CommandRegistrationApi; +import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; + +import static com.mojang.brigadier.arguments.BoolArgumentType.bool; +import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; +import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.literal; +import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.sendText; + +public final class GitPackManagerCommand { + + public static void register() { + CommandRegistrationApi.registerCommand(createCommand()); + } + + private static LiteralArgumentBuilder createCommand() { + return literal("gh-rp-manager") + .then(literal("request-pack") + .requires(CommandAbstractionApi::executedByPlayer) + .executes(PlatformCommand.INSTANCE::executeRequestPackCommand) + ) + + .then(literal("trigger-update") + .requires(CommandAbstractionApi::isOp) + .executes( + context -> { + runTriggerUpdate(context, false); + return 1; + } + ) + .then(argument("force", bool()) + .executes( + context -> { + runTriggerUpdate(context, getBool(context, "force")); + return 1; + } + ) + ) + ); + } + + private static void runTriggerUpdate(CommandContext context, boolean force) { + final MonkeyLibLogger.LogListener infoListener = (message, error) -> { + sendText(context, MonkeyLibText.of(String.format("[%s] %s", MOD_ID, message)).applyStyle(style -> style.withColor(MonkeyLibStyle.Color.GRAY))); + }; + final MonkeyLibLogger.LogListener warnListener = (message, error) -> { + final MonkeyLibText text = MonkeyLibText + .of("[%s] %s".formatted(MOD_ID, message)) + .applyStyle(style -> style.withColor(MonkeyLibStyle.Color.YELLOW)); + + if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); + + sendText(context, text); + }; + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + + GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); + + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + } +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java index 425d1ff..5050000 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java @@ -1,9 +1,13 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import org.jetbrains.annotations.NotNull; + import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformCommand { PlatformCommand INSTANCE = load(PlatformCommand.class); - void registerGithubRpManagerCommand(); + int executeRequestPackCommand(final @NotNull CommandContext ctx) throws CommandSyntaxException; } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java index be4c826..b309e01 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java @@ -1,117 +1,41 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.builder.ArgumentBuilder; -import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.tree.CommandNode; -import com.mojang.brigadier.tree.LiteralCommandNode; -import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; -import net.minecraft.command.CommandRegistryAccess; +import com.mojang.brigadier.exceptions.CommandSyntaxException; import net.minecraft.command.ControlFlowAware; import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.HoverEvent; -import net.minecraft.text.MutableText; -import net.minecraft.text.Style; import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import org.apache.commons.lang3.exception.ExceptionUtils; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import org.jetbrains.annotations.NotNull; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.fabric.api.command.FabricCommandAbstractionApi; import java.util.Optional; -import static com.mojang.brigadier.arguments.BoolArgumentType.bool; -import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; -import static net.minecraft.server.command.CommandManager.argument; -import static net.minecraft.server.command.CommandManager.literal; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; - public class FabricPlatformCommand implements PlatformCommand { @Override - public void registerGithubRpManagerCommand() { - CommandRegistrationCallback.EVENT.register(FabricPlatformCommand::register); - } - - public static void register(CommandDispatcher dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) { - final LiteralArgumentBuilder command = literal("gh-rp-manager"); - - dispatcher.register(command - .then(literal("request-pack") - .requires(ServerCommandSource::isExecutedByPlayer) - .executes( - context -> { - final ServerPlayerEntity player = context.getSource().getPlayerOrThrow(); - final MinecraftServer.ServerResourcePackProperties resourcePackProperties = context.getSource().getServer().getResourcePackProperties().orElse(null); - if (resourcePackProperties == null) { - context.getSource().sendFeedback(() -> Text.literal("Failed to send pack update packet to client!"), true); - return 0; - } - - player.networkHandler.send( - new ResourcePackSendS2CPacket( - resourcePackProperties.id(), - resourcePackProperties.url(), - resourcePackProperties.hash(), - resourcePackProperties.isRequired(), - Optional.ofNullable(resourcePackProperties.prompt()) - ), - null - ); - - return ControlFlowAware.Command.SINGLE_SUCCESS; - }) - ) - - .then(literal("trigger-update") - .requires(source -> source.hasPermissionLevel(2)) - .executes( - context -> { - runTriggerUpdate(context, false); - return 1; - } - ) - .then(argument("force", bool()) - .executes( - context -> { - runTriggerUpdate(context, getBool(context, "force")); - return 1; - } - ) - ) - ) + public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { + final ServerCommandSource source = FabricCommandAbstractionApi.get(ctx); + final ServerPlayerEntity player = source.getPlayerOrThrow(); + final MinecraftServer.ServerResourcePackProperties resourcePackProperties = source.getServer().getResourcePackProperties().orElse(null); + if (resourcePackProperties == null) { + source.sendFeedback(() -> Text.literal("Failed to send pack update packet to client!"), true); + return 0; + } + + player.networkHandler.send( + new ResourcePackSendS2CPacket( + resourcePackProperties.id(), + resourcePackProperties.url(), + resourcePackProperties.hash(), + resourcePackProperties.isRequired(), + Optional.ofNullable(resourcePackProperties.prompt()) + ), + null ); - } - - private static void runTriggerUpdate(CommandContext context, boolean force) { - final MonkeyLibLogger.LogListener infoListener = (message, error) -> { - context.getSource().sendMessage(Text.literal(String.format("[%s] %s", MOD_ID, message)).formatted(Formatting.GRAY)); - }; - final MonkeyLibLogger.LogListener warnListener = (message, error) -> { - MutableText text = Text - .literal(String.format("[%s] %s", MOD_ID, message)) - .setStyle(Style.EMPTY.withColor(Formatting.YELLOW)); - - if (error != null) text.setStyle(Style.EMPTY.withColor(Formatting.YELLOW).withHoverEvent( - new HoverEvent( - HoverEvent.Action.SHOW_TEXT, - Text.literal(ExceptionUtils.getRootCauseMessage(error)) - ) - )); - - context.getSource().sendMessage(text); - }; - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); - - GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + return ControlFlowAware.Command.SINGLE_SUCCESS; } } diff --git a/gradle.properties b/gradle.properties index e0a5b25..af2a025 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 1.0.5+1.21.4 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-30682cc +monkeylib538_version = 3.0.0-7adde5c # Mod Properties mod_version = 5.0.0 diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java index c5d60d6..5e64904 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java @@ -2,110 +2,45 @@ import com.mojang.brigadier.Command; import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; import io.papermc.paper.command.brigadier.CommandSourceStack; -import io.papermc.paper.command.brigadier.Commands; -import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents; import net.kyori.adventure.resource.ResourcePackInfo; import net.kyori.adventure.resource.ResourcePackRequest; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.event.HoverEvent; -import net.kyori.adventure.text.format.NamedTextColor; import net.minecraft.server.MinecraftServer; -import org.apache.commons.lang.exception.ExceptionUtils; import org.bukkit.entity.Player; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import org.jetbrains.annotations.NotNull; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import java.net.URI; -import static com.mojang.brigadier.arguments.BoolArgumentType.bool; -import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; -import static io.papermc.paper.command.brigadier.Commands.argument; -import static io.papermc.paper.command.brigadier.Commands.literal; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; - public class PaperPlatformCommand implements PlatformCommand { @SuppressWarnings("UnstableApiUsage") @Override - public void registerGithubRpManagerCommand() { - PaperPlatformMain.getPlugin().getLifecycleManager().registerEventHandler(LifecycleEvents.COMMANDS, event -> { - final Commands commands = event. registrar(); - - commands.register(literal("gh-rp-manager") - .requires(commandSourceStack -> commandSourceStack.getExecutor() instanceof Player) - .then(literal("request-pack").executes( - context -> { - final Player player = (Player) context.getSource().getExecutor(); - if (player == null) return 0; - - final MinecraftServer.ServerResourcePackInfo resourcePackProperties = MinecraftServer.getServer().getServerResourcePack().orElse(null); - if (resourcePackProperties == null) { - context.getSource().getSender().sendMessage("Failed to send pack update packet to client!"); - return 0; - } - player.sendResourcePacks( - ResourcePackRequest.resourcePackRequest() - .packs( - ResourcePackInfo.resourcePackInfo( - resourcePackProperties.id(), - URI.create(resourcePackProperties.url()), - resourcePackProperties.hash() - ) - ) - .replace(true) - .required(resourcePackProperties.isRequired()) - .asResourcePackRequest() - ); - return Command.SINGLE_SUCCESS; - }) - ) - .then(literal("trigger-update") - .requires(source -> source.getSender().isOp()) - .executes( - context -> { - runTriggerUpdate(context, false); - return 1; - } - ) - .then(argument("force", bool()) - .executes( - context -> { - runTriggerUpdate(context, getBool(context, "force")); - return 1; - } - ) - ) - ) - .build() - ); - }); - } - - @SuppressWarnings("UnstableApiUsage") - private void runTriggerUpdate(CommandContext context, boolean force) { - final MonkeyLibLogger.LogListener infoListener = (message, error) -> { - context.getSource().getSender().sendMessage(Component.text(String.format("[%s] %s", MOD_ID, message)).color(NamedTextColor.GRAY)); - }; - final MonkeyLibLogger.LogListener warnListener = (message, error) -> { - Component text = Component - .text(String.format("[%s] %s", MOD_ID, message)) - .color(NamedTextColor.YELLOW); - - if (error != null) text = text.hoverEvent( - HoverEvent.showText( - Component.text(ExceptionUtils.getRootCauseMessage(error)) - ) - ); - - context.getSource().getSender().sendMessage(text); - }; - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); - - GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { + // TODO: once monke has papier: final CommandSourceStack source = PaperCommandAbstractionApi.get(ctx); + final CommandSourceStack source = null; + if (source == null) return 0; + final Player player = (Player) source.getExecutor(); + if (player == null) return 0; + + final MinecraftServer.ServerResourcePackInfo resourcePackProperties = MinecraftServer.getServer().getServerResourcePack().orElse(null); + if (resourcePackProperties == null) { + source.getSender().sendMessage("Failed to send pack update packet to client!"); + return 0; + } + player.sendResourcePacks( + ResourcePackRequest.resourcePackRequest() + .packs( + ResourcePackInfo.resourcePackInfo( + resourcePackProperties.id(), + URI.create(resourcePackProperties.url()), + resourcePackProperties.hash() + ) + ) + .replace(true) + .required(resourcePackProperties.isRequired()) + .asResourcePackRequest() + ); + return Command.SINGLE_SUCCESS; } } From 0852c88b3acb7d13b8e7bd22e5ae9ea9a63c9105 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 10 Aug 2025 18:32:58 +0200 Subject: [PATCH 28/89] Update monki to 6345c7b Implement hover message and request pack command again Fix #13 Add test command for update message I think stuff is working? Gotta get this stuff committed so it won't be secretly kept on this laptop forever --- .../GithubResourcepackManager.java | 63 +++++--- .../command/GitPackManagerCommand.java | 35 ++++- .../config/ModConfig.java | 136 ++++++++++++------ .../platform/PlatformText.java | 2 +- .../utils/StringUtils.java | 29 ++-- fabric/gradle.properties | 4 +- .../platform/fabric/FabricPlatformText.java | 18 ++- gradle.properties | 2 +- .../platform/paper/PaperPlatformText.java | 24 ++-- 9 files changed, 198 insertions(+), 115 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 830b655..c160100 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -15,6 +15,7 @@ import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; @@ -45,6 +46,8 @@ private GithubResourcepackManager() { public static final Pattern RESOURCEPACK_NAME_PATTERN = Pattern.compile("\\d+-"); public static final UUID RESOURCEPACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); + public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/gh-rp-manager request-pack"); + public static ConfigHolder config = ConfigManager.INSTANCE.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); public static ResourcePackHandler resourcePackHandler; @@ -168,17 +171,11 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update } // Generate placeholder map - final Map placeholders = new HashMap<>(); - if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); - placeholders.put("{packType}", "resource"); - placeholders.put("{downloadUrl}", config.get().getPackUrl(resourcePackHandler.getOutputPackName())); - placeholders.put("{updateType}", updateType.name()); - placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); - LOGGER.info("Placeholders: %s", placeholders); + final Map placeholders = generatePlaceholders(gitHandler, resourcePackHandler, updateType, "resource", wasUpdated); // Send chat message try { - if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, config.get().resourcePackProvider.updateMessageHoverMessage, wasUpdated, placeholders); + if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, wasUpdated, placeholders); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } @@ -224,16 +221,11 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType // Generate placeholder map - final Map placeholders = new HashMap<>(); - if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); - placeholders.put("{packType}", "data"); - placeholders.put("{updateType}", updateType.name()); - placeholders.put("{wasUpdated}", String.valueOf(true)); - LOGGER.info("Placeholders: %s", placeholders); + final Map placeholders = generatePlaceholders(gitHandler, null, updateType, "data", true); // Send chat message try { - sendUpdateMessage(config.get().dataPackProvider.updateMessage, config.get().dataPackProvider.updateMessageHoverMessage, true, placeholders, true); + sendUpdateMessage(config.get().dataPackProvider.updateMessage, true, placeholders, true); } catch (GithubResourcepackManagerException e) { LOGGER.error("Failed to send update message in chat!", e); } @@ -251,21 +243,48 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType } } - private static void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, boolean wasUpdated, final Map placeholders) throws GithubResourcepackManagerException { - sendUpdateMessage(updateMessage, updateHoverMessage, wasUpdated, placeholders, false); + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders) throws GithubResourcepackManagerException { + sendUpdateMessage(updateMessage, wasUpdated, placeholders, false); } - private static void sendUpdateMessage(final String updateMessage, @Nullable final String updateHoverMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { if (!wasUpdated) { LOGGER.info("Not sending chat message because pack was not updated."); return; } - try { - PlatformText.INSTANCE.sendUpdateMessage(TextFormattingApi.styleTextMultiline(StringUtils.replacePlaceholders(updateMessage, placeholders)), adminsOnly); - } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update message!", e); + for (final MonkeyLibText line : createUpdateMessage(updateMessage, placeholders)) + PlatformText.INSTANCE.sendUpdateMessage(line, adminsOnly); + } + + public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GithubResourcepackManagerException { + final MonkeyLibText[] result = new MonkeyLibText[updateMessage.length]; + + for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { + final String line = StringUtils.replacePlaceholders(updateMessage[lineIndex], placeholders, true, false); + + try { + result[lineIndex] = TextFormattingApi.styleText(line); + } catch (Exception e) { + throw new GithubResourcepackManagerException("Failed to style update message at line %s!", e, lineIndex); + } } + + return result; + } + + public static Map generatePlaceholders(final GitHandler gitHandler, final @Nullable ResourcePackHandler resourcePackHandler, final UpdateType updateType, final String packType, final boolean wasUpdated) { + final Map placeholders = new HashMap<>(); + + if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); + if (resourcePackHandler != null) placeholders.put("{downloadUrl}", config.get().getPackUrl(resourcePackHandler.getOutputPackName())); + placeholders.putAll(STATIC_PLACEHOLDERS); + placeholders.put("{packType}", packType); + placeholders.put("{updateType}", updateType.name()); + placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); + LOGGER.info("Placeholders: %s", placeholders); + + return placeholders; } private static String getOldResourcePackName() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java index c8d083b..0605219 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java @@ -4,6 +4,8 @@ import com.mojang.brigadier.context.CommandContext; import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi; import top.offsetmonkey538.monkeylib538.api.command.CommandRegistrationApi; @@ -11,10 +13,12 @@ import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import java.util.Map; + import static com.mojang.brigadier.arguments.BoolArgumentType.bool; import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.literal; import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.sendText; @@ -47,6 +51,12 @@ private static LiteralArgumentBuilder createCommand() { } ) ) + ) + + .then(literal("test-update-message") + .requires(CommandAbstractionApi::isOp) + .then(literal("resource").executes(context -> runTestUpdateMessage(context, true))) + .then(literal("data").executes(context -> runTestUpdateMessage(context, false))) ); } @@ -71,4 +81,27 @@ private static void runTriggerUpdate(CommandContext context, boolean for GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); } + + private static int runTestUpdateMessage(CommandContext context, boolean isResource) { + final GitHandler gitHandler = new GitHandler(); + try { + gitHandler.updateRepositoryAndGenerateCommitProperties(); + } catch (GithubResourcepackManagerException e) { + CommandAbstractionApi.sendError(context, "Failed to update repository, git related placeholders will not be replaced!"); + CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); + } + final Map placeholders = generatePlaceholders(gitHandler, isResource ? resourcePackHandler : null, UpdateType.COMMAND, isResource ? "resource" : "data", true); + + final MonkeyLibText[] text; + try { + text = createUpdateMessage(config.get().resourcePackProvider.updateMessage, placeholders); + } catch (GithubResourcepackManagerException e) { + CommandAbstractionApi.sendError(context, "Failed to create update message!"); + CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); + return 0; + } + + for (final MonkeyLibText line : text) CommandAbstractionApi.sendText(context, line); + return 1; + } } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index d92d3a5..ef35760 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager.config; -import blue.endless.jankson.Comment; +import blue.endless.jankson.*; import blue.endless.jankson.api.Marshaller; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -59,10 +59,11 @@ public static class ResourcePackProvider { @Comment("Where the mod will search for resource packs in the cloned repository. MUST NOT be same as or child of the 'rootLocation' of the datapack provider") public String rootLocation = "/resourcepacks"; - @Comment("Message sent in chat when pack has been updated. May be 'null' to disable.") - public String updateMessage = "Server resourcepack has been updated!\nPlease click {packUpdateCommand} to get the most up to date pack."; - @Comment("Message shown when hovering over the 'updateMessage' text. May be 'null' to disable.") - public String updateMessageHoverMessage = "{longDescription}"; + @Comment("Messages sent in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") + public String[] updateMessage = new String[] { + "&{hoverText,'{longDescription}','Server resourcepack has been updated!'}", + "&{hoverText,'{longDescription}','Please click &{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'} to get the most up to date pack.'}" + }; @Comment("Webhook to be sent when pack updating succeeded") public WebhookInfo successWebhook = new WebhookInfo(); @@ -85,11 +86,12 @@ public static class DataPackProvider { public boolean enabled = false; @Comment("Where the mod will search for data packs in the cloned repository. MUST NOT be same as or child of the 'rootLocation' of the resourcepack provider") public String rootLocation = "/datapacks"; - - @Comment("Message sent TO ADMINS in chat when pack has been updated. May be 'null' to disable.") - public String updateMessage = "Server datapacks has been updated!\nNew packs (if any) have to be enabled with the '/datapack enable` command.\nPlease run '/reload' or restart the server to reload datapacks."; - @Comment("Message shown when hovering over the 'updateMessage' text. May be 'null' to disable.") - public String updateMessageHoverMessage = "{longDescription}"; + @Comment("Messages sent TO ADMINS in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") + public String[] updateMessage = new String[] { + "&{hoverText,'{longDescription}','Server datapacks have been updated!'}", + "&{hoverText,'{longDescription}','New packs (if any) will need to be enabled with the &{hoverText,'Click to suggest','&{suggestCommand,'/datapack enable','&n/datapack enable'}'} command.'}", + "&{hoverText,'{longDescription}','Please run &{hoverText,'Click to suggest','&{suggestCommand,'/reload','&n/reload'}'} or restart the server to reload datapacks.'}" + }; @Comment("Webhook to be sent when pack updating succeeded") public WebhookInfo successWebhook = new WebhookInfo(); @@ -111,11 +113,6 @@ public static class WebhookInfo { public WebhookInfo() { } - public WebhookInfo(boolean enabled, String url, String body) { - this.enabled = enabled; - this.url = url; - this.body = body; - } @Comment("Whether or not this webhook is enabled") public boolean enabled = false; @@ -131,7 +128,7 @@ public void trigger(final boolean updateSucceeded, final Map pla try { //noinspection DataFlowIssue: Only returns null when `body` is null, which we have already checked String webhookBody = Files.readString(getBodyPath()); - webhookBody = StringUtils.replacePlaceholders(webhookBody, placeholders, true); + webhookBody = StringUtils.replacePlaceholders(webhookBody, placeholders, false, true); WebhookSender.send(webhookBody, getWebhookUrl(), updateType, updateSucceeded); } catch (IOException e) { @@ -155,8 +152,8 @@ public void trigger(final boolean updateSucceeded, final Map pla (original, jankson) -> { // 0 -> 1 original.put("branch", jankson.toJson(jankson.getMarshaller().marshall(String.class, original.get("githubRef")).replace("refs/heads/", ""))); - original.put("repoUrl", original.get("githubUrl")); - original.put("isRepoPrivate", original.get("isPrivate")); + datafixField(original, "githubUrl", "repoUrl"); + datafixField(original, "isPrivate", "isRepoPrivate"); }, (original, jankson) -> { // 1 -> 2 @@ -168,57 +165,102 @@ public void trigger(final boolean updateSucceeded, final Map pla final Marshaller marsh = jankson.getMarshaller(); // Server Info - final ServerInfo serverInfo = new ServerInfo(); + final JsonObject serverInfo = new JsonObject(); - serverInfo.publicIp = marsh.marshall(String.class, original.get("serverPublicIp")); - serverInfo.proxyPort = marsh.marshall(String.class, original.get("proxyPort")); + datafixField(original, "serverPublicIp", serverInfo, "publicIp"); + datafixField(original, "proxyPort", serverInfo, "proxyPort"); - original.put("serverInfo", jankson.toJson(serverInfo)); + original.put("serverInfo", serverInfo); // Repository Info - final RepositoryInfo repositoryInfo = new RepositoryInfo(); + final JsonObject repositoryInfo = new JsonObject(); + + datafixField(original, "branch", repositoryInfo, "branch"); + datafixField(original, "repoUrl", repositoryInfo, "url"); + + datafixField(original, "isRepoPrivate", repositoryInfo, "isPrivate"); - repositoryInfo.branch = marsh.marshall(String.class, original.get("branch")); - repositoryInfo.url = marsh.marshall(String.class, original.get("repoUrl")); - repositoryInfo.isPrivate = marsh.marshall(Boolean.class, original.get("isRepoPrivate")); - repositoryInfo.username = marsh.marshall(String.class, original.get("githubUsername")); - repositoryInfo.token = marsh.marshall(String.class, original.get("githubToken")); + datafixField(original, "githubUsername", repositoryInfo, "username"); + datafixField(original, "githubToken", repositoryInfo, "token"); - original.put("repositoryInfo", jankson.toJson(repositoryInfo)); + original.put("repositoryInfo", repositoryInfo); // Resource Pack Provider - final ResourcePackProvider resourcePackProvider = new ResourcePackProvider(); + final JsonObject resourcePackProvider = new JsonObject(); - resourcePackProvider.enabled = true; - resourcePackProvider.rootLocation = marsh.marshall(String.class, original.get("resourcePackRoot")); - resourcePackProvider.updateMessage = marsh.marshall(String.class, original.get("packUpdateMessage")); - resourcePackProvider.updateMessageHoverMessage = marsh.marshall(String.class, original.get("packUpdateMessageHoverMessage")); + datafixField(original, "resourcePackRoot", serverInfo, "rootLocation"); - final String webhookUrl = marsh.marshall(String.class, original.get("webhookUrl")); - final String webhookBody = marsh.marshall(String.class, original.get("webhookBody")); + datafixField(original, "packUpdateMessage", serverInfo, "updateMessage"); + datafixField(original, "packUpdateMessageHoverMessage", serverInfo, "updateMessageHoverMessage"); + final String webhookUrl = datafixGetAndRemove(marsh, String.class, original, "webhookUrl"); + final String webhookBody = datafixGetAndRemove(marsh, String.class, original, "webhookBody"); if (webhookUrl != null && webhookBody != null) { - final WebhookInfo webhookInfo = new WebhookInfo( - true, - webhookUrl, - webhookBody - ); + final JsonObject webhookInfo = new JsonObject(); + webhookInfo.put("enabled", jankson.toJson(true)); + webhookInfo.put("url", jankson.toJson(webhookUrl)); + webhookInfo.put("body", jankson.toJson(webhookBody)); + + resourcePackProvider.put("successWebhook", webhookInfo); + if (!webhookBody.contains("discord")) resourcePackProvider.put("failWebhook", webhookInfo); + } + + original.put("resourcePackProvider", resourcePackProvider); + }, + (original, jankson) -> { + // 3 -> 4 + final Marshaller marsh = jankson.getMarshaller(); - resourcePackProvider.successWebhook = webhookInfo; + final JsonObject resourcePackProvider = (JsonObject) original.get("resourcePackProvider"); + assert resourcePackProvider != null; - if (!webhookBody.contains("discord")) { - resourcePackProvider.failWebhook = webhookInfo; - } + final String updateMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessage"); + if (updateMessage == null) { + original.put("updateMessage", JsonNull.INSTANCE); + return; } - original.put("resourcePackProvider", jankson.toJson(resourcePackProvider)); + final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessageHoverMessage"); + resourcePackProvider.remove("updateMessageHoverMessage"); + + final String[] newUpdateMessage = updateMessage.split("\\\\n"); + for (int i = 0; i < newUpdateMessage.length; i++) { + newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); + if (updateMessageHoverMessage != null) newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); + } + resourcePackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); } }; } + private static void datafixField(final @NotNull JsonObject originalObject, final @NotNull String originalKey, final @NotNull String newKey) { + datafixField(originalObject, originalKey, originalObject, newKey); + } + private static void datafixField(final @NotNull JsonObject originalObject, final @NotNull String originalKey, final @NotNull JsonObject newObject, final @NotNull String newKey) { + final JsonElement originalValue = originalObject.get(originalKey); + if (originalValue == null) { + LOGGER.warn("JSON of current config doesn't contain value with key '%s', new value with key '%s' will be reset to default!", originalKey, newKey); + return; + } + + newObject.put(newKey, originalValue); + originalObject.remove(originalKey); + } + + @Nullable + private static T datafixGetAndRemove(final @NotNull Marshaller marsh, final @NotNull Class type, final @NotNull JsonObject object, final @NotNull String key) { + final JsonElement jsonValue = object.get(key); + if (jsonValue == null) { + LOGGER.warn("JSON of current config doesn't contain value with key '%s'!", key); + return null; + } + object.remove(key); + return marsh.marshall(type, jsonValue); + } + @Override public int getConfigVersion() { - return 3; + return 4; } @Override diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java index 3ad7527..84272d1 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java @@ -7,5 +7,5 @@ public interface PlatformText { PlatformText INSTANCE = load(PlatformText.class); - void sendUpdateMessage(final MonkeyLibText[] updateMessage, boolean adminsOnly); + void sendUpdateMessage(final MonkeyLibText updateMessage, boolean adminsOnly); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java index 10153cf..7468c7b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java @@ -17,30 +17,23 @@ private StringUtils() { /** * Replaces all instances of the keys in the placeholders map with their values. *

- * Same as calling {@link StringUtils#replacePlaceholders(String, Map, boolean)} with {@code escapeQuotes} false. + * Replaces {@code '} with {@code \'} in the placeholders if {@code escapeSingleQuotes} is true. + *
+ * Replaces {@code "} with {@code \"} in the placeholders if {@code escapeDoubleQuotes} is true. * * @param string The string to replace placeholders in. * @param placeholders The placeholders to replace. + * @param escapeSingleQuotes Whether single quotes (') should be escaped. + * @param escapeDoubleQuotes Whether double quotes (") should be escaped. * @return The original string with all instances of the keys in the placeholders map replaced with their values. */ - public static String replacePlaceholders(String string, Map placeholders) { - return replacePlaceholders(string, placeholders, false); - } - - /** - * Replaces all instances of the keys in the placeholders map with their values. - *

- * Replaces {@code "} with {@code \"} in the placeholders if {@code escapeQuotes} is true. - * - * @param string The string to replace placeholders in. - * @param placeholders The placeholders to replace. - * @param escapeQuotes Whether quotes should be escaped. - * @return The original string with all instances of the keys in the placeholders map replaced with their values. - */ - public static String replacePlaceholders(String string, Map placeholders, boolean escapeQuotes) { + public static String replacePlaceholders(String string, Map placeholders, boolean escapeSingleQuotes, boolean escapeDoubleQuotes) { for (Map.Entry entry : placeholders.entrySet()) { - // I love strings. "\"" matches " and "\\\"" matches \" - string = string.replace(entry.getKey(), escapeQuotes ? entry.getValue().replace("\"", "\\\"") : entry.getValue()); + String placeholderValue = entry.getValue(); + if (escapeSingleQuotes) placeholderValue = placeholderValue.replace("'", "\\'"); + if (escapeDoubleQuotes) placeholderValue = placeholderValue.replace("\"", "\\\""); + + string = string.replace(entry.getKey(), placeholderValue); } return string; } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index 94ec4f1..7695676 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -3,8 +3,8 @@ # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. yarn_version = 1.21.4+build.8 -loader_version = 0.17.1 -fapi_version = 0.119.3+1.21.4 +loader_version = 0.17.2 +fapi_version = 0.119.4+1.21.4 # Dependencies ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index 2b3c0d7..a1e847b 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -9,21 +9,19 @@ public class FabricPlatformText implements PlatformText { @Override - public void sendUpdateMessage(MonkeyLibText[] updateMessage, boolean adminsOnly) { + public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { assert FabricPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); if (playerManager == null) return; - for (final MonkeyLibText currentLine : updateMessage) { - if (!adminsOnly) { - playerManager.broadcast(FabricMonkeyLibText.of(currentLine).getText(), false); - continue; - } + if (!adminsOnly) { + playerManager.broadcast(FabricMonkeyLibText.of(updateMessage).getText(), false); + return; + } - for (final ServerPlayerEntity player : playerManager.getPlayerList()) { - if (!playerManager.isOperator(player.getGameProfile())) continue; - player.sendMessageToClient(FabricMonkeyLibText.of(currentLine).getText(), false); - } + for (final ServerPlayerEntity player : playerManager.getPlayerList()) { + if (!playerManager.isOperator(player.getGameProfile())) continue; + player.sendMessageToClient(FabricMonkeyLibText.of(updateMessage).getText(), false); } } } diff --git a/gradle.properties b/gradle.properties index af2a025..8c2a0ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 1.0.5+1.21.4 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-7adde5c +monkeylib538_version = 3.0.0-6345c7b # Mod Properties mod_version = 5.0.0 diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index b6356e7..2bfbef4 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -9,20 +9,18 @@ public class PaperPlatformText implements PlatformText { @Override - public void sendUpdateMessage(MonkeyLibText[] updateMessage, boolean adminsOnly) { - for (final MonkeyLibText currentLine : updateMessage) { - final PlayerList players = MinecraftServer.getServer().getPlayerList(); - if (!adminsOnly) { - players.broadcastSystemMessage(Component.empty(), false); - // TODO: once I implement paper version of monke: players.broadcastSystemMessage(PaperMonkeyLibText.of(currentLine).getText(), false); - continue; - } + public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { + final PlayerList players = MinecraftServer.getServer().getPlayerList(); + if (!adminsOnly) { + players.broadcastSystemMessage(Component.empty(), false); + // TODO: once I implement paper version of monke: players.broadcastSystemMessage(PaperMonkeyLibText.of(updateMessage).getText(), false); + return; + } - for (final ServerPlayer player : players.players) { - if (!players.isOp(player.getGameProfile())) continue; - player.sendSystemMessage(Component.empty()); - // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(currentLine).getText()); - } + for (final ServerPlayer player : players.players) { + if (!players.isOp(player.getGameProfile())) continue; + player.sendSystemMessage(Component.empty()); + // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(updateMessage).getText()); } } From df5ef9ef6cf67ef8717f15b8d82863e83fbb737b Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 30 Aug 2025 18:37:50 +0300 Subject: [PATCH 29/89] fix config fixing --- .../config/ModConfig.java | 56 ++++++++++++++----- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index ef35760..c2f58b4 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -211,24 +211,52 @@ public void trigger(final boolean updateSucceeded, final Map pla // 3 -> 4 final Marshaller marsh = jankson.getMarshaller(); - final JsonObject resourcePackProvider = (JsonObject) original.get("resourcePackProvider"); - assert resourcePackProvider != null; - - final String updateMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessage"); - if (updateMessage == null) { - original.put("updateMessage", JsonNull.INSTANCE); - return; + { + final JsonObject resourcePackProvider = (JsonObject) original.get("resourcePackProvider"); + assert resourcePackProvider != null; + + final String updateMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessage"); + if (updateMessage == null) { + original.put("updateMessage", JsonNull.INSTANCE); + return; + } + + final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessageHoverMessage"); + resourcePackProvider.remove("updateMessageHoverMessage"); + + final String[] newUpdateMessage = updateMessage.split("\\n"); + for (int i = 0; i < newUpdateMessage.length; i++) { + newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); + if (updateMessageHoverMessage != null) + newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); + } + resourcePackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); + + original.put("resourcePackProvider", resourcePackProvider); } + { + + final JsonObject dataPackProvider = (JsonObject) original.get("dataPackProvider"); + assert dataPackProvider != null; + + final String updateMessage = datafixGetAndRemove(marsh, String.class, dataPackProvider, "updateMessage"); + if (updateMessage == null) { + original.put("updateMessage", JsonNull.INSTANCE); + return; + } + + final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, dataPackProvider, "updateMessageHoverMessage"); + dataPackProvider.remove("updateMessageHoverMessage"); - final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessageHoverMessage"); - resourcePackProvider.remove("updateMessageHoverMessage"); + final String[] newUpdateMessage = updateMessage.split("\\n"); + for (int i = 0; i < newUpdateMessage.length; i++) { + newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); + if (updateMessageHoverMessage != null) newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); + } + dataPackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); - final String[] newUpdateMessage = updateMessage.split("\\\\n"); - for (int i = 0; i < newUpdateMessage.length; i++) { - newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); - if (updateMessageHoverMessage != null) newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); + original.put("dataPackProvider", dataPackProvider); } - resourcePackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); } }; } From 62fff023b408c2711572e965edd38e5f781868da Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 4 Sep 2025 16:45:35 +0300 Subject: [PATCH 30/89] fix update message test command only sending resource pack test, even when data is selected --- .../command/GitPackManagerCommand.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java index 0605219..3bf655e 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java @@ -89,15 +89,17 @@ private static int runTestUpdateMessage(CommandContext context, boolean } catch (GithubResourcepackManagerException e) { CommandAbstractionApi.sendError(context, "Failed to update repository, git related placeholders will not be replaced!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); + LOGGER.error("Failed to update repository, git related placeholders will not be replaced!", e); } final Map placeholders = generatePlaceholders(gitHandler, isResource ? resourcePackHandler : null, UpdateType.COMMAND, isResource ? "resource" : "data", true); final MonkeyLibText[] text; try { - text = createUpdateMessage(config.get().resourcePackProvider.updateMessage, placeholders); + text = createUpdateMessage(isResource ? config.get().resourcePackProvider.updateMessage : config.get().dataPackProvider.updateMessage, placeholders); } catch (GithubResourcepackManagerException e) { CommandAbstractionApi.sendError(context, "Failed to create update message!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); + LOGGER.error("Failed to create update message for %spack!", e, isResource ? "resource" : "data"); return 0; } From f5b888d6509b221677ca6b47c61a7b85b6bb2f2e Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:20:27 +0300 Subject: [PATCH 31/89] fix fixing again --- .../config/ModConfig.java | 68 ++++++------------- 1 file changed, 22 insertions(+), 46 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index c2f58b4..a63b787 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -211,52 +211,8 @@ public void trigger(final boolean updateSucceeded, final Map pla // 3 -> 4 final Marshaller marsh = jankson.getMarshaller(); - { - final JsonObject resourcePackProvider = (JsonObject) original.get("resourcePackProvider"); - assert resourcePackProvider != null; - - final String updateMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessage"); - if (updateMessage == null) { - original.put("updateMessage", JsonNull.INSTANCE); - return; - } - - final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, resourcePackProvider, "updateMessageHoverMessage"); - resourcePackProvider.remove("updateMessageHoverMessage"); - - final String[] newUpdateMessage = updateMessage.split("\\n"); - for (int i = 0; i < newUpdateMessage.length; i++) { - newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); - if (updateMessageHoverMessage != null) - newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); - } - resourcePackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); - - original.put("resourcePackProvider", resourcePackProvider); - } - { - - final JsonObject dataPackProvider = (JsonObject) original.get("dataPackProvider"); - assert dataPackProvider != null; - - final String updateMessage = datafixGetAndRemove(marsh, String.class, dataPackProvider, "updateMessage"); - if (updateMessage == null) { - original.put("updateMessage", JsonNull.INSTANCE); - return; - } - - final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, dataPackProvider, "updateMessageHoverMessage"); - dataPackProvider.remove("updateMessageHoverMessage"); - - final String[] newUpdateMessage = updateMessage.split("\\n"); - for (int i = 0; i < newUpdateMessage.length; i++) { - newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); - if (updateMessageHoverMessage != null) newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i]); - } - dataPackProvider.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); - - original.put("dataPackProvider", dataPackProvider); - } + original.put("resourcePackProvider", datafix3to4UpdateMessage((JsonObject) original.get("resourcePackProvider"), marsh)); + original.put("dataPackProvider", datafix3to4UpdateMessage((JsonObject) original.get("dataPackProvider"), marsh)); } }; } @@ -286,6 +242,26 @@ private static T datafixGetAndRemove(final @NotNull Marshaller marsh, final return marsh.marshall(type, jsonValue); } + private static JsonObject datafix3to4UpdateMessage(final @NotNull JsonObject originalJson, final @NotNull Marshaller marsh) { + final String updateMessage = datafixGetAndRemove(marsh, String.class, originalJson, "updateMessage"); + if (updateMessage == null) { + originalJson.put("updateMessage", JsonNull.INSTANCE); + return originalJson; + } + + final String updateMessageHoverMessage = datafixGetAndRemove(marsh, String.class, originalJson, "updateMessageHoverMessage"); + + final String[] newUpdateMessage = updateMessage.split("\\n"); + for (int i = 0; i < newUpdateMessage.length; i++) { + newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); + if (updateMessageHoverMessage != null) + newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i].replace("'", "\\'")); + } + originalJson.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); + + return originalJson; + } + @Override public int getConfigVersion() { return 4; From 6bb77b114bec82ff04d19dcdf867d5fe87aeb495 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:36:59 +0300 Subject: [PATCH 32/89] correct handling of admin message queue --- .../GithubResourcepackManager.java | 42 +++++++++++++++++-- .../platform/PlatformMain.java | 16 ++++++- .../platform/fabric/FabricPlatformMain.java | 42 +++++++------------ .../platform/paper/PaperPlatformMain.java | 33 ++++++++++++++- .../platform/paper/PaperPlugin.java | 22 +--------- 5 files changed, 100 insertions(+), 55 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index c160100..b33cb71 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,6 +1,8 @@ package top.offsetmonkey538.githubresourcepackmanager; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.command.GitPackManagerCommand; import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; @@ -15,6 +17,7 @@ import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; @@ -48,14 +51,22 @@ private GithubResourcepackManager() { public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/gh-rp-manager request-pack"); - public static ConfigHolder config = ConfigManager.INSTANCE.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); + private static final List MESSAGE_QUEUE = new ArrayList<>(); + + @SuppressWarnings("NotNullFieldNotInitialized") + public static @NotNull ConfigHolder config; public static ResourcePackHandler resourcePackHandler; private static boolean disabled; public static void initialize() { - PlatformMain.INSTANCE.registerLogToAdminListener(); + addLogToAdminListeners(); + PlatformMain.INSTANCE.registerSendMessageQueueOnAdminJoin(MESSAGE_QUEUE); + + // config should be initialized after the error listeners + config = ConfigManager.INSTANCE.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); + GitPackManagerCommand.register(); ConfigCommandApi.registerConfigCommand( config, @@ -76,6 +87,24 @@ public static void initialize() { PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART)); } + private static void addLogToAdminListeners() { + LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibLogger.LogLevel.ERROR, MonkeyLibStyle.Color.RED)); + LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibLogger.LogLevel.WARN, MonkeyLibStyle.Color.YELLOW)); + } + + private static MonkeyLibLogger.LogListener createLogToAdminListener(MonkeyLibLogger.LogLevel logLevel, int textColor) { + return (message, error) -> { + final MonkeyLibText text = MonkeyLibText + .of("[%s] %s".formatted(MOD_ID, message)) + .applyStyle(style -> style.withColor(textColor)); + + if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); + + PlatformMain.INSTANCE.sendMessageToAdmins(text); + MESSAGE_QUEUE.addLast(text); + }; + } + private static void createFolderStructure() throws GithubResourcepackManagerException { try { Files.createDirectories(RESOURCEPACK_OUTPUT_FOLDER); @@ -87,6 +116,11 @@ private static void createFolderStructure() throws GithubResourcepackManagerExce } public static void updatePack(final UpdateType updateType) { + if (updateType != UpdateType.RESTART) { + LOGGER.debug("Clearing admin message queue before updating after a restart..."); + MESSAGE_QUEUE.clear(); + } + if (disabled) { LOGGER.warn("Skipping pack updating because config was invalid!"); return; @@ -177,7 +211,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update try { if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, wasUpdated, placeholders); } catch (GithubResourcepackManagerException e) { - LOGGER.error("Failed to send update message in chat!", e); + LOGGER.error("Failed to send update message for resource pack in chat!", e); } // Trigger webhooks @@ -227,7 +261,7 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType try { sendUpdateMessage(config.get().dataPackProvider.updateMessage, true, placeholders, true); } catch (GithubResourcepackManagerException e) { - LOGGER.error("Failed to send update message in chat!", e); + LOGGER.error("Failed to send update message for datapack in chat!", e); } // Trigger webhooks diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index cdef7a5..b6ea4be 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -1,6 +1,9 @@ package top.offsetmonkey538.githubresourcepackmanager.platform; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; + import java.nio.file.Path; +import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; @@ -32,7 +35,16 @@ public interface PlatformMain { void refreshDatapacks(); /** - * Registers log listeners for reporting errors to admins + * Sends provided message to currently online admins + * + * @param message the message to send + */ + void sendMessageToAdmins(final MonkeyLibText message); + + /** + * Sends messages contained in the provided list to admins when they join + * + * @param messageQueue list containing messages to send to admins when they join. Contents can be changed after calling this method. */ - void registerLogToAdminListener(); + void registerSendMessageQueueOnAdminJoin(final List messageQueue); } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 501db61..1424619 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -16,29 +16,24 @@ import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; import java.nio.file.Path; import java.util.LinkedList; +import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { private static @Nullable MinecraftServer minecraftServer = null; - private static final LinkedList messageQueue = new LinkedList<>(); @Override public void onInitializeServer() { GithubResourcepackManager.initialize(); ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer1 -> minecraftServer = minecraftServer1); - ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { - if (!minecraftServer1.getPlayerManager().isOperator(serverPlayNetworkHandler.player.getGameProfile())) return; - - for (Text text : messageQueue) { - serverPlayNetworkHandler.player.sendMessage(text); - } - }); } public static @Nullable MinecraftServer getServer() { @@ -57,27 +52,20 @@ public void runOnServerStart(Runnable work) { } @Override - public void registerLogToAdminListener() { - LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, (message, error) -> { - MutableText text = Text - .literal(String.format("[%s] %s", MOD_ID, message)) - .setStyle(Style.EMPTY.withColor(Formatting.RED)); - if (error != null) text = text.setStyle(Style.EMPTY.withColor(Formatting.RED).withHoverEvent( - new HoverEvent( - HoverEvent.Action.SHOW_TEXT, - Text.literal(ExceptionUtils.getRootCauseMessage(error)) - ) - )); + public void sendMessageToAdmins(MonkeyLibText message) { + if (getServer() == null) return; + for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { + if (!getServer().getPlayerManager().isOperator(player.getGameProfile())) continue; + player.sendMessage(FabricMonkeyLibText.of(message).getText(), false); + } + } - boolean sent = false; - if (getServer() != null) for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { - if (!getServer().getPlayerManager().isOperator(player.getGameProfile())) continue; - player.sendMessage(text, false); - sent = true; - } - if (sent) return; + @Override + public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { + if (!minecraftServer1.getPlayerManager().isOperator(serverPlayNetworkHandler.player.getGameProfile())) return; - messageQueue.addLast(text); + for (MonkeyLibText text : messageQueue) serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(text).getText()); }); } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 43195f7..7027c19 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -1,15 +1,23 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +import net.kyori.adventure.text.ComponentLike; import net.minecraft.server.MinecraftServer; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang.exception.ExceptionUtils; +import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerJoinEvent; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import java.nio.file.Path; +import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; @@ -33,7 +41,30 @@ public void refreshDatapacks() { } @Override - public void registerLogToAdminListener() { + public void sendMessageToAdmins(MonkeyLibText message) { + for (final OfflinePlayer operator : plugin.getServer().getOperators()) { + if (operator.getPlayer() == null) continue; + // todo: once monkeylib has da paper: operator.getPlayer().sendMessage(PaperMonkeyLibText.of(text)); + } + } + + @Override + public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + record AdminMessageQueueEventHandler(List messageQueue) implements Listener { + @EventHandler(priority = EventPriority.MONITOR) + public void onPlayerJoin(PlayerJoinEvent event) { + if (!event.getPlayer().isOp()) return; + + for (MonkeyLibText text : messageQueue) { + // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(text)); + } + } + } + + Bukkit.getPluginManager().registerEvents(new AdminMessageQueueEventHandler(messageQueue), getPlugin()); + } + + public void sendMessageToAdmins() { LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, (message, error) -> { Component text = Component .text(String.format("[%s] %s", MOD_ID, message)) diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java index 5dc7a85..55777cc 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java @@ -1,37 +1,17 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; -import net.kyori.adventure.text.Component; -import org.bukkit.Bukkit; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.plugin.java.JavaPlugin; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.meshlib.MeshLib; -import java.util.LinkedList; - -public class PaperPlugin extends JavaPlugin implements Listener { - public final LinkedList messageQueue = new LinkedList<>(); +public class PaperPlugin extends JavaPlugin { @Override public void onEnable() { - Bukkit.getPluginManager().registerEvents(this, this); MeshLib.initialize(); PaperPlatformMain.setPlugin(this); GithubResourcepackManager.initialize(); } - - @EventHandler(priority = EventPriority.MONITOR) - public void onPlayerJoin(PlayerJoinEvent event) { - if (!event.getPlayer().isOp()) return; - - for (Component text : messageQueue) { - event.getPlayer().sendMessage(text); - } - messageQueue.clear(); - } } From aa88371a77191bf1903944b9c993a89d862240d7 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:37:31 +0300 Subject: [PATCH 33/89] typo --- .../githubresourcepackmanager/handler/DataPackHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java index 177a535..b209fa8 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -103,7 +103,7 @@ private void writeStateFile(List files) throws IOException { private State readStateFile() throws IOException { if (Files.notExists(STATE_FILE)) { - LOGGER.warn("State file '%s' not found! No datapacks will be deleted!"); + LOGGER.warn("State file '%s' not found! No datapacks will be deleted!".formatted(STATE_FILE)); return new State(new String[]{}); } From 15e6fb5a5908fc40622ac9651157860913b8de06 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 4 Sep 2025 21:42:14 +0300 Subject: [PATCH 34/89] cleanup also the paper version probably builds now? still won't work though ofc --- .../config/ConfigHandler.java | 1 - .../handler/DataPackHandler.java | 1 - .../handler/GitHandler.java | 1 - .../handler/ResourcePackHandler.java | 1 - .../platform/PlatformServerProperties.java | 1 - .../platform/fabric/FabricPlatformMain.java | 9 -- .../platform/fabric/FabricPlatformText.java | 1 - .../platform/paper/PaperPlatformMain.java | 35 ----- .../platform/paper/PaperPlatformText.java | 143 ------------------ 9 files changed, 193 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java index e7b24fc..0b2fc06 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java @@ -16,7 +16,6 @@ import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public final class ConfigHandler { private ConfigHandler() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java index b209fa8..4b81956 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java @@ -13,7 +13,6 @@ import java.util.stream.Stream; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class DataPackHandler { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java index 018250b..fdac1e4 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java @@ -25,7 +25,6 @@ import java.util.Optional; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class GitHandler { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java index bf0e027..7c4ac35 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java @@ -18,7 +18,6 @@ import java.util.stream.Stream; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class ResourcePackHandler { private Path outputPackPath; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java index 5621e7c..5685317 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java @@ -9,7 +9,6 @@ import java.util.Map; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; public interface PlatformServerProperties { diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 1424619..4bea390 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -6,25 +6,16 @@ import net.fabricmc.loader.api.FabricLoader; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; -import net.minecraft.text.HoverEvent; -import net.minecraft.text.MutableText; -import net.minecraft.text.Style; -import net.minecraft.text.Text; -import net.minecraft.util.Formatting; -import org.apache.commons.lang3.exception.ExceptionUtils; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; import java.nio.file.Path; -import java.util.LinkedList; import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { private static @Nullable MinecraftServer minecraftServer = null; diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index a1e847b..f7335eb 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -2,7 +2,6 @@ import net.minecraft.server.PlayerManager; import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.*; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 7027c19..91c7cea 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -1,11 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; -import net.kyori.adventure.text.ComponentLike; import net.minecraft.server.MinecraftServer; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.event.HoverEvent; -import net.kyori.adventure.text.format.NamedTextColor; -import org.apache.commons.lang.exception.ExceptionUtils; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.event.EventHandler; @@ -13,15 +8,11 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import java.nio.file.Path; import java.util.List; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; - public class PaperPlatformMain implements PlatformMain { private static PaperPlugin plugin; @@ -64,32 +55,6 @@ public void onPlayerJoin(PlayerJoinEvent event) { Bukkit.getPluginManager().registerEvents(new AdminMessageQueueEventHandler(messageQueue), getPlugin()); } - public void sendMessageToAdmins() { - LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, (message, error) -> { - Component text = Component - .text(String.format("[%s] %s", MOD_ID, message)) - .color(NamedTextColor.RED); - - if (error != null) text = text.hoverEvent( - HoverEvent.showText( - Component.text(ExceptionUtils.getRootCauseMessage(error)) - ) - ); - - - boolean sent = false; - for (final OfflinePlayer operator : plugin.getServer().getOperators()) { - if (operator.getPlayer() == null) continue; - operator.getPlayer().sendMessage(text); - sent = true; - } - - if (sent) return; - - plugin.messageQueue.addLast(text); - }); - } - public static void setPlugin(PaperPlugin plugin) { PaperPlatformMain.plugin = plugin; } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java index 2bfbef4..50e3ab6 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java @@ -23,147 +23,4 @@ public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(updateMessage).getText()); } } - - /* - public void sendUpdateMessage(final String message, @Nullable final String hoverMessage, Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { - final String[] splitMessage = message.split("\n"); - - final HoverEvent hoverEvent; - try { - hoverEvent = hoverMessage == null ? null : new HoverEvent( - HoverEvent.Action.SHOW_TEXT, - getStyledText( - StringUtils.replacePlaceholders(hoverMessage, placeholders).replace("\\n", "\n") - ) - ); - } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update hover message!", e); - } - - for (int lineNumber = 0; lineNumber < splitMessage.length; lineNumber++) { - final String currentLineString = StringUtils.replacePlaceholders(splitMessage[lineNumber], placeholders).replace("\\n", "\n"); - final MutableComponent currentLine = Component.empty(); - try { - for (Component currentLineSibling : getStyledText(currentLineString).getSiblings()) { - final MutableComponent sibling = currentLineSibling.copy(); - - if (hoverEvent != null) sibling.setStyle(sibling.getStyle().withHoverEvent(hoverEvent)); - - final String siblingString = sibling.getString(); - if (!siblingString.contains("{packUpdateCommand}")) { - currentLine.append(sibling); - continue; - } - - final Style siblingStyle = sibling.getStyle(); - final String[] splitSibling = siblingString.split("\\{packUpdateCommand}"); - - if (splitSibling.length > 0) - currentLine.append(Component.literal(splitSibling[0]).setStyle(siblingStyle)); - - currentLine.append(Component.literal("[HERE]").setStyle(siblingStyle - .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.literal("Click to update pack"))) - .withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/gh-rp-manager request-pack")) - )); - - if (splitSibling.length > 1) - currentLine.append(Component.literal(splitSibling[1]).setStyle(siblingStyle)); - } - } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update message at line number '%s'!", e, lineNumber); - } - - - final PlayerList players = MinecraftServer.getServer().getPlayerList(); - if (!adminsOnly) { - players.broadcastSystemMessage(currentLine, false); - continue; - } - - for (final ServerPlayer player : players.players) { - if (!players.isOp(player.getGameProfile())) continue; - player.sendSystemMessage(currentLine); - } - } - } - - - private static final Style DEFAULT_STYLE = Style.EMPTY.withItalic(false).withColor(ChatFormatting.WHITE); - - private static MutableComponent getStyledText(String text) throws Exception { - final MutableComponent result = Component.empty(); - Style style = DEFAULT_STYLE; - - boolean isFormattingCode = false; - boolean isEscaped = false; - char[] characters = text.toCharArray(); - for (int characterIndex = 0; characterIndex < characters.length; characterIndex++) { - char currentChar = characters[characterIndex]; - - if (isFormattingCode) { - // Hex color - if (currentChar == '#') { - if (characterIndex + 7 >= characters.length) - throw new Exception("Unfinished hex code starting at character number '" + characterIndex + "'!"); - - try { - style = style.withColor(TextColor.parseColor(text.substring(characterIndex, characterIndex + 7)).getOrThrow(Exception::new)); - } catch (Exception e) { - throw new Exception("Failed to parse hex color starting at character number '" + characterIndex + "'!", e); - } - - // Move pointer 6 characters ahead as we already read the whole hex code - characterIndex += 6; - isFormattingCode = false; - continue; - } - - style = getStyleForFormattingCode(currentChar, style); - - if (style == null) - throw new Exception("Invalid formatting code at character number '" + characterIndex + "'!"); - - isFormattingCode = false; - continue; - } - - if (!isEscaped) { - switch (currentChar) { - case '&': - isFormattingCode = true; - continue; - case '\\': - isEscaped = true; - continue; - } - } - isEscaped = false; - - - final List siblings = result.getSiblings(); - final int lastSiblingIndex = siblings.size() - 1; - final Component lastSibling = siblings.isEmpty() ? Component.empty() : siblings.get(lastSiblingIndex); - - // Check if the style of the last sibling is the same as the current one - if (!siblings.isEmpty() && lastSibling.getStyle().equals(style)) { - // If so, set the last sibling to itself plus the new character - siblings.set(lastSiblingIndex, Component.literal(lastSibling.getString() + currentChar).setStyle(style)); - } else { - // Otherwise, just append a new sibling to the result - result.append(Component.literal(String.valueOf(currentChar)).setStyle(style)); - } - } - - return result; - } - - private static Style getStyleForFormattingCode(char formattingCode, Style currentStyle) { - if (formattingCode == 'r') return DEFAULT_STYLE; - - final ChatFormatting formatting = ChatFormatting.getByCode(formattingCode); - if (formatting == null) return null; - - return currentStyle.applyFormat(formatting); - } - */ } From 57d723a196a2d53636c372645ff7414b5c71b2e9 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 6 Sep 2025 22:03:37 +0300 Subject: [PATCH 35/89] remove unused logLevel parameter for createLogToAdminListener --- .../GithubResourcepackManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index b33cb71..e0440a8 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -88,11 +88,11 @@ public static void initialize() { } private static void addLogToAdminListeners() { - LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibLogger.LogLevel.ERROR, MonkeyLibStyle.Color.RED)); - LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibLogger.LogLevel.WARN, MonkeyLibStyle.Color.YELLOW)); + LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibStyle.Color.RED)); + LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibStyle.Color.YELLOW)); } - private static MonkeyLibLogger.LogListener createLogToAdminListener(MonkeyLibLogger.LogLevel logLevel, int textColor) { + private static MonkeyLibLogger.LogListener createLogToAdminListener(final int textColor) { return (message, error) -> { final MonkeyLibText text = MonkeyLibText .of("[%s] %s".formatted(MOD_ID, message)) From a7934bee809478ed58e68c1dfa3813059a1a8b1f Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 7 Oct 2025 20:20:17 +0300 Subject: [PATCH 36/89] neo? :3 I think it's possible that this could perhaps work? --- common/build.gradle | 17 ++- common/gradle.properties | 1 - .../GithubResourcepackManager.java | 27 ++++- .../networking/MainHttpHandler.java | 6 +- .../resources/META-INF/neoforge.mods.toml | 14 +++ fabric/build.gradle | 4 +- ...sourcepackmanager.platform.PlatformLogging | 1 - gradle.properties | 6 +- neoforge/build.gradle | 100 ++++++++++++++++++ neoforge/gradle.properties | 12 +++ .../mixin/DedicatedServerAccessor.java | 13 +++ .../DedicatedServerSettingsAccessor.java | 20 ++++ .../mixin/SettingsAccessor.java | 14 +++ .../neoforge/NeoforgePlatformCommand.java | 42 ++++++++ .../neoforge/NeoforgePlatformInitializer.java | 22 ++++ .../neoforge/NeoforgePlatformMain.java | 66 ++++++++++++ .../NeoforgePlatformServerProperties.java | 57 ++++++++++ .../neoforge/NeoforgePlatformText.java | 25 +++++ .../resources/META-INF/neoforge.mods.toml | 39 +++++++ ...sourcepackmanager.platform.PlatformCommand | 1 + ...bresourcepackmanager.platform.PlatformMain | 1 + ...kmanager.platform.PlatformServerProperties | 1 + ...bresourcepackmanager.platform.PlatformText | 1 + .../github-resourcepack-manager/icon.png | Bin 0 -> 1761 bytes .../github-resourcepack-manager.mixins.json | 13 +++ paper/build.gradle | 4 +- .../platform/paper/PaperPlugin.java | 3 - settings.gradle | 1 + 28 files changed, 497 insertions(+), 14 deletions(-) create mode 100644 common/src/main/resources/META-INF/neoforge.mods.toml delete mode 100644 fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging create mode 100644 neoforge/build.gradle create mode 100644 neoforge/gradle.properties create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java create mode 100644 neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java create mode 100644 neoforge/src/main/resources/META-INF/neoforge.mods.toml create mode 100644 neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand create mode 100644 neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain create mode 100644 neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties create mode 100644 neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText create mode 100644 neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png create mode 100644 neoforge/src/main/resources/github-resourcepack-manager.mixins.json diff --git a/common/build.gradle b/common/build.gradle index da64765..3f52771 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -15,13 +15,16 @@ repositories { } dependencies { - implementation "org.eclipse.jgit:org.eclipse.jgit:${project.jgit_version}" + implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" shadow compileOnlyApi("top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}") - shadow compileOnly("top.offsetmonkey538.meshlib:mesh-lib-api:${project.meshlib_version}") + shadow compileOnly("top.offsetmonkey538.meshlib:mesh-lib-api:${project.meshlib_version}") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } // should be bundled with minecraft + shadow compileOnly("com.mojang:brigadier:1.3.10") //todo put in properties shadow compileOnly("com.google.guava:guava:${project.guava_version}") shadow compileOnly("commons-io:commons-io:${project.commonsio_version}") shadow compileOnly("org.apache.commons:commons-lang3:${project.commonslang_version}") @@ -31,3 +34,13 @@ dependencies { shadow compileOnly("org.jetbrains:annotations:24.0.0") } tasks.build.dependsOn(shadowJar) + +processResources { + final Map properties = [ + "modVersion": project.version + ] + inputs.properties(properties) + filesMatching("META-INF/neoforge.mods.toml") { + expand(properties) + } +} diff --git a/common/gradle.properties b/common/gradle.properties index 9cd2a8d..f6977dd 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -1,4 +1,3 @@ -jgit_version = 6.9.0.202403050737-r guava_version = 33.4.0-jre commonsio_version = 2.18.0 commonslang_version = 3.18.0 diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index e0440a8..e0fdc6d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,5 +1,7 @@ package top.offsetmonkey538.githubresourcepackmanager; +import io.netty.handler.codec.http.FullHttpRequest; +import io.netty.handler.codec.http.HttpHeaderNames; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.jetbrains.annotations.NotNull; @@ -14,7 +16,10 @@ import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; import top.offsetmonkey538.githubresourcepackmanager.platform.*; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; -import top.offsetmonkey538.meshlib.api.HttpHandlerRegistry; +import top.offsetmonkey538.meshlib.api.router.HttpRouter; +import top.offsetmonkey538.meshlib.api.router.HttpRouterRegistry; +import top.offsetmonkey538.meshlib.api.router.rule.HttpRule; +import top.offsetmonkey538.meshlib.impl.router.rule.DomainHttpRule; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; @@ -82,7 +87,25 @@ public static void initialize() { LOGGER.error("Failed to create folder structure!", e); } - HttpHandlerRegistry.INSTANCE.register(MOD_URI, new MainHttpHandler()); + HttpRouterRegistry.INSTANCE.register(MOD_URI, new HttpRouter( + new HttpRule<>() { + @Override + public String getType() { + return "2hartqwf"; + } + + @Override + public Object getData() { + return new Object(); + } + + @Override + public boolean matches(FullHttpRequest httpRequest) { + return MOD_URI.equals(httpRequest.uri().split("/")[1]); + } + }, + new MainHttpHandler(new Object()) + )); PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART)); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java index 4d1b182..6dbb345 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java @@ -9,7 +9,11 @@ import static io.netty.handler.codec.http.HttpResponseStatus.*; import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; -public class MainHttpHandler implements HttpHandler { +public class MainHttpHandler extends HttpHandler { + + public MainHttpHandler(Object data) { + super(data); + } @Override public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpRequest request) throws Exception { diff --git a/common/src/main/resources/META-INF/neoforge.mods.toml b/common/src/main/resources/META-INF/neoforge.mods.toml new file mode 100644 index 0000000..0a5b461 --- /dev/null +++ b/common/src/main/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,14 @@ +modLoader = "javafml" +loaderVersion = "[1,)" +license="MIT" + +issueTrackerURL="https://github.com/OffsetMods538/Github-Resourcepack-Manager/issues" + + +[[mods]] +modId="git_pack_manager_common" +displayName="Git Pack Manager Common" +version="${modVersion}" +displayURL="https://modrinth.com/mod/github-resourcepack-manager" +authors="OffsetMonkey538" +description="Modify server resourcepack from GitHub" diff --git a/fabric/build.gradle b/fabric/build.gradle index 52d5ead..f0f93aa 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -99,7 +99,9 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" - include runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}") + runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}+1.21.4") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } include project(path: ":common", configuration: "shadow") common project(":common") diff --git a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging b/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging deleted file mode 100644 index 7695764..0000000 --- a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformLogging \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8c2a0ce..7c78e61 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,11 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 1.0.5+1.21.4 +meshlib_version = 1.0.5-8e52b9d # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-6345c7b +monkeylib538_version = 3.0.0-66c29d2 +jgit_version = 6.9.0.202403050737-r + # Mod Properties mod_version = 5.0.0 diff --git a/neoforge/build.gradle b/neoforge/build.gradle new file mode 100644 index 0000000..b3f6f3d --- /dev/null +++ b/neoforge/build.gradle @@ -0,0 +1,100 @@ +import dex.plugins.outlet.v2.util.ReleaseType + +plugins { + id 'net.neoforged.moddev' version '2.0.112' + id 'io.github.dexman545.outlet' version '1.6.1' +} + +outlet { + mcVersionRange = rootProject.supported_minecraft_versions + allowedReleaseTypes = Set.of(ReleaseType.RELEASE) +} + +neoForge { + version = project.neoforge_version + + parchment { + mappingsVersion = project.parchment_mappings_version + minecraftVersion = project.minecraft_version + } + + mods { + "${project.name}" { + sourceSet(sourceSets.main) + } + } + + runs { + server { + server() + } + + configureEach { + systemProperty "forge.logging.markers", "REGISTRIES" + } + } +} + +repositories { + mavenCentral() + mavenLocal() + maven { + name = "DevAuth" + url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" + content { + includeGroup "me.djtheredstoner" + } + } +} + +configurations { + common { + canBeResolved = true + canBeConsumed = false + } + api.extendsFrom common + + runtimeClasspath.extendsFrom localRuntime +} + +dependencies { + localRuntime "me.djtheredstoner:DevAuth-neoforge:${project.devauth_version}" + + runtimeOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-1.20.6:${rootProject.monkeylib538_version}+1.20.6" + compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}" + + + runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-neoforge:${rootProject.meshlib_version}+1.21.4") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } + + jarJar(api(project(":common"))) + jarJar(additionalRuntimeClasspath("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}")) +} + +processResources { + final Map properties = Map.of( + "modVersion", project.mod_version, + "supportedMinecraftVersions", project.minecraft_version_range, + "monkeylib538Version", project.monkeylib538_version, + "meshLibVersion", project.meshlib_version + ) + + inputs.properties(properties) + + filesMatching("META-INF/neoforge.mods.toml") { + expand(properties) + } + + exclude ".cache/**" +} + +modrinth { + loaders = ["neoforge"] + //todo idk:_uploadFile = remapJar.archiveFile + + dependencies { + required.project "monkeylib538" + // todo idk: required.project "fabric-api" + } +} \ No newline at end of file diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties new file mode 100644 index 0000000..406e37f --- /dev/null +++ b/neoforge/gradle.properties @@ -0,0 +1,12 @@ +# Minecraft version, check at https://fabricmc.net/develop +minecraft_version = 1.21.4 +neoforge_version = 21.4.154 +parchment_mappings_version = 2025.03.23 + +# Dependencies +## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth +devauth_version = 1.2.1 + +nameSuffix = neoforge + +minecraft_version_range=[1.20.6,) diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java new file mode 100644 index 0000000..41d4c9a --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java @@ -0,0 +1,13 @@ +package top.offsetmonkey538.githubresourcepackmanager.mixin; + +import net.minecraft.server.dedicated.DedicatedServer; +import net.minecraft.server.dedicated.DedicatedServerSettings; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(DedicatedServer.class) +public interface DedicatedServerAccessor { + + @Accessor + DedicatedServerSettings getSettings(); +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java new file mode 100644 index 0000000..66638ba --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java @@ -0,0 +1,20 @@ +package top.offsetmonkey538.githubresourcepackmanager.mixin; + +import net.minecraft.server.dedicated.DedicatedServerProperties; +import net.minecraft.server.dedicated.DedicatedServerSettings; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.nio.file.Path; + +@Mixin(DedicatedServerSettings.class) +public interface DedicatedServerSettingsAccessor { + + @Accessor + Path getSource(); + + @Mutable + @Accessor + void setProperties(DedicatedServerProperties properties); +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java new file mode 100644 index 0000000..565a199 --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java @@ -0,0 +1,14 @@ +package top.offsetmonkey538.githubresourcepackmanager.mixin; + +import net.minecraft.server.dedicated.Settings; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +import java.util.Properties; + +@Mixin(Settings.class) +public interface SettingsAccessor { + + @Accessor + Properties getProperties(); +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java new file mode 100644 index 0000000..a41ec2a --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java @@ -0,0 +1,42 @@ +package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; + +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import net.minecraft.commands.CommandSourceStack; +import net.minecraft.network.chat.Component; +import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerPlayer; +import org.jetbrains.annotations.NotNull; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import top.offsetmonkey538.monkeylib538.neoforge.api.command.NeoforgeCommandAbstractionApi; + +import java.util.Optional; + +import static com.mojang.brigadier.Command.SINGLE_SUCCESS; + +public class NeoforgePlatformCommand implements PlatformCommand { + @Override + public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { + final CommandSourceStack source = NeoforgeCommandAbstractionApi.get(ctx); + final ServerPlayer player = source.getPlayerOrException(); + final MinecraftServer.ServerResourcePackInfo resourcePackProperties = source.getServer().getServerResourcePack().orElse(null); + if (resourcePackProperties == null) { + source.sendSuccess(() -> Component.literal("Failed to send pack update packet to client!"), true); + return 0; + } + + player.connection.send( + new ClientboundResourcePackPushPacket( + resourcePackProperties.id(), + resourcePackProperties.url(), + resourcePackProperties.hash(), + resourcePackProperties.isRequired(), + Optional.ofNullable(resourcePackProperties.prompt()) + ), + null + ); + + return SINGLE_SUCCESS; + } +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java new file mode 100644 index 0000000..0d9fd2a --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java @@ -0,0 +1,22 @@ +package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; + +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.IEventBus; +import net.neoforged.fml.ModContainer; +import net.neoforged.fml.common.Mod; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.server.ServerStartingEvent; +import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; + +@Mod( + value = "git_pack_manager", + dist = Dist.DEDICATED_SERVER +) +public class NeoforgePlatformInitializer { + + public NeoforgePlatformInitializer(IEventBus modEventBus, ModContainer modContainer) { + GithubResourcepackManager.initialize(); + + NeoForge.EVENT_BUS.addListener(ServerStartingEvent.class, serverStartingEvent -> NeoforgePlatformMain.setServer(serverStartingEvent.getServer())); + } +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java new file mode 100644 index 0000000..69024c2 --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java @@ -0,0 +1,66 @@ +package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.entity.player.Player; +import net.neoforged.fml.loading.FMLPaths; +import net.neoforged.neoforge.common.NeoForge; +import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent; +import net.neoforged.neoforge.event.entity.player.PlayerEvent; +import net.neoforged.neoforge.event.server.ServerStartedEvent; +import net.neoforged.neoforge.event.server.ServerStartingEvent; +import org.jetbrains.annotations.Nullable; +import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.neoforge.api.text.NeoforgeMonkeyLibText; + +import java.nio.file.Path; +import java.util.List; + +import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; + +public class NeoforgePlatformMain implements PlatformMain { + private static @Nullable MinecraftServer minecraftServer = null; + + public static @Nullable MinecraftServer getServer() { + return minecraftServer; + } + + public static void setServer(MinecraftServer server) { + minecraftServer = server; + } + + + @Override + public Path getConfigDir() { + return FMLPaths.CONFIGDIR.get().resolve(MOD_ID); + } + + @Override + public void runOnServerStart(Runnable work) { + NeoForge.EVENT_BUS.addListener(ServerStartedEvent.class, serverStartedEvent -> work.run()); + } + + @Override + public void sendMessageToAdmins(MonkeyLibText message) { + if (getServer() == null) return; + for (final Player player : getServer().getPlayerList().getPlayers()) { + if (!getServer().getPlayerList().isOp(player.getGameProfile())) continue; + player.displayClientMessage(NeoforgeMonkeyLibText.of(message).getText(), false); + } + } + + @Override + public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + NeoForge.EVENT_BUS.addListener(PlayerEvent.PlayerLoggedInEvent.class, playerLoggedInEvent -> { + if (!playerLoggedInEvent.getEntity().getServer().getPlayerList().isOp(playerLoggedInEvent.getEntity().getGameProfile())) return; + + for (MonkeyLibText text : messageQueue) playerLoggedInEvent.getEntity().displayClientMessage(NeoforgeMonkeyLibText.of(text).getText(), false); + }); + } + + @Override + public void refreshDatapacks() { + getServer().getPackRepository().reload(); + } +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java new file mode 100644 index 0000000..73d86a6 --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java @@ -0,0 +1,57 @@ +package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.dedicated.DedicatedServerProperties; +import net.minecraft.server.dedicated.DedicatedServerSettings; +import net.minecraft.world.level.storage.LevelResource; +import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.githubresourcepackmanager.mixin.SettingsAccessor; +import top.offsetmonkey538.githubresourcepackmanager.mixin.DedicatedServerAccessor; +import top.offsetmonkey538.githubresourcepackmanager.mixin.DedicatedServerSettingsAccessor; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; + +import java.nio.file.Path; +import java.util.Map; +import java.util.Optional; +import java.util.Properties; + +public class NeoforgePlatformServerProperties implements PlatformServerProperties { + + @Override + public String getResourcePackUrl() { + final Optional resourcePackProperties = NeoforgePlatformMain.getServer().getServerResourcePack(); + + return resourcePackProperties.map(MinecraftServer.ServerResourcePackInfo::url).orElse(null); + } + + @Override + public String getServerPort() { + return String.valueOf(NeoforgePlatformMain.getServer().getPort()); + } + + @Override + public Path getDatapacksDir() { + return NeoforgePlatformMain.getServer().getWorldPath(LevelResource.DATAPACK_DIR); + } + + @Override + public void setProperties(Map properties) { + final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) NeoforgePlatformMain.getServer()).getSettings(); + + propertiesLoader.update(propertiesHandler -> { + final Properties serverProperties = ((SettingsAccessor) propertiesHandler).getProperties(); + + properties.forEach(serverProperties::setProperty); + + return propertiesHandler; + }); + } + + @Override + public void reload() throws GithubResourcepackManagerException { + final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) NeoforgePlatformMain.getServer()).getSettings(); + final DedicatedServerSettingsAccessor propertiesLoaderAccess = (DedicatedServerSettingsAccessor) propertiesLoader; + + propertiesLoaderAccess.setProperties(DedicatedServerProperties.fromFile(propertiesLoaderAccess.getSource())); + } +} diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java new file mode 100644 index 0000000..a564e4f --- /dev/null +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java @@ -0,0 +1,25 @@ +package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.players.PlayerList; +import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; +import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.neoforge.api.text.NeoforgeMonkeyLibText; + +public class NeoforgePlatformText implements PlatformText { + @Override + public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { + assert NeoforgePlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; + final PlayerList playerManager = NeoforgePlatformMain.getServer().getPlayerList(); + + if (!adminsOnly) { + playerManager.broadcastSystemMessage(NeoforgeMonkeyLibText.of(updateMessage).getText(), false); + return; + } + + for (final ServerPlayer player : playerManager.getPlayers()) { + if (!playerManager.isOp(player.getGameProfile())) continue; + player.sendSystemMessage(NeoforgeMonkeyLibText.of(updateMessage).getText(), false); + } + } +} diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml new file mode 100644 index 0000000..ea42043 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,39 @@ +modLoader = "javafml" +loaderVersion = "[1,)" +license="MIT" + +issueTrackerURL="https://github.com/OffsetMods538/Github-Resourcepack-manager" + + +[[mods]] +modId="git_pack_manager" +displayName="Git Pack Manager" +version="${modVersion}" +displayURL="https://modrinth.com/mod/github-resourcepack-manager" +authors="OffsetMonkey538" +description="Modify server resourcepack from GitHub" + +[[mixins]] +config="github-resourcepack-manager.mixins.json" + + +[[dependencies.git_pack_manager]] +modId="minecraft" +type="required" +versionRange="${supportedMinecraftVersions}" +ordering="NONE" +side="BOTH" + +[[dependencies.git_pack_manager]] +modId="monkeylib538_common_neoforge" +type="required" +versionRange="[${monkeylib538Version},)" +ordering="NONE" +side="BOTH" + +[[dependencies.git_pack_manager]] +modId="mesh_lib_common" +type="required" +versionRange="[${meshLibVersion},)" +ordering="NONE" +side="BOTH" diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand new file mode 100644 index 0000000..e14ad3a --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand @@ -0,0 +1 @@ +top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformCommand \ No newline at end of file diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain new file mode 100644 index 0000000..9d0e114 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain @@ -0,0 +1 @@ +top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformMain \ No newline at end of file diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties new file mode 100644 index 0000000..425ca86 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties @@ -0,0 +1 @@ +top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformServerProperties \ No newline at end of file diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText new file mode 100644 index 0000000..712b8d3 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText @@ -0,0 +1 @@ +top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformText \ No newline at end of file diff --git a/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png b/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a6544fae6f35cbb6b9f002277050d34f8bfaeba3 GIT binary patch literal 1761 zcmV<71|Io|P)Px*n@L1LRCt{2oxhG8MG(g8EGK}Il`b<#PLOeg99Rfm#4kZ+C&%K*USERaL*fY> zAd&F~NQi*&fDq%9y})t;(h(f9o|)^JuI{ets_L$vbkgnK%xvF$UsqTEnck!CzW?zO zoNl=xT>wWGH$dmy1oV<9-T?}V|BaR#ZBRU2*20tVQz}E8NxItK~QQQc8 zWEp^4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)MM}@g0FeG%#Z9X?9a{z}9a}mIy#SPFoZh+2l19XlXpmW>+o#O`R95+Dc zxB)uH4bVAmfX;CPbdDRKbKC%(;|Ay)H$dmO0XpYDedHh)PcoBZ00000NkvXXu0mjf DiGDA; literal 0 HcmV?d00001 diff --git a/neoforge/src/main/resources/github-resourcepack-manager.mixins.json b/neoforge/src/main/resources/github-resourcepack-manager.mixins.json new file mode 100644 index 0000000..2262de0 --- /dev/null +++ b/neoforge/src/main/resources/github-resourcepack-manager.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "package": "top.offsetmonkey538.githubresourcepackmanager.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + "SettingsAccessor", + "DedicatedServerAccessor", + "DedicatedServerSettingsAccessor" + ], + "injectors": { + "defaultRequire": 1 + } +} diff --git a/paper/build.gradle b/paper/build.gradle index b49d520..02b312a 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -41,7 +41,9 @@ dependencies { paperweight.paperDevBundle(project.paper_version) implementation "xyz.jpenilla:reflection-remapper:${project.reflection_remapper_version}" - implementation "top.offsetmonkey538.meshlib:mesh-lib-paper:${rootProject.meshlib_version}" + implementation("top.offsetmonkey538.meshlib:mesh-lib-paper:${rootProject.meshlib_version}+1.21.4") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } common project(path: ":common", configuration: "shadow") } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java index 55777cc..fc6e210 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java @@ -2,14 +2,11 @@ import org.bukkit.plugin.java.JavaPlugin; import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.meshlib.MeshLib; public class PaperPlugin extends JavaPlugin { @Override public void onEnable() { - MeshLib.initialize(); - PaperPlatformMain.setPlugin(this); GithubResourcepackManager.initialize(); diff --git a/settings.gradle b/settings.gradle index e866fb5..66601c4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,4 +15,5 @@ rootProject.name = "github-resourcepack-manager" include "common" include "fabric" +include "neoforge" include "paper" From 6aecd24f6d7a24ae4f7e5dcdcd37fe901ba92fc4 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 7 Oct 2025 20:36:35 +0300 Subject: [PATCH 37/89] depend on newer monkeylib and meshlib --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7c78e61..bbab9a6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 1.0.5-8e52b9d +meshlib_version = 1.0.5-c33be54 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-66c29d2 +monkeylib538_version = 3.0.0-10e70ec jgit_version = 6.9.0.202403050737-r From d5f38be6da7aa54f2a09513626a839c687245b5c Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Tue, 7 Oct 2025 21:05:27 +0300 Subject: [PATCH 38/89] depend on newer monkeylib and meshlib --- .../githubresourcepackmanager/GithubResourcepackManager.java | 2 +- gradle.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index e0fdc6d..2e848d0 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -70,7 +70,7 @@ public static void initialize() { PlatformMain.INSTANCE.registerSendMessageQueueOnAdminJoin(MESSAGE_QUEUE); // config should be initialized after the error listeners - config = ConfigManager.INSTANCE.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); + config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); GitPackManagerCommand.register(); ConfigCommandApi.registerConfigCommand( diff --git a/gradle.properties b/gradle.properties index bbab9a6..247c39b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 1.0.5-c33be54 +meshlib_version = 1.0.5-1a52522 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-10e70ec +monkeylib538_version = 3.0.0-3df936b jgit_version = 6.9.0.202403050737-r From be184b129eae09cfe54ab329c13e251c0a526c46 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 11 Oct 2025 12:15:42 +0300 Subject: [PATCH 39/89] depend on newer monkeylib and meshlib --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 247c39b..218c8ce 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 1.0.5-1a52522 +meshlib_version = 2.0.0-alpha.0.1760173787064+6126daa # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-3df936b +monkeylib538_version = 3.0.0-alpha.0.1760173173400+2230010 jgit_version = 6.9.0.202403050737-r From 41f5ac01cc862a350026b9103f442bc3e45a19e1 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 11 Oct 2025 12:21:57 +0300 Subject: [PATCH 40/89] redo versioning see https://github.com/OffsetMods538/MonkeyLib538/commit/7d04b64b6682b25032762250a91e085c51d4d793 and https://github.com/OffsetMods538/MonkeyLib538/commit/223001036477e9f6f82c135fb929ff8c2276aa02 --- .github/workflows/build_artifacts.yml | 7 ++++++- .github/workflows/publish.yml | 3 +++ build.gradle | 28 +++++++++++++++++++++++++-- fabric/build.gradle | 2 +- gradle.properties | 2 +- neoforge/build.gradle | 2 +- paper/build.gradle | 2 +- 7 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_artifacts.yml b/.github/workflows/build_artifacts.yml index 497f54c..7ae91d7 100644 --- a/.github/workflows/build_artifacts.yml +++ b/.github/workflows/build_artifacts.yml @@ -24,10 +24,15 @@ jobs: with: cache-read-only: false + - name: Store short commit hash + run: echo "short_commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV" + - name: Build with Gradle run: ./gradlew build env: + PRESERVE_PRERELEASE_VERSION: true DISABLE_PROPERTIES_UPDATE: true + VERSION_SUFFIX: ${{ env.short_commit_hash }} - name: Delete common libs run: rm -r ./common/build/libs @@ -35,5 +40,5 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: - name: Artifacts + name: Build Artifacts path: ./*/build/libs/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c75535a..4832d00 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,11 +29,14 @@ jobs: - name: Build with Gradle run: ./gradlew build env: + IS_RELEASE: true DISABLE_PROPERTIES_UPDATE: true - name: Upload to Modrinth run: ./gradlew modrinth env: + IS_RELEASE: true + DISABLE_PROPERTIES_UPDATE: true MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} VERSION_NAME: ${{ github.event.release.name }} VERSION_IS_PRERELEASE: ${{ github.event.release.prerelease }} diff --git a/build.gradle b/build.gradle index 780ac0c..fd9372d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,36 @@ import dex.plugins.outlet.v2.util.ReleaseType +import java.nio.file.Files + plugins { id 'fabric-loom' version '1.10-SNAPSHOT' apply false id 'io.github.dexman545.outlet' version '1.6.1' apply false id 'com.modrinth.minotaur' version '2.+' apply false } +ext { + versionPrefix = rootProject.mod_version + if (!Boolean.parseBoolean(System.getenv("IS_RELEASE"))) { + String preReleaseVersion = System.currentTimeMillis() + + if (Boolean.parseBoolean(System.getenv("PRESERVE_PRERELEASE_VERSION"))) { + var preReleaseVersionFile = file("preReleaseVersion.txt").toPath() + if (Files.exists(preReleaseVersionFile)) preReleaseVersion = Files.readString(preReleaseVersionFile) + Files.writeString(preReleaseVersionFile, preReleaseVersion) + } + + var separator = "-" + if (versionPrefix.contains("-")) separator = "." + versionPrefix = "${versionPrefix}${separator}${preReleaseVersion}" + } + final String versionSuffix = System.getenv("VERSION_SUFFIX") + if (versionSuffix != null && !versionSuffix.isEmpty()) { + versionPrefix = "${versionPrefix}+${versionSuffix}" + } + + System.out.println("Version Prefix: " + versionPrefix) +} + allprojects { group = "top.offsetmonkey538.githubresourcepackmanager" @@ -27,7 +52,7 @@ subprojects { apply plugin: "java" base.archivesName = "github-resourcepack-manager-${project.nameSuffix}" - version = "${project.mod_version}+${project.minecraft_version}" + version = "${rootProject.versionPrefix}+${project.minecraft_version}" java { withSourcesJar() @@ -69,5 +94,4 @@ configure(subprojects.findAll { it.name != "common" }) { } } tasks.modrinth.dependsOn(tasks.modrinthSyncBody) - } diff --git a/fabric/build.gradle b/fabric/build.gradle index f0f93aa..8f16b53 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -109,7 +109,7 @@ dependencies { processResources { final Map properties = Map.of( - "modVersion", project.mod_version, + "modVersion", project.version, "supportedMinecraftVersions", project.supported_minecraft_versions, "monkeylib538Version", project.monkeylib538_version ) diff --git a/gradle.properties b/gradle.properties index 218c8ce..91881e6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,5 +12,5 @@ jgit_version = 6.9.0.202403050737-r # Mod Properties -mod_version = 5.0.0 +mod_version = 5.0.0-alpha.0 supported_minecraft_versions = >=1.20.5 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index b3f6f3d..b495727 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -74,7 +74,7 @@ dependencies { processResources { final Map properties = Map.of( - "modVersion", project.mod_version, + "modVersion", project.version, "supportedMinecraftVersions", project.minecraft_version_range, "monkeylib538Version", project.monkeylib538_version, "meshLibVersion", project.meshlib_version diff --git a/paper/build.gradle b/paper/build.gradle index 02b312a..c6ce13f 100644 --- a/paper/build.gradle +++ b/paper/build.gradle @@ -51,7 +51,7 @@ tasks.build.dependsOn(shadowJar) processResources { final Map properties = Map.of( - "modVersion", project.mod_version, + "modVersion", project.version, "lowestMinecraftVersion", outlet.mcVersions().first() // Hopefully outlet always does stuff in this order ) From 4ee4908da0aeb187514cb2608356abfc7de0e816 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 12 Oct 2025 10:59:35 +0300 Subject: [PATCH 41/89] Add command for clearing admin message queue --- .../GithubResourcepackManager.java | 18 +++++++++++++++++- .../command/GitPackManagerCommand.java | 9 +++++++++ .../platform/PlatformMain.java | 2 +- .../platform/fabric/FabricPlatformMain.java | 4 +++- .../neoforge/NeoforgePlatformMain.java | 4 +++- .../platform/paper/PaperPlatformMain.java | 6 ++++-- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 2e848d0..aa05f02 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -58,6 +58,15 @@ private GithubResourcepackManager() { private static final List MESSAGE_QUEUE = new ArrayList<>(); + private static final MonkeyLibText MESSAGE_QUEUE_EMPTY_MESSAGE; + static { + try { + MESSAGE_QUEUE_EMPTY_MESSAGE = TextFormattingApi.styleText("Admin message queue can be emptied using the &{hoverText,'Click to run','&{runCommand,'/gh-rp-manager reset-admin-message-queue','[/gh-rp-manager reset-admin-message-queue]'}'} command."); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + @SuppressWarnings("NotNullFieldNotInitialized") public static @NotNull ConfigHolder config; @@ -67,7 +76,10 @@ private GithubResourcepackManager() { public static void initialize() { addLogToAdminListeners(); - PlatformMain.INSTANCE.registerSendMessageQueueOnAdminJoin(MESSAGE_QUEUE); + PlatformMain.INSTANCE.registerSendMessageQueueOnAdminJoin( + MESSAGE_QUEUE, + MESSAGE_QUEUE_EMPTY_MESSAGE + ); // config should be initialized after the error listeners config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); @@ -344,6 +356,10 @@ public static Map generatePlaceholders(final GitHandler gitHandl return placeholders; } + public static void clearAdminMessageQueue() { + MESSAGE_QUEUE.clear(); + } + private static String getOldResourcePackName() { final String oldPackUrl = PlatformServerProperties.INSTANCE.getResourcePackUrl(); if (oldPackUrl == null) return null; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java index 3bf655e..31ac367 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java @@ -57,6 +57,15 @@ private static LiteralArgumentBuilder createCommand() { .requires(CommandAbstractionApi::isOp) .then(literal("resource").executes(context -> runTestUpdateMessage(context, true))) .then(literal("data").executes(context -> runTestUpdateMessage(context, false))) + ) + + .then(literal("reset-admin-message-queue") + .requires(CommandAbstractionApi::isOp) + .executes(context -> { + clearAdminMessageQueue(); + CommandAbstractionApi.sendMessage(context, "Admin message queue cleared!"); + return 1; + }) ); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index b6ea4be..a301a07 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -46,5 +46,5 @@ public interface PlatformMain { * * @param messageQueue list containing messages to send to admins when they join. Contents can be changed after calling this method. */ - void registerSendMessageQueueOnAdminJoin(final List messageQueue); + void registerSendMessageQueueOnAdminJoin(final List messageQueue, final MonkeyLibText lastMessage); } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 4bea390..464f799 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -52,11 +52,13 @@ public void sendMessageToAdmins(MonkeyLibText message) { } @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { + if (messageQueue.isEmpty()) return; if (!minecraftServer1.getPlayerManager().isOperator(serverPlayNetworkHandler.player.getGameProfile())) return; for (MonkeyLibText text : messageQueue) serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(text).getText()); + serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(lastMessage).getText()); }); } diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java index 69024c2..fb76c0a 100644 --- a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java @@ -51,11 +51,13 @@ public void sendMessageToAdmins(MonkeyLibText message) { } @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { NeoForge.EVENT_BUS.addListener(PlayerEvent.PlayerLoggedInEvent.class, playerLoggedInEvent -> { + if (messageQueue.isEmpty()) return; if (!playerLoggedInEvent.getEntity().getServer().getPlayerList().isOp(playerLoggedInEvent.getEntity().getGameProfile())) return; for (MonkeyLibText text : messageQueue) playerLoggedInEvent.getEntity().displayClientMessage(NeoforgeMonkeyLibText.of(text).getText(), false); + playerLoggedInEvent.getEntity().displayClientMessage(NeoforgeMonkeyLibText.of(lastMessage).getText(), false); }); } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 91c7cea..79273b4 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -40,15 +40,17 @@ public void sendMessageToAdmins(MonkeyLibText message) { } @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue) { + public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { record AdminMessageQueueEventHandler(List messageQueue) implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { + if (messageQueue.isEmpty()) return; if (!event.getPlayer().isOp()) return; for (MonkeyLibText text : messageQueue) { - // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(text)); + // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(text).getText()); } + // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(lastMessage).getText()); } } From 9534d5d6024cbce34c6284d7b6efa341aa4552e6 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 12 Oct 2025 11:41:44 +0300 Subject: [PATCH 42/89] Async pack updating no idea if there are any issues caused from this... There shouldn't be I don't think as updates from webhooks were already running on the netty thread and that seemed to work... I think --- .../GithubResourcepackManager.java | 18 ++++++++++++++++-- .../command/GitPackManagerCommand.java | 8 ++++---- .../networking/WebhookHttpHandler.java | 2 +- fabric/gradle.properties | 2 +- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index aa05f02..8132e71 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,5 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpHeaderNames; import org.apache.commons.io.FileUtils; @@ -32,6 +33,10 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; import java.util.regex.Pattern; public final class GithubResourcepackManager { @@ -56,6 +61,8 @@ private GithubResourcepackManager() { public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/gh-rp-manager request-pack"); + private static final Executor EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(MOD_ID + "-%d").build()); + private static final List MESSAGE_QUEUE = new ArrayList<>(); private static final MonkeyLibText MESSAGE_QUEUE_EMPTY_MESSAGE; @@ -119,7 +126,7 @@ public boolean matches(FullHttpRequest httpRequest) { new MainHttpHandler(new Object()) )); - PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART)); + PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART, true)); } private static void addLogToAdminListeners() { @@ -150,7 +157,14 @@ private static void createFolderStructure() throws GithubResourcepackManagerExce } } - public static void updatePack(final UpdateType updateType) { + public static CompletableFuture updatePack(final UpdateType updateType, final boolean onSameThread) { + if (!onSameThread) return CompletableFuture.runAsync(() -> updatePack(updateType), EXECUTOR); + + updatePack(updateType); + return CompletableFuture.completedFuture(null); + } + + private static void updatePack(final UpdateType updateType) { if (updateType != UpdateType.RESTART) { LOGGER.debug("Clearing admin message queue before updating after a restart..."); MESSAGE_QUEUE.clear(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java index 31ac367..568d35b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java @@ -85,10 +85,10 @@ private static void runTriggerUpdate(CommandContext context, boolean for GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); - GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND); - - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND, false).thenRun(() -> { + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + }); } private static int runTestUpdateMessage(CommandContext context, boolean isResource) { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java index 7a754fd..b7e4b9d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java @@ -12,6 +12,6 @@ private WebhookHttpHandler() {} public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, OK)).addListener(ChannelFutureListener.CLOSE); - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK); + GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK, false); } } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index 7695676..de5dfc9 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -3,7 +3,7 @@ # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. yarn_version = 1.21.4+build.8 -loader_version = 0.17.2 +loader_version = 0.17.3 fapi_version = 0.119.4+1.21.4 # Dependencies From 3a93c23f95122fabd4627d077d246b56575068b2 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sun, 12 Oct 2025 20:38:14 +0300 Subject: [PATCH 43/89] build against 1.21.10 --- build.gradle | 2 +- fabric/build.gradle | 9 +++++---- fabric/gradle.properties | 6 ++++-- .../platform/fabric/FabricPlatformMain.java | 5 +++-- .../platform/fabric/FabricPlatformText.java | 3 ++- gradle.properties | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index fd9372d..81c8cc5 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ import dex.plugins.outlet.v2.util.ReleaseType import java.nio.file.Files plugins { - id 'fabric-loom' version '1.10-SNAPSHOT' apply false + id 'fabric-loom' version '1.11-SNAPSHOT' apply false id 'io.github.dexman545.outlet' version '1.6.1' apply false id 'com.modrinth.minotaur' version '2.+' apply false } diff --git a/fabric/build.gradle b/fabric/build.gradle index 8f16b53..3ce837f 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,7 +1,7 @@ import dex.plugins.outlet.v2.util.ReleaseType plugins { - id 'fabric-loom' version '1.10-SNAPSHOT' + id 'fabric-loom' version '1.11-SNAPSHOT' id 'io.github.dexman545.outlet' version '1.6.1' } @@ -10,9 +10,9 @@ outlet { mcVersionRange = rootProject.supported_minecraft_versions allowedReleaseTypes = Set.of(ReleaseType.RELEASE) propertiesData = [ - 'yarn_version': outlet.yarnVersion(rootProject.minecraft_version), + 'yarn_version': outlet.yarnVersion(project.minecraft_version), 'loader_version': outlet.loaderVersion(), - 'fapi_version': outlet.fapiVersion(rootProject.minecraft_version) + 'fapi_version': outlet.fapiVersion(project.minecraft_version) ] } @@ -83,7 +83,7 @@ dependencies { modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${project.devauth_version}" - modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-1.20.5:${project.monkeylib538_version}+1.20.5") { + modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-1.21.9:${project.monkeylib538_version}+1.21.9") { exclude(group: "net.fabricmc.fabric-api") exclude(group: "top.offsetmonkey538.monkeylib538:monkeylib538-fabric") } @@ -100,6 +100,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}+1.21.4") { + exclude(group: "net.fabricmc.fabric-api") exclude(group: "top.offsetmonkey538.monkeylib538") } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index de5dfc9..5048e68 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -1,10 +1,12 @@ +minecraft_version = 1.21.10 + # Fabric # Check at https://fabricmc.net/develop # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. -yarn_version = 1.21.4+build.8 +yarn_version = 1.21.10+build.2 loader_version = 0.17.3 -fapi_version = 0.119.4+1.21.4 +fapi_version = 0.135.0+1.21.10 # Dependencies ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 464f799..b04a59b 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -10,6 +10,7 @@ import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.fabric.api.player.FabricPlayerApi; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; import java.nio.file.Path; @@ -46,7 +47,7 @@ public void runOnServerStart(Runnable work) { public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { - if (!getServer().getPlayerManager().isOperator(player.getGameProfile())) continue; + if (!FabricPlayerApi.isPlayerOp(getServer().getPlayerManager(), player)) continue; player.sendMessage(FabricMonkeyLibText.of(message).getText(), false); } } @@ -55,7 +56,7 @@ public void sendMessageToAdmins(MonkeyLibText message) { public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { if (messageQueue.isEmpty()) return; - if (!minecraftServer1.getPlayerManager().isOperator(serverPlayNetworkHandler.player.getGameProfile())) return; + if (!FabricPlayerApi.isPlayerOp(minecraftServer1.getPlayerManager(), serverPlayNetworkHandler.player)) return; for (MonkeyLibText text : messageQueue) serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(text).getText()); serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(lastMessage).getText()); diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java index f7335eb..9fabeaa 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java @@ -4,6 +4,7 @@ import net.minecraft.server.network.ServerPlayerEntity; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.fabric.api.player.FabricPlayerApi; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; public class FabricPlatformText implements PlatformText { @@ -19,7 +20,7 @@ public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { } for (final ServerPlayerEntity player : playerManager.getPlayerList()) { - if (!playerManager.isOperator(player.getGameProfile())) continue; + if (!FabricPlayerApi.isPlayerOp(playerManager, player)) continue; player.sendMessageToClient(FabricMonkeyLibText.of(updateMessage).getText(), false); } } diff --git a/gradle.properties b/gradle.properties index 91881e6..577c803 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1760173787064+6126daa # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-alpha.0.1760173173400+2230010 +monkeylib538_version = 3.0.0-alpha.0.1760290533497+21bc668 jgit_version = 6.9.0.202403050737-r From ba62165085209949ef7f1117e659e880bfc95163 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:50:42 +0200 Subject: [PATCH 44/89] replace \n with newlines in update message --- .../githubresourcepackmanager/GithubResourcepackManager.java | 2 +- fabric/gradle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 8132e71..336476c 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -344,7 +344,7 @@ public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final MonkeyLibText[] result = new MonkeyLibText[updateMessage.length]; for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { - final String line = StringUtils.replacePlaceholders(updateMessage[lineIndex], placeholders, true, false); + final String line = StringUtils.replacePlaceholders(updateMessage[lineIndex], placeholders, true, false).replace("\\n", "\n"); try { result[lineIndex] = TextFormattingApi.styleText(line); diff --git a/fabric/gradle.properties b/fabric/gradle.properties index 5048e68..e636565 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -6,7 +6,7 @@ minecraft_version = 1.21.10 # variable "DISABLE_PROPERTIES_UPDATE" is set. yarn_version = 1.21.10+build.2 loader_version = 0.17.3 -fapi_version = 0.135.0+1.21.10 +fapi_version = 0.136.0+1.21.10 # Dependencies ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth From de2cf35736767bbb60722504bf4bf84162dc60aa Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Mon, 20 Oct 2025 18:26:28 +0200 Subject: [PATCH 45/89] update gradle to v9.1.0 --- gradle/wrapper/gradle-wrapper.jar | Bin 43764 -> 45457 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- gradlew | 5 +---- gradlew.bat | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55baabb587c669f562ae36f953de2481846..8bdaf60c75ab801e22807dde59e12a8735a34077 100644 GIT binary patch delta 37256 zcmXVXV`E)y({>tT2aRppNn_h+Y}>|ev}4@T^BTF zt*UbFk22?fVj8UBV<>NN?oj)e%q3;ANZn%w$&6vqe{^I;QY|jWDMG5ZEZRBH(B?s8 z#P8OsAZjB^hSJcmj0htMiurSj*&pTVc4Q?J8pM$O*6ZGZT*uaKX|LW}Zf>VRnC5;1 zSCWN+wVs*KP6h)5YXeKX;l)oxK^6fH2%+TI+348tQ+wXDQZ>noe$eDa5Q{7FH|_d$ zq!-(Ga2avI1+K!}Fz~?<`hpS3Wc|u#W4`{F+&Nx(g8|DLU<^u~GRNe<35m05WFc~C zJM?2zO{8IPPG0XVWI?@BD!7)~mw6VdR;u4HGN~g^lH|h}=DgO$ec8G3#Dt?Lfc6k3v*{%viJm3wtS3c`aA;J< z(RqusS%t%}c#2l@(X#MCoIQR?Y3d#=zx#Htg_B4Z`ziM-Yui|#6&+YD^=T?@ZJ=Q! z7X;7vYNp%yy01j=nt5jfk%Ab9gFk=quaas)6_6)er_Ks2Qh&>!>f&1U`fyq-TmJot z_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RqETL zj{;dWUW!~gc7_FgEeCJcxC7`u%ws$>UfTz4|3X3PDYDNJ7A&m=KyMX2@JzF+cH-_P zQWA7GYk`CxjS=7>@JOvYu%|)(csNwv3O(@IBFg>L;6UAKcxfO&W>_wdLb)J7RooX) z9%R+o0bd)ux*|YGT2>j1i)@xP@fJ%skR|1&$W=%iEpVTjf#;v zErH)(z@Zzq%E}5ZH~_2OBy0PeYx4z^E92<`GOGcoOOeN>W;^K2bNdFC$Op4{8faH1 zXa^qb;28m{GU036vgi!H;{^aRiE5|~ZiqHS?t}nsNLAbokf|L*5CH*2xPgx@h5|Ch zT?nv70Odq*Q?mvb>1ibG1?^Q?(Y5J*2ZI`LAiq%oq=IPXtq9057=}8j25{=tHzOdaAq04U3WJGF zHb8)Eu@nl0M?mix5VQrHXwn1Vg*{Np7tn@G>2wf+yn)qeO%zHG5k)Z_0swIEkP2L< z)fp=kN*4i!7Ql64mukSEYkgE#5e4TZ8oL`*D!!E(Nx_UaSv j+6D+geLfC^M|+mQ*Ow$yL@ceNaI6S{mE76Panj42;u diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 3735f26..6a38a8c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=7197a12f450794931532469d4ff21a59ea2c1cd59a3ec3f89c035c3c420a6999 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip +distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 23d15a9..adff685 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index db3a6ac..c4bdd3a 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell From eb2235508887c0948c364c57a2efc8536236e1f2 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:45:40 +0200 Subject: [PATCH 46/89] Update monkeylib to v3.0.0-alpha.0.1761237113556+d3f347d and remove runOnServerStart method --- .../GithubResourcepackManager.java | 3 ++- .../githubresourcepackmanager/platform/PlatformMain.java | 7 ------- .../platform/fabric/FabricPlatformMain.java | 5 ----- gradle.properties | 2 +- .../platform/neoforge/NeoforgePlatformMain.java | 5 ----- .../platform/paper/PaperPlatformMain.java | 5 ----- 6 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 336476c..f11944a 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -22,6 +22,7 @@ import top.offsetmonkey538.meshlib.api.router.rule.HttpRule; import top.offsetmonkey538.meshlib.impl.router.rule.DomainHttpRule; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; +import top.offsetmonkey538.monkeylib538.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; @@ -126,7 +127,7 @@ public boolean matches(FullHttpRequest httpRequest) { new MainHttpHandler(new Object()) )); - PlatformMain.INSTANCE.runOnServerStart(() -> updatePack(UpdateType.RESTART, true)); + ServerLifecycleApi.runOnServerStarted(() -> updatePack(UpdateType.RESTART, true)); } private static void addLogToAdminListeners() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index a301a07..40f60f2 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -20,13 +20,6 @@ public interface PlatformMain { */ Path getConfigDir(); - /** - * Must be called when initializing - * - * @param work the stuff to run - */ - void runOnServerStart(Runnable work); - /** * Tell the server to refresh the list of available datapacks. *

diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index b04a59b..03600e7 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -38,11 +38,6 @@ public Path getConfigDir() { return FabricLoader.getInstance().getConfigDir().resolve(MOD_ID); } - @Override - public void runOnServerStart(Runnable work) { - ServerLifecycleEvents.SERVER_STARTED.register(minecraftServer1 -> work.run()); - } - @Override public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; diff --git a/gradle.properties b/gradle.properties index 577c803..9744ca4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1760173787064+6126daa # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-alpha.0.1760290533497+21bc668 +monkeylib538_version = 3.0.0-alpha.0.1761237113556+d3f347d jgit_version = 6.9.0.202403050737-r diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java index fb76c0a..4474a00 100644 --- a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java @@ -36,11 +36,6 @@ public Path getConfigDir() { return FMLPaths.CONFIGDIR.get().resolve(MOD_ID); } - @Override - public void runOnServerStart(Runnable work) { - NeoForge.EVENT_BUS.addListener(ServerStartedEvent.class, serverStartedEvent -> work.run()); - } - @Override public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 79273b4..e967288 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -21,11 +21,6 @@ public Path getConfigDir() { return getPlugin().getDataPath(); } - @Override - public void runOnServerStart(Runnable work) { - work.run(); - } - @Override public void refreshDatapacks() { MinecraftServer.getServer().getPackRepository().reload(); From a4743ff8266ef8a081439eb1d0f8a04f7cbea80a Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 23 Oct 2025 21:56:36 +0200 Subject: [PATCH 47/89] =?UTF-8?q?update=20github=20actions,=20please=20tel?= =?UTF-8?q?l=20me=20this=20fixes=20cache=20not=20working=20=F0=9F=99=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_artifacts.yml | 4 ++-- .github/workflows/publish.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_artifacts.yml b/.github/workflows/build_artifacts.yml index 7ae91d7..7b2ec64 100644 --- a/.github/workflows/build_artifacts.yml +++ b/.github/workflows/build_artifacts.yml @@ -14,13 +14,13 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: '21' distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@v5 with: cache-read-only: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4832d00..0df3b3c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,13 +16,13 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v4 + uses: actions/setup-java@v5 with: java-version: '21' distribution: 'temurin' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 + uses: gradle/actions/setup-gradle@v5 with: cache-read-only: false From e552cfe8ef721b18a2985bf1d3c11f016348429c Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 23 Oct 2025 22:39:48 +0200 Subject: [PATCH 48/89] Add files via upload --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..85b8c92 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Set update schedule for GitHub Actions + +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "daily" From 635942d467971d02ab28c74ece227392236ac54c Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Thu, 23 Oct 2025 23:16:02 +0200 Subject: [PATCH 49/89] update meshlib to 2.0.0-alpha.0.1761252973683+89c3c64 --- .../GithubResourcepackManager.java | 31 +++++-------------- .../networking/MainHttpHandler.java | 23 ++++---------- gradle.properties | 2 +- 3 files changed, 14 insertions(+), 42 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index f11944a..4e74e34 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -1,8 +1,6 @@ package top.offsetmonkey538.githubresourcepackmanager; import com.google.common.util.concurrent.ThreadFactoryBuilder; -import io.netty.handler.codec.http.FullHttpRequest; -import io.netty.handler.codec.http.HttpHeaderNames; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.jetbrains.annotations.NotNull; @@ -19,8 +17,7 @@ import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.meshlib.api.router.HttpRouter; import top.offsetmonkey538.meshlib.api.router.HttpRouterRegistry; -import top.offsetmonkey538.meshlib.api.router.rule.HttpRule; -import top.offsetmonkey538.meshlib.impl.router.rule.DomainHttpRule; +import top.offsetmonkey538.meshlib.api.rule.rules.PathHttpRule; import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; @@ -37,7 +34,6 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import java.util.concurrent.ThreadFactory; import java.util.regex.Pattern; public final class GithubResourcepackManager { @@ -107,25 +103,12 @@ public static void initialize() { LOGGER.error("Failed to create folder structure!", e); } - HttpRouterRegistry.INSTANCE.register(MOD_URI, new HttpRouter( - new HttpRule<>() { - @Override - public String getType() { - return "2hartqwf"; - } - - @Override - public Object getData() { - return new Object(); - } - - @Override - public boolean matches(FullHttpRequest httpRequest) { - return MOD_URI.equals(httpRequest.uri().split("/")[1]); - } - }, - new MainHttpHandler(new Object()) - )); + HttpRouterRegistry.HTTP_ROUTER_REGISTRATION_EVENT.listen(registry -> { + registry.register(MOD_ID, new HttpRouter( + new PathHttpRule(MOD_URI), + new MainHttpHandler() + )); + }); ServerLifecycleApi.runOnServerStarted(() -> updatePack(UpdateType.RESTART, true)); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java index 6dbb345..43ae2b2 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java @@ -4,27 +4,16 @@ import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.meshlib.api.HttpHandler; +import top.offsetmonkey538.meshlib.api.handler.HttpHandler; +import top.offsetmonkey538.meshlib.api.rule.HttpRule; import static io.netty.handler.codec.http.HttpResponseStatus.*; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.meshlib.api.util.HttpResponseUtil.sendError; -public class MainHttpHandler extends HttpHandler { - - public MainHttpHandler(Object data) { - super(data); - } +public class MainHttpHandler implements HttpHandler { @Override - public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpRequest request) throws Exception { - if (!request.decoderResult().isSuccess()) { - HttpHandler.sendError(ctx, BAD_REQUEST); - return; - } - - LOGGER.debug("Received Request: &s", request); - - + public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpRequest request, @NotNull HttpRule rule) throws Exception { final HttpMethod method = request.method(); // GET request should go to fileserver @@ -40,6 +29,6 @@ public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpR } // If we reach this point, then the request method isn't supported - HttpHandler.sendError(ctx, METHOD_NOT_ALLOWED); + sendError(ctx, METHOD_NOT_ALLOWED); } } diff --git a/gradle.properties b/gradle.properties index 9744ca4..1ca0efd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1760173787064+6126daa +meshlib_version = 2.0.0-alpha.0.1761252973683+89c3c64 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 monkeylib538_version = 3.0.0-alpha.0.1761237113556+d3f347d jgit_version = 6.9.0.202403050737-r From 03492479658327443d3b711f92e879febd96f1b4 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Sat, 25 Oct 2025 20:57:37 +0300 Subject: [PATCH 50/89] Update monkeylib to v3.0.0-alpha.0.1761395863791+bd100da --- .../GithubResourcepackManager.java | 3 ++- .../config/ModConfig.java | 18 +++++++++--------- .../platform/PlatformMain.java | 11 ----------- .../platform/fabric/FabricPlatformMain.java | 9 --------- gradle.properties | 2 +- .../neoforge/NeoforgePlatformMain.java | 13 ------------- .../platform/paper/PaperPlatformMain.java | 5 ----- 7 files changed, 12 insertions(+), 49 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 4e74e34..0075ea6 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -21,6 +21,7 @@ import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; +import top.offsetmonkey538.monkeylib538.api.platform.PlatformUtil; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; @@ -45,7 +46,7 @@ private GithubResourcepackManager() { public static final MonkeyLibLogger LOGGER = MonkeyLibLogger.create(MOD_ID); public static final String MOD_URI = "gh-rp-manager"; - public static final Path DATA_FOLDER = PlatformMain.INSTANCE.getConfigDir().resolve(".packs"); + public static final Path DATA_FOLDER = PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(".packs"); public static final Path GIT_FOLDER = DATA_FOLDER.resolve("git"); public static final Path RESOURCEPACK_FOLDER = DATA_FOLDER.resolve("resource-pack"); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java index a63b787..ca142d0 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java @@ -5,10 +5,10 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; import top.offsetmonkey538.githubresourcepackmanager.utils.WebhookSender; +import top.offsetmonkey538.monkeylib538.api.platform.PlatformUtil; import top.offsetmonkey538.offsetconfig538.api.config.Config; import top.offsetmonkey538.offsetconfig538.api.config.Datafixer; @@ -268,29 +268,29 @@ public int getConfigVersion() { } @Override - public @NotNull Path getFilePath() { - return PlatformMain.INSTANCE.getConfigDir().resolve("config").resolve("main.json"); + public @NotNull Path getConfigDirPath() { + return PlatformUtil.getConfigDir(); } @Override public @NotNull String getId() { - return MOD_ID + "/main"; + return MOD_ID + "config/main"; } @Override public void beforeLoadStart() { - if (Files.exists(PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"))) { + if (Files.exists(PlatformUtil.getConfigDir().resolve(MOD_ID + ".json"))) { try { - Files.createDirectories(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json").getParent()); - Files.move(PlatformMain.INSTANCE.getConfigDir().getParent().resolve(MOD_ID + ".json"), PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json")); + Files.createDirectories(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json").getParent()); + Files.move(PlatformUtil.getConfigDir().resolve(MOD_ID + ".json"), PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json")); } catch (IOException e) { throw new RuntimeException("Failed to move config file to new location!", e); } } - if (Files.exists(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json"))) { + if (Files.exists(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"))) { try { Files.createDirectories(getFilePath().getParent()); - Files.move(PlatformMain.INSTANCE.getConfigDir().resolve(MOD_ID + ".json"), getFilePath()); + Files.move(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"), getFilePath()); } catch (IOException e) { throw new RuntimeException("Failed to move config file to new location!", e); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index 40f60f2..48c6cb3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -2,7 +2,6 @@ import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import java.nio.file.Path; import java.util.List; import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; @@ -10,16 +9,6 @@ public interface PlatformMain { PlatformMain INSTANCE = load(PlatformMain.class); - /** - * Must already contain the mod id. - *

- * Example: .minecraft/config/github-resourcepack-manager/ - * Example: .minecraft/plugins/Github-Resourcepack-Manager/ - * - * @return config directory for the mod - */ - Path getConfigDir(); - /** * Tell the server to refresh the list of available datapacks. *

diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index 03600e7..f3289cd 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -3,7 +3,6 @@ import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.fabricmc.loader.api.FabricLoader; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; import org.jetbrains.annotations.Nullable; @@ -13,11 +12,8 @@ import top.offsetmonkey538.monkeylib538.fabric.api.player.FabricPlayerApi; import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; -import java.nio.file.Path; import java.util.List; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; - public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { private static @Nullable MinecraftServer minecraftServer = null; @@ -33,11 +29,6 @@ public void onInitializeServer() { } - @Override - public Path getConfigDir() { - return FabricLoader.getInstance().getConfigDir().resolve(MOD_ID); - } - @Override public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; diff --git a/gradle.properties b/gradle.properties index 1ca0efd..ff74d11 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1761252973683+89c3c64 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-alpha.0.1761237113556+d3f347d +monkeylib538_version = 3.0.0-alpha.0.1761395863791+bd100da jgit_version = 6.9.0.202403050737-r diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java index 4474a00..f9d83d4 100644 --- a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java @@ -2,23 +2,15 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.entity.player.Player; -import net.neoforged.fml.loading.FMLPaths; import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent; import net.neoforged.neoforge.event.entity.player.PlayerEvent; -import net.neoforged.neoforge.event.server.ServerStartedEvent; -import net.neoforged.neoforge.event.server.ServerStartingEvent; import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.neoforge.api.text.NeoforgeMonkeyLibText; -import java.nio.file.Path; import java.util.List; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.MOD_ID; - public class NeoforgePlatformMain implements PlatformMain { private static @Nullable MinecraftServer minecraftServer = null; @@ -31,11 +23,6 @@ public static void setServer(MinecraftServer server) { } - @Override - public Path getConfigDir() { - return FMLPaths.CONFIGDIR.get().resolve(MOD_ID); - } - @Override public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index e967288..0046834 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -10,16 +10,11 @@ import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import java.nio.file.Path; import java.util.List; public class PaperPlatformMain implements PlatformMain { private static PaperPlugin plugin; - @Override - public Path getConfigDir() { - return getPlugin().getDataPath(); - } @Override public void refreshDatapacks() { From b265d135b4e55931ddf38c290a25c0e1756b6c2f Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Wed, 17 Dec 2025 18:08:36 +0200 Subject: [PATCH 51/89] Update Gradle to v9.2.0 --- gradle/wrapper/gradle-wrapper.jar | Bin 45457 -> 45633 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 8bdaf60c75ab801e22807dde59e12a8735a34077..f8e1ee3125fe0768e9a76ee977ac089eb657005e 100644 GIT binary patch delta 36466 zcmXVXQ)4CEwrnG|ZQHhO+qRvo*j}-1c5K_WZL@>Z-@f-{{(%~(8dWpl;8)+_uR3dZ zfZQ)egq&Z$i11kM_Up+}Q({I9MU9QZb2tR|yWGN*EITsYQsXf^5qA245#ac}VN7sh zh0J3lJ2M}?KHXivdw;lL^3<*X4-B$3ia;m37Kqtw&i zS44bg*-wcSL! z3SdD4tBX;ArwHhPVinq?S0M$-NDOHL41GA}u(Mv5lJs<>n1t_H{9Dx+iP^!|OZQjg z?r?7~D`^kTzf9h>O*8A}exIMuzXc$pU~b^ya#D9FHgvX-Q%Yzk&SMjmRXXNaWUeur zlkHbC@;ZrS`g8^HFE*ztUGuNoszWPjE*%z7Ig86rushQM?7yOw$~9=Fm8+HQUTzv? zfJk=PC+3tWDRvq{9HGU^Zu%T_j*8tp%>TiVuoXOEUm?=ke1bF@YIBp42=^no_&WYdKw$ss1@Y-se*rkpi&K6u}~U$255Np z?7GN0p@Jp>xLr#KDJ@^^k}45a;HG1THPWPxvaJ=yARI7bHIW%7`oU5K?Zzz`nW5_D zr@AaO1KtwBXLQ3AdtS+tV8RsHYw?WXA}~magC2%dki?8d@kw)G7AS~1Mi{5@cB`Re zhFOH2-A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?UYF%HhaiQIyN6DdP7UR<=?dQ?9;`+;hirfg`P$E662#}bL%m_d2LoFIrrFkA zaBnOko@Zc7Y!{zwh`8r67?jh=$dbUVYo8G7|#9wDElc=yiyK|$y}cVkf@ z?T+TomsgVI6&2nL%W$JM!i~IB-ufI}$6nDntDC4?$^EDu{ejN!2IsDtp&s(68rddq zM#eR6!i?eK1syI{6P|?S#5_V#!KC4sSeaFb`TSBn3kEtVZNSs8Iw^s=ocVc4YQ(0R zebf8t*x98@o9cvU|KKW)v?_)asBg2yAPIG$VEAffo^SG3%#x6h*W8_4Q}L|h7V;wg z^f76pw)W2NSlp$f+=~l(koj1^aUfh4*$cB5diRa0HtM!D5|$6}7CvO?GifLm2c8ys zL7944-4iK)KjRd&MJW(Ph3L;O3os}$f{ko{Ai7fUddkX7l?KQ00ER^{AcBtx=-`0@ zR#lt~so71ew!m5u1bl+;Hz>ac!1k?>K_Fe4EIdMgvg8)4!~PiCQZ9#}A-;hBA&Q7e z>}7@Sxq}W<+IF1bzggn}&k`pFsxKwbRssPJOaBSpbEf=RA_vER-5CP`w`j6#@jDt^+KViUH>dl2EF+J*A+A z{~Ij}pp_K5&TuRx2RjXU@L?QR+ZZ&yNAtl@RblGzAa_X3?B` z0QBFdnP^jY1H?*m*#5R62qa2#>C^~HA{by;B?8;qIC7!P7iY?Nh|rKw$<$`3ru>>* z)GZUr%)44G9ENqRAGKMkSe4tHJiylmG1!{!A+A*GrWG!>^~o TbTtHgKIb=}#OPPBcmMwnM9LS( diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6a38a8c..49ab6fc 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +distributionSha256Sum=df67a32e86e3276d011735facb1535f64d0d88df84fa87521e90becc2d735444 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From a64c69d93917cf39300f2f259edaeb02d44b81c6 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 <71213040+OffsetMonkey538@users.noreply.github.com> Date: Fri, 26 Dec 2025 12:07:04 +0200 Subject: [PATCH 52/89] Update monkeylib --- build.gradle | 2 +- .../GithubResourcepackManager.java | 16 ++++++++++++---- .../platform/PlatformMain.java | 7 ------- fabric/build.gradle | 2 +- .../platform/fabric/FabricPlatformMain.java | 11 ----------- gradle.properties | 4 ++-- 6 files changed, 16 insertions(+), 26 deletions(-) diff --git a/build.gradle b/build.gradle index 81c8cc5..1abbcdb 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ import dex.plugins.outlet.v2.util.ReleaseType import java.nio.file.Files plugins { - id 'fabric-loom' version '1.11-SNAPSHOT' apply false + id 'fabric-loom' version '1.14-SNAPSHOT' apply false id 'io.github.dexman545.outlet' version '1.6.1' apply false id 'com.modrinth.minotaur' version '2.+' apply false } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java index 0075ea6..2222668 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java @@ -22,9 +22,11 @@ import top.offsetmonkey538.monkeylib538.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; import top.offsetmonkey538.monkeylib538.api.platform.PlatformUtil; +import top.offsetmonkey538.monkeylib538.api.telemetry.TelemetryRegistry; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; +import top.offsetmonkey538.monkeylib538.telemetry.TelemetryHandler; import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; @@ -80,11 +82,17 @@ private GithubResourcepackManager() { private static boolean disabled; public static void initialize() { + TelemetryRegistry.register("git-pack-manager"); // TODO: replace with MOD_ID once I do that + addLogToAdminListeners(); - PlatformMain.INSTANCE.registerSendMessageQueueOnAdminJoin( - MESSAGE_QUEUE, - MESSAGE_QUEUE_EMPTY_MESSAGE - ); + PlatformUtil.sendMessagesToAdminsOnJoin(() -> { + if (MESSAGE_QUEUE.isEmpty()) return new MonkeyLibText[] {}; + + final MonkeyLibText[] result = new MonkeyLibText[MESSAGE_QUEUE.size() + 1]; + MESSAGE_QUEUE.toArray(result); + result[result.length - 1] = MESSAGE_QUEUE_EMPTY_MESSAGE; + return result; + }); // config should be initialized after the error listeners config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java index 48c6cb3..e37818a 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java @@ -22,11 +22,4 @@ public interface PlatformMain { * @param message the message to send */ void sendMessageToAdmins(final MonkeyLibText message); - - /** - * Sends messages contained in the provided list to admins when they join - * - * @param messageQueue list containing messages to send to admins when they join. Contents can be changed after calling this method. - */ - void registerSendMessageQueueOnAdminJoin(final List messageQueue, final MonkeyLibText lastMessage); } diff --git a/fabric/build.gradle b/fabric/build.gradle index 3ce837f..6ca899b 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,7 +1,7 @@ import dex.plugins.outlet.v2.util.ReleaseType plugins { - id 'fabric-loom' version '1.11-SNAPSHOT' + id 'fabric-loom' version '1.14-SNAPSHOT' id 'io.github.dexman545.outlet' version '1.6.1' } diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java index f3289cd..4509c87 100644 --- a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ b/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java @@ -38,17 +38,6 @@ public void sendMessageToAdmins(MonkeyLibText message) { } } - @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { - ServerPlayConnectionEvents.JOIN.register((serverPlayNetworkHandler, packetSender, minecraftServer1) -> { - if (messageQueue.isEmpty()) return; - if (!FabricPlayerApi.isPlayerOp(minecraftServer1.getPlayerManager(), serverPlayNetworkHandler.player)) return; - - for (MonkeyLibText text : messageQueue) serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(text).getText()); - serverPlayNetworkHandler.player.sendMessage(FabricMonkeyLibText.of(lastMessage).getText()); - }); - } - @Override public void refreshDatapacks() { getServer().getDataPackManager().scanPacks(); diff --git a/gradle.properties b/gradle.properties index ff74d11..728dfcb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.parallel = true minecraft_version = 1.21.4 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1761252973683+89c3c64 +meshlib_version = 2.0.0-alpha.0.1762972806024+d227635 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-alpha.0.1761395863791+bd100da +monkeylib538_version = 3.0.0-alpha.3 jgit_version = 6.9.0.202403050737-r From c88cf474aa58b3130d540e49e20ade0100739b02 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 18:08:44 +0200 Subject: [PATCH 53/89] Update Gradle to v9.3.0 --- gradle/wrapper/gradle-wrapper.jar | Bin 45633 -> 46175 bytes gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f8e1ee3125fe0768e9a76ee977ac089eb657005e..61285a659d17295f1de7c53e24fdf13ad755c379 100644 GIT binary patch delta 37058 zcmX6@V|1Ne+e~Ae*tTsajcwbu)95rhv2ELpZQG4=VmoP?Ce7F9{eJBG_r2E4wXfMT zGk65KcLv$$fC`j{Vn@qwX{~D|!Rqmyk#lN~X&X|PN-VC(*S{l4u_MT_%(!w!9}$Uk z0n6R(L%pgVFwqG>LG8`I2L|;5AqL>R@p~M3nvbIPkUGU1UNfg*ZauQPW^~muS7cbU zWCOm&P{?3pP$V2-95b*Q&5a|Od0agz$|zeVRaw(<69Dt`P$vnK_x?)RF{A%hm#lzZ zbT~v0z0dy14a)UKF93i-snk18=ABFd0*@^K43{`5*j}zPUAQ8qv88O^WC7Zq?4{Dn zLWPLFj&G@%T0ZTCgZp=4wNj4Z>-V)!;cl-gE*!ST1TN8xuy8WVqL)3Db6tFWm*RwN zf(s!ip{!$Jf4>X=q|k*ap-QvQSP)sE`;txD%lq@&hucckTH#-0RRuVB%ww`jiZ2il zu3u7`QW;Ykm{3!U%CUh~8e8his#r!5ZDDQTC2{l~^PYut5F$)n>V5eAkRtjx2OD1> zQL+SqY>IL+hd}&$#NY1?7m)yg!`CaHSIoXh!Qf4fp4`C6U5D%Dm&u0yy&#CpVT$2D zA0Ma3yi+*q-r;qONYQO|SXi@mTuL#2$}MV;WpGn{!l^rG&n$p>{?*#JoAvAVzEeXy z?Lum**`UpRrBwi%XJ9>-ph>ZQ`}WPAvmOq0kARL19afv!rg%rWld88$2Z@_npO8^D zOHJ2Ljop`Eb}D=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k|9Zjlie*Nem2$#3f9AO}}&1C%ayEvP15XW?a=rAi+zGD=5bx(Pblw z_DzM*J6v?ZPcXAbmpqv{t#k%;?Be87373I>VS3uyQ6*A-biShyzPZTRV%nw;Nr-vo zU0B-2{0i68(DK!GQQ*(Jk8UqCjxh|uq@beBlGZ6M2|m(#5yZUS5tV>}lq#&TV-!4A zkvC^lHDV#}Iwz4su$wRuRcPPsOTxitT*&BBr`C<*@L^-if6%+vjbV;rHA$^?oWgT0 zhMqaAn9PIM8Es{GDnVhdP1Guis+M~V{m$GbT+HXZHx{Tm9cUV2E*WyCg*4bDV>LzV zgD@JmdPJ7a8Q0|ks)a?+bxUav;9cPb=(SE`B49+Z=fvw=(QyFsDHl2E=a}kN0ACS& zr}04ukh@<3Fey?K{R^{h};{q=35=e&H=&U30LMO#|I8wAsipaR{(O z!f=a1ZrhVWAnft(1LR_R)V3QY1fsvdF+9;VK)e>vOzKOzh=Hzg5hLYqXD9&{=!>!LZ898_i=%G>uh|4$`&sUG=b&$ z);?@|eEgSe2e_zuoGgzDz=8_rpkM(QRRXw9krMu`!w(L@K4(W91PI09SV`O#d z*(NchyG03s%KayVwEaAQ(2F8)%}T0Nrv7=dU)i%jIwmsy{1oR=Eu7-#t+5k-NfJkYL1N z)(&m2@IfGAY$IfZv%oVIXw>f|8Sp@fvOyflEa-8C6zccF1DId-lch3+1#PCHSVOWZ z4KR{B=xeUX7VStX3k*+}WPw``j`QG=vfTCG^mJshz_!XGoWHK*%}O{2@*ZoWT$SQ3 JWd7DQ`9Hc?h(rJY diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 49ab6fc..44ae953 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=df67a32e86e3276d011735facb1535f64d0d88df84fa87521e90becc2d735444 -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip +distributionSha256Sum=0d585f69da091fc5b2beced877feab55a3064d43b8a1d46aeb07996b0915e0e0 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 3d9e80ee7b3a09145242dbe028e9f9e5c3c114fa Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 18:44:40 +0200 Subject: [PATCH 54/89] fix build errors --- .../networking/MainHttpHandler.java | 2 +- fabric/gradle.properties | 6 +++--- .../neoforge/NeoforgePlatformMain.java | 11 ----------- .../platform/paper/PaperPlatformMain.java | 18 ------------------ 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java index 43ae2b2..517f67b 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java @@ -29,6 +29,6 @@ public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpR } // If we reach this point, then the request method isn't supported - sendError(ctx, METHOD_NOT_ALLOWED); + sendError(ctx, request, METHOD_NOT_ALLOWED); } } diff --git a/fabric/gradle.properties b/fabric/gradle.properties index e636565..bc755f6 100644 --- a/fabric/gradle.properties +++ b/fabric/gradle.properties @@ -4,9 +4,9 @@ minecraft_version = 1.21.10 # Check at https://fabricmc.net/develop # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. -yarn_version = 1.21.10+build.2 -loader_version = 0.17.3 -fapi_version = 0.136.0+1.21.10 +yarn_version = 1.21.10+build.3 +loader_version = 0.18.4 +fapi_version = 0.138.4+1.21.10 # Dependencies ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java index f9d83d4..758f969 100644 --- a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java +++ b/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java @@ -32,17 +32,6 @@ public void sendMessageToAdmins(MonkeyLibText message) { } } - @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { - NeoForge.EVENT_BUS.addListener(PlayerEvent.PlayerLoggedInEvent.class, playerLoggedInEvent -> { - if (messageQueue.isEmpty()) return; - if (!playerLoggedInEvent.getEntity().getServer().getPlayerList().isOp(playerLoggedInEvent.getEntity().getGameProfile())) return; - - for (MonkeyLibText text : messageQueue) playerLoggedInEvent.getEntity().displayClientMessage(NeoforgeMonkeyLibText.of(text).getText(), false); - playerLoggedInEvent.getEntity().displayClientMessage(NeoforgeMonkeyLibText.of(lastMessage).getText(), false); - }); - } - @Override public void refreshDatapacks() { getServer().getPackRepository().reload(); diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index 0046834..d607f42 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -29,24 +29,6 @@ public void sendMessageToAdmins(MonkeyLibText message) { } } - @Override - public void registerSendMessageQueueOnAdminJoin(List messageQueue, MonkeyLibText lastMessage) { - record AdminMessageQueueEventHandler(List messageQueue) implements Listener { - @EventHandler(priority = EventPriority.MONITOR) - public void onPlayerJoin(PlayerJoinEvent event) { - if (messageQueue.isEmpty()) return; - if (!event.getPlayer().isOp()) return; - - for (MonkeyLibText text : messageQueue) { - // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(text).getText()); - } - // todo: once monkeylib has paper support: event.getPlayer().sendMessage(PaperMonkeyLibText.of(lastMessage).getText()); - } - } - - Bukkit.getPluginManager().registerEvents(new AdminMessageQueueEventHandler(messageQueue), getPlugin()); - } - public static void setPlugin(PaperPlugin plugin) { PaperPlatformMain.plugin = plugin; } From 84d44c6c33d4473ec76174d8826f0a654d2afdfd Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 20:07:24 +0200 Subject: [PATCH 55/89] Migrate to new buildSrc --- .gitmodules | 3 + LICENSE | 2 +- README.md | 3 +- build.gradle | 116 ++++----------- buildSrc | 1 + common/build.gradle | 37 ++--- common/gradle.properties | 7 +- .../resources/META-INF/neoforge.mods.toml | 14 -- fabric/build.gradle | 135 ------------------ fabric/gradle.properties | 15 -- fabric/src/main/resources/fabric.mod.json | 32 ----- .../github-resourcepack-manager.accesswidener | 1 - gradle.properties | 47 ++++-- loader/fabric/1.21.1/gradle.properties | 15 ++ loader/fabric/build.gradle | 60 ++++++++ loader/fabric/gradle.properties | 10 ++ .../AbstractPropertiesHandlerAccessor.java | 0 .../MinecraftDedicatedServerAccessor.java | 0 .../mixin/ServerPropertiesLoaderAccessor.java | 0 .../fabric/FabricPlatformCommand.java | 0 .../platform/fabric/FabricPlatformMain.java | 0 .../FabricPlatformServerProperties.java | 0 .../platform/fabric/FabricPlatformText.java | 0 ...sourcepackmanager.platform.PlatformCommand | 0 ...bresourcepackmanager.platform.PlatformMain | 0 ...kmanager.platform.PlatformServerProperties | 0 ...bresourcepackmanager.platform.PlatformText | 0 .../github-resourcepack-manager/icon.png | Bin .../github-resourcepack-manager.mixins.json | 0 loader/neoforge/1.21.1/gradle.properties | 16 +++ loader/neoforge/build.gradle | 47 ++++++ loader/neoforge/gradle.properties | 8 ++ .../mixin/DedicatedServerAccessor.java | 0 .../DedicatedServerSettingsAccessor.java | 0 .../mixin/SettingsAccessor.java | 0 .../neoforge/NeoforgePlatformCommand.java | 0 .../neoforge/NeoforgePlatformInitializer.java | 0 .../neoforge/NeoforgePlatformMain.java | 0 .../NeoforgePlatformServerProperties.java | 0 .../neoforge/NeoforgePlatformText.java | 0 ...sourcepackmanager.platform.PlatformCommand | 0 ...bresourcepackmanager.platform.PlatformMain | 0 ...kmanager.platform.PlatformServerProperties | 0 ...bresourcepackmanager.platform.PlatformText | 0 .../github-resourcepack-manager/icon.png | Bin .../github-resourcepack-manager.mixins.json | 0 loader/paper/1.21.1/gradle.properties | 11 ++ loader/paper/build.gradle | 48 +++++++ loader/paper/gradle.properties | 7 + .../platform/paper/PaperPlatformCommand.java | 0 .../platform/paper/PaperPlatformMain.java | 28 ++-- .../paper/PaperPlatformServerProperties.java | 0 .../platform/paper/PaperPlatformText.java | 0 ...sourcepackmanager.platform.PlatformCommand | 0 ...sourcepackmanager.platform.PlatformLogging | 0 ...bresourcepackmanager.platform.PlatformMain | 0 ...kmanager.platform.PlatformServerProperties | 0 ...bresourcepackmanager.platform.PlatformText | 0 modded/1.21.1/gradle.properties | 7 + modded/build.gradle | 17 +++ modded/gradle.properties | 4 + neoforge/build.gradle | 100 ------------- neoforge/gradle.properties | 12 -- .../resources/META-INF/neoforge.mods.toml | 39 ----- paper/build.gradle | 72 ---------- paper/gradle.properties | 5 - .../platform/paper/PaperPlugin.java | 14 -- paper/src/main/resources/plugin.yml | 9 -- settings.gradle | 16 ++- 69 files changed, 363 insertions(+), 595 deletions(-) create mode 100644 .gitmodules create mode 160000 buildSrc delete mode 100644 common/src/main/resources/META-INF/neoforge.mods.toml delete mode 100644 fabric/build.gradle delete mode 100644 fabric/gradle.properties delete mode 100644 fabric/src/main/resources/fabric.mod.json delete mode 100644 fabric/src/main/resources/github-resourcepack-manager.accesswidener create mode 100644 loader/fabric/1.21.1/gradle.properties create mode 100644 loader/fabric/build.gradle create mode 100644 loader/fabric/gradle.properties rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java (100%) rename {fabric => loader/fabric}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java (100%) rename {fabric => loader/fabric}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand (100%) rename {fabric => loader/fabric}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain (100%) rename {fabric => loader/fabric}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties (100%) rename {fabric => loader/fabric}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText (100%) rename {fabric => loader/fabric}/src/main/resources/assets/github-resourcepack-manager/icon.png (100%) rename {fabric => loader/fabric}/src/main/resources/github-resourcepack-manager.mixins.json (100%) create mode 100644 loader/neoforge/1.21.1/gradle.properties create mode 100644 loader/neoforge/build.gradle create mode 100644 loader/neoforge/gradle.properties rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java (100%) rename {neoforge => loader/neoforge}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java (100%) rename {neoforge => loader/neoforge}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand (100%) rename {neoforge => loader/neoforge}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain (100%) rename {neoforge => loader/neoforge}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties (100%) rename {neoforge => loader/neoforge}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText (100%) rename {neoforge => loader/neoforge}/src/main/resources/assets/github-resourcepack-manager/icon.png (100%) rename {neoforge => loader/neoforge}/src/main/resources/github-resourcepack-manager.mixins.json (100%) create mode 100644 loader/paper/1.21.1/gradle.properties create mode 100644 loader/paper/build.gradle create mode 100644 loader/paper/gradle.properties rename {paper => loader/paper}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java (100%) rename {paper => loader/paper}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java (56%) rename {paper => loader/paper}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java (100%) rename {paper => loader/paper}/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java (100%) rename {paper => loader/paper}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand (100%) rename {paper => loader/paper}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging (100%) rename {paper => loader/paper}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain (100%) rename {paper => loader/paper}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties (100%) rename {paper => loader/paper}/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText (100%) create mode 100644 modded/1.21.1/gradle.properties create mode 100644 modded/build.gradle create mode 100644 modded/gradle.properties delete mode 100644 neoforge/build.gradle delete mode 100644 neoforge/gradle.properties delete mode 100644 neoforge/src/main/resources/META-INF/neoforge.mods.toml delete mode 100644 paper/build.gradle delete mode 100644 paper/gradle.properties delete mode 100644 paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java delete mode 100644 paper/src/main/resources/plugin.yml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cc7fe46 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "buildSrc"] + path = buildSrc + url = https://github.com/OffsetMods538/multiversion-buildscripts diff --git a/LICENSE b/LICENSE index ba28297..801d9ff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023,2024,2025 OffsetMonkey538 +Copyright (c) 2023-2026 OffsetMonkey538 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 375bd41..fb5796d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # GitHub Resourcepack Manager [![discord-singular](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/social/discord-singular_vector.svg)](https://discord.offsetmonkey538.top/) -[![modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/mod/github-resourcepack-manager) +[![modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/mod/git-pack-manager) [![requires-monkeylib538](https://raw.githubusercontent.com/OffsetMods538/MonkeyLib538/master/images/requires_monkeylib538.png)](https://modrinth.com/mod/monkeylib538) [![Requires Fabric API](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/requires/fabric-api_vector.svg)](https://modrinth.com/mod/fabric-api) +TODO: badge for mesh-lib I guess? Please read the documentation located [here](https://github-resourcepack-manager.docs.offsetmonkey538.top) and if you have any questions, feel free to contact me on [discord](https://discord.offsetmonkey538.top/) diff --git a/build.gradle b/build.gradle index 1abbcdb..cb30f92 100644 --- a/build.gradle +++ b/build.gradle @@ -1,97 +1,43 @@ -import dex.plugins.outlet.v2.util.ReleaseType - -import java.nio.file.Files - plugins { - id 'fabric-loom' version '1.14-SNAPSHOT' apply false - id 'io.github.dexman545.outlet' version '1.6.1' apply false - id 'com.modrinth.minotaur' version '2.+' apply false + id 'multiloader-root' + id 'java' + id 'net.neoforged.moddev' version "${neoforged_moddev}" apply false + id 'fabric-loom' version "${fabric_loom}" apply false + id 'io.papermc.paperweight.userdev' version "${papermc_paperweight_userdev}" apply false + id 'xyz.jpenilla.run-paper' version "${jpenilla_run_task}" apply false + id 'com.gradleup.shadow' version "${gradleup_shadow}" apply false + id 'xyz.jpenilla.resource-factory' version "${jpenilla_resource_factory}" apply false + id 'io.github.dexman545.outlet' version "${dexman_outlet}" apply false + id 'com.modrinth.minotaur' version "${modrinth_minotaur}" apply false + id 'hamburg.janove.elevator-music' version "0.1" } -ext { - versionPrefix = rootProject.mod_version - if (!Boolean.parseBoolean(System.getenv("IS_RELEASE"))) { - String preReleaseVersion = System.currentTimeMillis() - - if (Boolean.parseBoolean(System.getenv("PRESERVE_PRERELEASE_VERSION"))) { - var preReleaseVersionFile = file("preReleaseVersion.txt").toPath() - if (Files.exists(preReleaseVersionFile)) preReleaseVersion = Files.readString(preReleaseVersionFile) - Files.writeString(preReleaseVersionFile, preReleaseVersion) - } - - var separator = "-" - if (versionPrefix.contains("-")) separator = "." - versionPrefix = "${versionPrefix}${separator}${preReleaseVersion}" - } - final String versionSuffix = System.getenv("VERSION_SUFFIX") - if (versionSuffix != null && !versionSuffix.isEmpty()) { - versionPrefix = "${versionPrefix}+${versionSuffix}" - } - - System.out.println("Version Prefix: " + versionPrefix) -} +//elevatorMusic { +// if (Boolean.parseBoolean(System.getenv("DISABLE_MUSIC"))) return +// waitMusic = file("${rootProject.projectDir}/veryImportant/music.wav") +// successSound = file("${rootProject.projectDir}/veryImportant/done.wav") +//} -allprojects { - group = "top.offsetmonkey538.githubresourcepackmanager" +subprojects { + apply plugin: "java-library" repositories { + mavenCentral() mavenLocal() - maven { - name = "OffsetMods538" - url = "https://maven.offsetmonkey538.top/releases" - content { - includeGroup "top.offsetmonkey538.meshlib" - includeGroup "top.offsetmonkey538.monkeylib538" - includeGroup "top.offsetmonkey538.offsetconfig538" - } - } - } -} - -subprojects { - apply plugin: "java" - - base.archivesName = "github-resourcepack-manager-${project.nameSuffix}" - version = "${rootProject.versionPrefix}+${project.minecraft_version}" - - java { - withSourcesJar() - } - - jar { - from("${rootProject.projectDir}/LICENSE") { - rename { "${it}" } + exclusiveContent { + forRepository { + maven { + name = "OffsetMods538" + url = "https://maven.offsetmonkey538.top/releases" + } + } + filter { + includeGroupAndSubgroups "top.offsetmonkey538" + } } } -} - -configure(subprojects.findAll { it.name != "common" }) { - apply plugin: 'com.modrinth.minotaur' - apply plugin: 'io.github.dexman545.outlet' - - outlet { - mcVersionRange = rootProject.supported_minecraft_versions - allowedReleaseTypes = Set.of(ReleaseType.RELEASE) - } - modrinth { - token = System.getenv("MODRINTH_TOKEN") - projectId = "github-resourcepack-manager" - def customVersionName = System.getenv("VERSION_NAME") - if (customVersionName != null) versionName = customVersionName - versionNumber = "${project.version}" - versionType = "alpha" - def isPreRelease = System.getenv("VERSION_IS_PRERELEASE") - versionType = !"false".equals(isPreRelease) ? "beta" : "release" - additionalFiles = [sourcesJar.archiveFile] - gameVersions = outlet.mcVersions() - syncBodyFrom = rootProject.file("README.md").text - def changelogEnv = System.getenv("VERSION_CHANGELOG") - if (changelogEnv != null) changelog = changelogEnv - - dependencies { - embedded.version "mesh-lib", "${project.meshlib_version}" - } + dependencies { + compileOnlyApi "org.jspecify:jspecify:${rootProject.jspecify_version}" } - tasks.modrinth.dependsOn(tasks.modrinthSyncBody) } diff --git a/buildSrc b/buildSrc new file mode 160000 index 0000000..97cb1b2 --- /dev/null +++ b/buildSrc @@ -0,0 +1 @@ +Subproject commit 97cb1b28a0265d9fe6f90497a46bf86b01119687 diff --git a/common/build.gradle b/common/build.gradle index 3f52771..ab6be8c 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,10 +1,8 @@ plugins { - id 'java-library' - id 'com.gradleup.shadow' version '9.0.0-beta4' + id 'multiloader-base' } repositories { - mavenCentral() maven { name = "Mojang Libraries" url = "https://libraries.minecraft.net" @@ -15,32 +13,15 @@ repositories { } dependencies { - implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" - - shadow compileOnlyApi("top.offsetmonkey538.monkeylib538:monkeylib538-common:${project.monkeylib538_version}") + compileOnlyApi "top.offsetmonkey538.monkeylib538:monkeylib538-common:${rootProject.monkeylib538_version}+common" + compileOnlyApi "top.offsetmonkey538.meshlib:meshlib-common:${rootProject.meshlib_version}+common" - shadow compileOnly("top.offsetmonkey538.meshlib:mesh-lib-api:${project.meshlib_version}") { - exclude(group: "top.offsetmonkey538.monkeylib538") - } + implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" // should be bundled with minecraft - shadow compileOnly("com.mojang:brigadier:1.3.10") //todo put in properties - shadow compileOnly("com.google.guava:guava:${project.guava_version}") - shadow compileOnly("commons-io:commons-io:${project.commonsio_version}") - shadow compileOnly("org.apache.commons:commons-lang3:${project.commonslang_version}") - shadow compileOnly("com.google.code.gson:gson:${project.gson_version}") - - // Jetbrains annotations for gud code - shadow compileOnly("org.jetbrains:annotations:24.0.0") -} -tasks.build.dependsOn(shadowJar) - -processResources { - final Map properties = [ - "modVersion": project.version - ] - inputs.properties(properties) - filesMatching("META-INF/neoforge.mods.toml") { - expand(properties) - } + compileOnly "com.mojang:brigadier:${rootProject.brigadier_version}" + compileOnly "com.google.guava:guava:${rootProject.guava_version}" + compileOnly "commons-io:commons-io:${rootProject.commonsio_version}" + compileOnly "org.apache.commons:commons-lang3:${rootProject.commonslang_version}" + compileOnly "com.google.code.gson:gson:${rootProject.gson_version}" } diff --git a/common/gradle.properties b/common/gradle.properties index f6977dd..e99725d 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -1,6 +1 @@ -guava_version = 33.4.0-jre -commonsio_version = 2.18.0 -commonslang_version = 3.18.0 -gson_version = 2.11.0 - -nameSuffix = api \ No newline at end of file +project_name = common diff --git a/common/src/main/resources/META-INF/neoforge.mods.toml b/common/src/main/resources/META-INF/neoforge.mods.toml deleted file mode 100644 index 0a5b461..0000000 --- a/common/src/main/resources/META-INF/neoforge.mods.toml +++ /dev/null @@ -1,14 +0,0 @@ -modLoader = "javafml" -loaderVersion = "[1,)" -license="MIT" - -issueTrackerURL="https://github.com/OffsetMods538/Github-Resourcepack-Manager/issues" - - -[[mods]] -modId="git_pack_manager_common" -displayName="Git Pack Manager Common" -version="${modVersion}" -displayURL="https://modrinth.com/mod/github-resourcepack-manager" -authors="OffsetMonkey538" -description="Modify server resourcepack from GitHub" diff --git a/fabric/build.gradle b/fabric/build.gradle deleted file mode 100644 index 6ca899b..0000000 --- a/fabric/build.gradle +++ /dev/null @@ -1,135 +0,0 @@ -import dex.plugins.outlet.v2.util.ReleaseType - -plugins { - id 'fabric-loom' version '1.14-SNAPSHOT' - id 'io.github.dexman545.outlet' version '1.6.1' -} - -outlet { - maintainPropertiesFile = System.getenv("DISABLE_PROPERTIES_UPDATE") == null - mcVersionRange = rootProject.supported_minecraft_versions - allowedReleaseTypes = Set.of(ReleaseType.RELEASE) - propertiesData = [ - 'yarn_version': outlet.yarnVersion(project.minecraft_version), - 'loader_version': outlet.loaderVersion(), - 'fapi_version': outlet.fapiVersion(project.minecraft_version) - ] -} - - -loom { - mods { - modid { - sourceSet sourceSets.main - } - } - - accessWidenerPath = file("src/main/resources/github-resourcepack-manager.accesswidener") - - runs { - server { - runDir "run/server" - } - - client { - runDir "run/client" - } - } -} - -// https://gist.github.com/maityyy/3dbcd558d58a6412c3a2a38c72706e8e -afterEvaluate { - loom.runs.configureEach { - vmArg "-javaagent:${project.configurations.compileClasspath.find{ it.name.contains("sponge-mixin") }}" - if (System.getenv("DISABLE_PROPERTIES_UPDATE") == null) vmArg "-Ddevauth.enabled=true" - } -} - -repositories { - mavenCentral() - mavenLocal() - maven { - name = "DevAuth" - url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" - content { - includeGroup "me.djtheredstoner" - } - } -} - -configurations { - includeModImplementation - - include.extendsFrom includeModImplementation - modImplementation.extendsFrom includeModImplementation - - - includeImplementation - - include.extendsFrom includeImplementation - implementation.extendsFrom includeImplementation - - common { - canBeResolved = true - canBeConsumed = false - } - api.extendsFrom common -} - -dependencies { - minecraft "com.mojang:minecraft:${project.minecraft_version}" - mappings "net.fabricmc:yarn:${project.yarn_version}:v2" - modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" - - modRuntimeOnly "me.djtheredstoner:DevAuth-fabric:${project.devauth_version}" - - modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-1.21.9:${project.monkeylib538_version}+1.21.9") { - exclude(group: "net.fabricmc.fabric-api") - exclude(group: "top.offsetmonkey538.monkeylib538:monkeylib538-fabric") - } - modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { - exclude(group: "net.fabricmc.fabric-api") - } - //modRuntimeOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { - // exclude(group: "net.fabricmc.fabric-api") - //} - //modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${project.monkeylib538_version}") { - // exclude(group: "net.fabricmc.fabric-api") - //} - - modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" - - runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}+1.21.4") { - exclude(group: "net.fabricmc.fabric-api") - exclude(group: "top.offsetmonkey538.monkeylib538") - } - - include project(path: ":common", configuration: "shadow") - common project(":common") -} - -processResources { - final Map properties = Map.of( - "modVersion", project.version, - "supportedMinecraftVersions", project.supported_minecraft_versions, - "monkeylib538Version", project.monkeylib538_version - ) - - inputs.properties(properties) - - filesMatching("fabric.mod.json") { - expand(properties) - } - - exclude ".cache/**" -} - -modrinth { - loaders = ["fabric"] - uploadFile = remapJar.archiveFile - - dependencies { - required.project "monkeylib538" - required.project "fabric-api" - } -} \ No newline at end of file diff --git a/fabric/gradle.properties b/fabric/gradle.properties deleted file mode 100644 index bc755f6..0000000 --- a/fabric/gradle.properties +++ /dev/null @@ -1,15 +0,0 @@ -minecraft_version = 1.21.10 - -# Fabric -# Check at https://fabricmc.net/develop -# These should be automatically updated, unless the environment -# variable "DISABLE_PROPERTIES_UPDATE" is set. -yarn_version = 1.21.10+build.3 -loader_version = 0.18.4 -fapi_version = 0.138.4+1.21.10 - -# Dependencies -## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth -devauth_version = 1.2.1 - -nameSuffix = fabric diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json deleted file mode 100644 index f8f1dce..0000000 --- a/fabric/src/main/resources/fabric.mod.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "schemaVersion": 1, - "id": "github-resourcepack-manager", - "version": "${modVersion}", - "name": "Github Resourcepack Manager", - "description": "Modify server resourcepack from GitHub.", - "authors": [ - "OffsetMonkey538" - ], - "contact": { - "sources": "https://github.com/OffsetMods538/Github-Resourcepack-manager", - "issues": "https://github.com/OffsetMods538/Github-Resourcepack-manager/issues", - "homepage": "https://modrinth.com/mod/github-resourcepack-manager" - }, - "license": "MIT", - "icon": "assets/github-resourcepack-manager/icon.png", - "environment": "server", - "entrypoints": { - "server": [ - "top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformMain" - ] - }, - "mixins": [ - "github-resourcepack-manager.mixins.json" - ], - "accessWidener": "github-resourcepack-manager.accesswidener", - "depends": { - "minecraft": "${supportedMinecraftVersions}", - "monkeylib538": ">=${monkeylib538Version}", - "fabric-api": "*" - } -} diff --git a/fabric/src/main/resources/github-resourcepack-manager.accesswidener b/fabric/src/main/resources/github-resourcepack-manager.accesswidener deleted file mode 100644 index b9bc9cb..0000000 --- a/fabric/src/main/resources/github-resourcepack-manager.accesswidener +++ /dev/null @@ -1 +0,0 @@ -accessWidener v1 named diff --git a/gradle.properties b/gradle.properties index 728dfcb..c070740 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,43 @@ # Increase memory and *parallel* -org.gradle.jvmargs = -Xmx6G -org.gradle.parallel = true +org.gradle.jvmargs = -Xmx6G +org.gradle.parallel = true -minecraft_version = 1.21.4 - -# MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1762972806024+d227635 # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-alpha.3 -jgit_version = 6.9.0.202403050737-r +monkeylib538_version = 3.0.0-beta.2.1769533505281+9e950f8 +# MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib +meshlib_version = 2.0.0-alpha.0.1769533647381+4a26cb6 +# JGit +jgit_version = 6.9.0.202403050737-r +## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify +jspecify_version = 1.0.0 +## Bundeled with Minecraft, common needs to use +guava_version = 33.4.0-jre +## Bundeled with Minecraft, common needs to use +brigadier_version = 1.3.10 +## Bundeled with Minecraft, common needs to use +commonsio_version = 2.18.0 +## Bundeled with Minecraft, common needs to use +commonslang_version = 3.18.0 +## Bundeled with Minecraft, common needs to use +gson_version = 2.11.0 +## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth +devauth_version = 1.2.2 +## Gradle plugins +neoforged_moddev = 2.0.+ +fabric_loom = 1.14-SNAPSHOT +papermc_paperweight_userdev = 2.0.0-beta.19 +jpenilla_run_task = 3.0.2 +gradleup_shadow = 9.3.1 +jpenilla_resource_factory = 1.3.1 +dexman_outlet = 1.6.1 +modrinth_minotaur = 2.+ # Mod Properties -mod_version = 5.0.0-alpha.0 -supported_minecraft_versions = >=1.20.5 +mod_version = 5.0.0-alpha.0 +mod_name = Git Pack Manager +mod_id = git-pack-manager +mod_description = Allows for auto-updating resource and data packs at runtime from a git repository. +mod_website = https://modrinth.com/mod/git-pack-manager +mod_issues = https://github.com/OffsetMods538/Git-Pack-Manager/issues +mod_sources = https://github.com/OffsetMods538/Git-Pack-Manager diff --git a/loader/fabric/1.21.1/gradle.properties b/loader/fabric/1.21.1/gradle.properties new file mode 100644 index 0000000..95ee20f --- /dev/null +++ b/loader/fabric/1.21.1/gradle.properties @@ -0,0 +1,15 @@ +project_name = fabric-1.21.1 +commonModdedVersion = 1.21.1 + +monkeylib538_suffix = 1.21 +meshlib_suffix = 1.21.1 + +# Minecraft version +minecraft_version = 1.21.1 +# TODO: max version? +supported_minecraft_versions = >=1.21.1 + +# These should be automatically updated, unless the environment +# variable "DISABLE_PROPERTIES_UPDATE" is set. +loader_version = 0.18.4 +fapi_version = 0.116.8+1.21.1 diff --git a/loader/fabric/build.gradle b/loader/fabric/build.gradle new file mode 100644 index 0000000..baf9995 --- /dev/null +++ b/loader/fabric/build.gradle @@ -0,0 +1,60 @@ +import dex.plugins.outlet.v2.util.ReleaseType +import xyz.jpenilla.resourcefactory.fabric.Environment + +plugins { + id 'multiloader-fabric' +} + +allprojects { + fabricModJson { + mitLicense() + author("OffsetMonkey538") + contact { + extra = ["discord": "https://discord.offsetmonkey538.top"] + } + environment = Environment.SERVER + serverEntrypoint("top.offsetmonkey538.gitpackmanager.fabric.platform.PlatformUtilImpl\$GitPackManagerInitializer") + mixin("git-pack-manager.modded.mixins.json") + + depends("fabric-api", "*") + depends("monkeylib538", ">=${rootProject.monkeylib538_version}") + depends("meshlib", ">=${rootProject.meshlib_version}") + } + + // Gotta have this here cause I can't import it in buildSrc + outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) + + dependencies { + modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fapi_version}" + + modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${rootProject.monkeylib538_version}+fabric") { + exclude(group: "net.fabricmc.fabric-api") + } + modCompileOnly("top.offsetmonkey538.meshlib:meshlib-fabric:${rootProject.meshlib_version}+fabric") { + exclude(group: "net.fabricmc.fabric-api") + exclude(group: "top.offsetmonkey538.monkeylib538") + } + } +} + +subprojects { + dependencies { + modImplementation("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+fabric+${project.monkeylib538_suffix}") { + exclude(group: "net.fabricmc.fabric-api") + } + modImplementation("top.offsetmonkey538.meshlib:meshlib-fabric-${project.meshlib_suffix}:${rootProject.meshlib_version}+fabric+${project.meshlib_suffix}") { + exclude(group: "net.fabricmc.fabric-api") + exclude(group: "top.offsetmonkey538.monkeylib538") + } + + includeRuntime "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" + } + + modrinth { + dependencies { + required.project "fabric-api" + required.project "monkeylib538" + required.project "mesh-lib" + } + } +} diff --git a/loader/fabric/gradle.properties b/loader/fabric/gradle.properties new file mode 100644 index 0000000..ed59ba3 --- /dev/null +++ b/loader/fabric/gradle.properties @@ -0,0 +1,10 @@ +project_name = fabric + +# Minecraft version +minecraft_version = 1.21.11 +supported_minecraft_versions = * + +# These should be automatically updated, unless the environment +# variable "DISABLE_PROPERTIES_UPDATE" is set. +loader_version = 0.18.4 +fapi_version = 0.141.2+1.21.11 diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java diff --git a/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java similarity index 100% rename from fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java rename to loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java diff --git a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand similarity index 100% rename from fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand rename to loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand diff --git a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain similarity index 100% rename from fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain rename to loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain diff --git a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties similarity index 100% rename from fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties rename to loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties diff --git a/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText similarity index 100% rename from fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText rename to loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText diff --git a/fabric/src/main/resources/assets/github-resourcepack-manager/icon.png b/loader/fabric/src/main/resources/assets/github-resourcepack-manager/icon.png similarity index 100% rename from fabric/src/main/resources/assets/github-resourcepack-manager/icon.png rename to loader/fabric/src/main/resources/assets/github-resourcepack-manager/icon.png diff --git a/fabric/src/main/resources/github-resourcepack-manager.mixins.json b/loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json similarity index 100% rename from fabric/src/main/resources/github-resourcepack-manager.mixins.json rename to loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json diff --git a/loader/neoforge/1.21.1/gradle.properties b/loader/neoforge/1.21.1/gradle.properties new file mode 100644 index 0000000..e85cce2 --- /dev/null +++ b/loader/neoforge/1.21.1/gradle.properties @@ -0,0 +1,16 @@ +project_name = neoforge-1.21.1 +commonModdedVersion = 1.21.1 + +monkeylib538_suffix = 1.21 +meshlib_suffix = 1.21.1 + +# Minecraft version +minecraft_version = 1.21.1 +# TODO: max version? +supported_minecraft_versions = >=1.21.1 +# TODO: max version? +minecraft_version_range = [1.21.1,) + +neoforge_version = 21.1.218 +parchment_minecraft_version = 1.21.1 +parchment_mappings_version = 2024.11.17 diff --git a/loader/neoforge/build.gradle b/loader/neoforge/build.gradle new file mode 100644 index 0000000..f475807 --- /dev/null +++ b/loader/neoforge/build.gradle @@ -0,0 +1,47 @@ +import dex.plugins.outlet.v2.util.ReleaseType + +plugins { + id 'multiloader-neoforge' +} + +allprojects { + neoForgeModsToml { + mitLicense() + mod(rootProject.neo_mod_id) { + authors = "OffsetMonkey538" + dependencies { + required("monkeylib538", "[${rootProject.monkeylib538_version},)") + required("meshlib", "[${rootProject.meshlib_version},)") + } + } + mixin("git-pack-manager.modded.mixins.json") + } + + dependencies { + compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}+neoforge" + compileOnly("top.offsetmonkey538.meshlib:meshlib-neoforge:${rootProject.meshlib_version}+neoforge") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } + } +} + +subprojects { + // Gotta have this here cause I can't import it in buildSrc + outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) + + dependencies { + implementation "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+neoforge+${project.monkeylib538_suffix}" + implementation ("top.offsetmonkey538.meshlib:meshlib-neoforge-${project.meshlib_suffix}:${rootProject.meshlib_version}+neoforge+${project.meshlib_suffix}") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } + + includeRuntime "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" + } + + modrinth { + dependencies { + required.project "monkeylib538" + required.project "mesh-lib" + } + } +} diff --git a/loader/neoforge/gradle.properties b/loader/neoforge/gradle.properties new file mode 100644 index 0000000..0881a7e --- /dev/null +++ b/loader/neoforge/gradle.properties @@ -0,0 +1,8 @@ +project_name = neoforge + +# Minecraft version +minecraft_version = 1.21.11 + +neoforge_version = 21.11.37-beta +parchment_minecraft_version = 1.21.11 +parchment_mappings_version = 2025.12.20 diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java diff --git a/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java similarity index 100% rename from neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand similarity index 100% rename from neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand rename to loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain similarity index 100% rename from neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain rename to loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties similarity index 100% rename from neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties rename to loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties diff --git a/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText similarity index 100% rename from neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText rename to loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText diff --git a/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png b/loader/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png similarity index 100% rename from neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png rename to loader/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png diff --git a/neoforge/src/main/resources/github-resourcepack-manager.mixins.json b/loader/neoforge/src/main/resources/github-resourcepack-manager.mixins.json similarity index 100% rename from neoforge/src/main/resources/github-resourcepack-manager.mixins.json rename to loader/neoforge/src/main/resources/github-resourcepack-manager.mixins.json diff --git a/loader/paper/1.21.1/gradle.properties b/loader/paper/1.21.1/gradle.properties new file mode 100644 index 0000000..d55ad0a2 --- /dev/null +++ b/loader/paper/1.21.1/gradle.properties @@ -0,0 +1,11 @@ +project_name = paper-1.21.1 + +monkeylib538_suffix = 1.21.1 +meshlib_suffix = 1.21.1 + +# Minecraft version +minecraft_version = 1.21.1 +# TODO: max version? +supported_minecraft_versions = >=1.21.1 + +paper_version = 1.21.1-R0.1-SNAPSHOT diff --git a/loader/paper/build.gradle b/loader/paper/build.gradle new file mode 100644 index 0000000..2a56145 --- /dev/null +++ b/loader/paper/build.gradle @@ -0,0 +1,48 @@ +import dex.plugins.outlet.v2.util.ReleaseType +import xyz.jpenilla.resourcefactory.paper.PaperPluginYaml + +plugins { + id 'multiloader-paper' +} + +allprojects { + // Gotta have this here cause I can't import it in buildSrc + outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) + + paperPluginYaml { + main = "top.offsetmonkey538.gitpackmanager.paper.platform.PlatformUtilImpl\$GitPackManagerInitializer" + authors.add("OffsetMonkey538") + load = "STARTUP" + dependencies { + server("MonkeyLib538", PaperPluginYaml.Load.BEFORE, true, true) + server("MESH_Lib", PaperPluginYaml.Load.BEFORE, true, true) + } + } + + dependencies { + compileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-paper:${rootProject.monkeylib538_version}+paper") + compileOnly("top.offsetmonkey538.meshlib:meshlib-paper:${rootProject.meshlib_version}+paper") { + exclude(group: "top.offsetmonkey538.monkeylib538") + } + } +} + +subprojects { + dependencies { + implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" // TODO: does jgit need trasitive = false? + } + + tasks.runServer { + downloadPlugins { + url("https://maven.offsetmonkey538.top/releases/top/offsetmonkey538/monkeylib538/monkeylib538-paper-${project.monkeylib538_suffix}/${rootProject.monkeylib538_version}+paper+${project.monkeylib538_suffix}/monkeylib538-paper-${project.monkeylib538_suffix}-${rootProject.monkeylib538_version}+paper+${project.monkeylib538_suffix}-all.jar") + url("https://maven.offsetmonkey538.top/releases/top/offsetmonkey538/meshlib/meshlib-paper-${project.meshlib_suffix}/${rootProject.meshlib_version}+paper+${project.meshlib_suffix}/meshlib-paper-${project.meshlib_suffix}-${rootProject.meshlib_version}+paper+${project.meshlib_suffix}-all.jar") + } + } + + modrinth { + dependencies { + required.project "monkeylib538" + required.project "mesh-lib" + } + } +} diff --git a/loader/paper/gradle.properties b/loader/paper/gradle.properties new file mode 100644 index 0000000..2f5d4ca --- /dev/null +++ b/loader/paper/gradle.properties @@ -0,0 +1,7 @@ +project_name = paper + +# Minecraft version +minecraft_version = 1.21.11 +supported_minecraft_versions = * + +paper_version = 1.21.11-R0.1-SNAPSHOT diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java similarity index 100% rename from paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java rename to loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java similarity index 56% rename from paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java rename to loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java index d607f42..20ec27f 100644 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java @@ -1,20 +1,14 @@ package top.offsetmonkey538.githubresourcepackmanager.platform.paper; import net.minecraft.server.MinecraftServer; -import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.plugin.java.JavaPlugin; +import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import java.util.List; - public class PaperPlatformMain implements PlatformMain { - private static PaperPlugin plugin; - + private static GitPackManagerInitializer plugin; @Override public void refreshDatapacks() { @@ -23,17 +17,27 @@ public void refreshDatapacks() { @Override public void sendMessageToAdmins(MonkeyLibText message) { - for (final OfflinePlayer operator : plugin.getServer().getOperators()) { + for (final OfflinePlayer operator : getPlugin().getServer().getOperators()) { if (operator.getPlayer() == null) continue; // todo: once monkeylib has da paper: operator.getPlayer().sendMessage(PaperMonkeyLibText.of(text)); } } - public static void setPlugin(PaperPlugin plugin) { + private static void setPlugin(GitPackManagerInitializer plugin) { PaperPlatformMain.plugin = plugin; } - public static PaperPlugin getPlugin() { + public static GitPackManagerInitializer getPlugin() { return plugin; } + + + public static final class GitPackManagerInitializer extends JavaPlugin { + @Override + public void onEnable() { + PaperPlatformMain.setPlugin(this); + GithubResourcepackManager.initialize(); + } + } + } diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java similarity index 100% rename from paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java rename to loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java similarity index 100% rename from paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java rename to loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java diff --git a/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand similarity index 100% rename from paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand diff --git a/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging similarity index 100% rename from paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging diff --git a/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain similarity index 100% rename from paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain diff --git a/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties similarity index 100% rename from paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties diff --git a/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText similarity index 100% rename from paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText diff --git a/modded/1.21.1/gradle.properties b/modded/1.21.1/gradle.properties new file mode 100644 index 0000000..2b5e007 --- /dev/null +++ b/modded/1.21.1/gradle.properties @@ -0,0 +1,7 @@ +project_name = modded-1.21.1 + +monkeylib538_suffix = 1.21 +meshlib_suffix = 1.21.1 + +# Minecraft version +minecraft_version = 1.21.1 diff --git a/modded/build.gradle b/modded/build.gradle new file mode 100644 index 0000000..5708434 --- /dev/null +++ b/modded/build.gradle @@ -0,0 +1,17 @@ +plugins { + id 'multiloader-modded' +} + +allprojects { + dependencies { + modCompileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-modded:${rootProject.monkeylib538_version}+modded" + modCompileOnly "top.offsetmonkey538.meshlib:meshlib-modded:${rootProject.meshlib_version}+modded" + } +} + +subprojects { + dependencies { + modCompileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-modded-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+modded+${project.monkeylib538_suffix}" + modCompileOnly "top.offsetmonkey538.meshlib:meshlib-modded-${project.meshlib_suffix}:${rootProject.meshlib_version}+modded+${project.meshlib_suffix}" + } +} diff --git a/modded/gradle.properties b/modded/gradle.properties new file mode 100644 index 0000000..1df7c91 --- /dev/null +++ b/modded/gradle.properties @@ -0,0 +1,4 @@ +project_name = modded + +# Minecraft version +minecraft_version = 1.21.11 diff --git a/neoforge/build.gradle b/neoforge/build.gradle deleted file mode 100644 index b495727..0000000 --- a/neoforge/build.gradle +++ /dev/null @@ -1,100 +0,0 @@ -import dex.plugins.outlet.v2.util.ReleaseType - -plugins { - id 'net.neoforged.moddev' version '2.0.112' - id 'io.github.dexman545.outlet' version '1.6.1' -} - -outlet { - mcVersionRange = rootProject.supported_minecraft_versions - allowedReleaseTypes = Set.of(ReleaseType.RELEASE) -} - -neoForge { - version = project.neoforge_version - - parchment { - mappingsVersion = project.parchment_mappings_version - minecraftVersion = project.minecraft_version - } - - mods { - "${project.name}" { - sourceSet(sourceSets.main) - } - } - - runs { - server { - server() - } - - configureEach { - systemProperty "forge.logging.markers", "REGISTRIES" - } - } -} - -repositories { - mavenCentral() - mavenLocal() - maven { - name = "DevAuth" - url = "https://pkgs.dev.azure.com/djtheredstoner/DevAuth/_packaging/public/maven/v1" - content { - includeGroup "me.djtheredstoner" - } - } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - api.extendsFrom common - - runtimeClasspath.extendsFrom localRuntime -} - -dependencies { - localRuntime "me.djtheredstoner:DevAuth-neoforge:${project.devauth_version}" - - runtimeOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-1.20.6:${rootProject.monkeylib538_version}+1.20.6" - compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}" - - - runtimeOnly("top.offsetmonkey538.meshlib:mesh-lib-neoforge:${rootProject.meshlib_version}+1.21.4") { - exclude(group: "top.offsetmonkey538.monkeylib538") - } - - jarJar(api(project(":common"))) - jarJar(additionalRuntimeClasspath("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}")) -} - -processResources { - final Map properties = Map.of( - "modVersion", project.version, - "supportedMinecraftVersions", project.minecraft_version_range, - "monkeylib538Version", project.monkeylib538_version, - "meshLibVersion", project.meshlib_version - ) - - inputs.properties(properties) - - filesMatching("META-INF/neoforge.mods.toml") { - expand(properties) - } - - exclude ".cache/**" -} - -modrinth { - loaders = ["neoforge"] - //todo idk:_uploadFile = remapJar.archiveFile - - dependencies { - required.project "monkeylib538" - // todo idk: required.project "fabric-api" - } -} \ No newline at end of file diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties deleted file mode 100644 index 406e37f..0000000 --- a/neoforge/gradle.properties +++ /dev/null @@ -1,12 +0,0 @@ -# Minecraft version, check at https://fabricmc.net/develop -minecraft_version = 1.21.4 -neoforge_version = 21.4.154 -parchment_mappings_version = 2025.03.23 - -# Dependencies -## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth -devauth_version = 1.2.1 - -nameSuffix = neoforge - -minecraft_version_range=[1.20.6,) diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml deleted file mode 100644 index ea42043..0000000 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ /dev/null @@ -1,39 +0,0 @@ -modLoader = "javafml" -loaderVersion = "[1,)" -license="MIT" - -issueTrackerURL="https://github.com/OffsetMods538/Github-Resourcepack-manager" - - -[[mods]] -modId="git_pack_manager" -displayName="Git Pack Manager" -version="${modVersion}" -displayURL="https://modrinth.com/mod/github-resourcepack-manager" -authors="OffsetMonkey538" -description="Modify server resourcepack from GitHub" - -[[mixins]] -config="github-resourcepack-manager.mixins.json" - - -[[dependencies.git_pack_manager]] -modId="minecraft" -type="required" -versionRange="${supportedMinecraftVersions}" -ordering="NONE" -side="BOTH" - -[[dependencies.git_pack_manager]] -modId="monkeylib538_common_neoforge" -type="required" -versionRange="[${monkeylib538Version},)" -ordering="NONE" -side="BOTH" - -[[dependencies.git_pack_manager]] -modId="mesh_lib_common" -type="required" -versionRange="[${meshLibVersion},)" -ordering="NONE" -side="BOTH" diff --git a/paper/build.gradle b/paper/build.gradle deleted file mode 100644 index c6ce13f..0000000 --- a/paper/build.gradle +++ /dev/null @@ -1,72 +0,0 @@ -import io.papermc.paperweight.userdev.ReobfArtifactConfiguration - -plugins { - id 'com.gradleup.shadow' version '9.0.0-beta4' - id 'io.papermc.paperweight.userdev' version '2.0.0-beta.8' - id 'xyz.jpenilla.run-paper' version '2.3.1' -} - -paperweight.reobfArtifactConfiguration = ReobfArtifactConfiguration.getMOJANG_PRODUCTION() - -repositories { - mavenCentral() - mavenLocal() - maven { - name = "PaperMC" - url = "https://repo.papermc.io/repository/maven-public/" - content { - includeGroup "io.papermc.paper" - } - } - maven { - name = "Mojang Libraries" - url = "https://libraries.minecraft.net" - content { - includeGroup "com.mojang" - } - } -} - -configurations { - common { - canBeResolved = true - canBeConsumed = false - } - implementation.extendsFrom common -} - -dependencies { - compileOnly "io.papermc.paper:paper-api:${project.paper_version}" - - paperweight.paperDevBundle(project.paper_version) - - implementation "xyz.jpenilla:reflection-remapper:${project.reflection_remapper_version}" - implementation("top.offsetmonkey538.meshlib:mesh-lib-paper:${rootProject.meshlib_version}+1.21.4") { - exclude(group: "top.offsetmonkey538.monkeylib538") - } - - common project(path: ":common", configuration: "shadow") -} -tasks.build.dependsOn(shadowJar) - -processResources { - final Map properties = Map.of( - "modVersion", project.version, - "lowestMinecraftVersion", outlet.mcVersions().first() // Hopefully outlet always does stuff in this order - ) - - inputs.properties(properties) - - filesMatching("plugin.yml") { - expand(properties) - } -} - -tasks.runServer { - minecraftVersion(project.minecraft_version) -} - -modrinth { - loaders = ["fabric"] - uploadFile = shadowJar -} \ No newline at end of file diff --git a/paper/gradle.properties b/paper/gradle.properties deleted file mode 100644 index eebf3fe..0000000 --- a/paper/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -paper_version = 1.21.4-R0.1-SNAPSHOT - -reflection_remapper_version = 0.1.1 - -nameSuffix = paper diff --git a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java b/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java deleted file mode 100644 index fc6e210..0000000 --- a/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlugin.java +++ /dev/null @@ -1,14 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; - -import org.bukkit.plugin.java.JavaPlugin; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; - -public class PaperPlugin extends JavaPlugin { - - @Override - public void onEnable() { - PaperPlatformMain.setPlugin(this); - - GithubResourcepackManager.initialize(); - } -} diff --git a/paper/src/main/resources/plugin.yml b/paper/src/main/resources/plugin.yml deleted file mode 100644 index 2010759..0000000 --- a/paper/src/main/resources/plugin.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: Github-Resourcepack-Manager -version: '${modVersion}' -main: top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlugin -description: Modify server resourcepack from GitHub." -author: OffsetMonkey538 -website: https://github.com/OffsetMods538/Github-Resourcepack-Manager -api-version: '${lowestMinecraftVersion}' -load: STARTUP -prefix: GitHub Resourcepack Manager diff --git a/settings.gradle b/settings.gradle index 66601c4..51c75c7 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,11 +9,19 @@ pluginManagement { } } -rootProject.name = "github-resourcepack-manager" +rootProject.name = "git-pack-manager" include "common" -include "fabric" -include "neoforge" -include "paper" +include "modded" +include "modded:1.21.1" + +include "loader:fabric" +include "loader:fabric:1.21.1" + +include "loader:neoforge" +include "loader:neoforge:1.21.1" + +include "loader:paper" +include "loader:paper:1.21.1" From 3acbfcf19dbeb44b88afbe6cc652bd83ebe20bc5 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 20:41:53 +0200 Subject: [PATCH 56/89] fix compile errors (nothing probably works though) --- common/build.gradle | 2 +- .../config/webhook/DefaultWebhookBody.java | 5 -- .../platform/PlatformText.java | 11 --- .../GithubResourcepackManager.java | 79 +++++++++--------- .../command/GitPackManagerCommand.java | 38 ++++----- .../config/ConfigHandler.java | 20 ++--- .../config/ModConfig.java | 52 ++++++------ .../config/webhook/BasicWebhook.java | 2 +- .../config/webhook/DefaultWebhookBody.java | 5 ++ .../discord/basic/BasicFailMessage.java | 4 +- .../discord/basic/BasicSuccessMessage.java | 4 +- .../discord/embed/EmbedFailMessage.java | 4 +- .../discord/embed/EmbedSuccessMessage.java | 4 +- .../GithubResourcepackManagerException.java | 2 +- .../git/CommitProperties.java | 2 +- .../handler/DataPackHandler.java | 8 +- .../handler/GitHandler.java | 10 +-- .../handler/ResourcePackHandler.java | 14 ++-- .../networking/FileHttpHandler.java | 6 +- .../networking/MainHttpHandler.java | 12 +-- .../networking/WebhookHttpHandler.java | 4 +- .../platform/PlatformCommand.java | 8 +- .../platform/PlatformMain.java | 8 +- .../platform/PlatformServerProperties.java | 10 +-- .../gitpackmanager/platform/PlatformText.java | 11 +++ .../platform/ServiceLoader.java | 2 +- .../utils/MyFileUtils.java | 4 +- .../utils/StringUtils.java | 8 +- .../utils/WebhookSender.java | 6 +- .../utils/ZipUtils.java | 4 +- .../github-resourcepack-manager/icon.png | Bin loader/fabric/build.gradle | 2 +- .../AbstractPropertiesHandlerAccessor.java | 14 ---- .../MinecraftDedicatedServerAccessor.java | 13 --- .../mixin/ServerPropertiesLoaderAccessor.java | 20 ----- .../fabric/FabricPlatformCommand.java | 41 --------- .../platform/fabric/FabricPlatformMain.java | 45 ---------- .../FabricPlatformServerProperties.java | 57 ------------- .../platform/fabric/FabricPlatformText.java | 27 ------ .../fabric/GitPackManagerInitializer.java | 15 ++++ ...sourcepackmanager.platform.PlatformCommand | 1 - ...bresourcepackmanager.platform.PlatformMain | 1 - ...kmanager.platform.PlatformServerProperties | 1 - ...bresourcepackmanager.platform.PlatformText | 1 - .../github-resourcepack-manager.mixins.json | 13 --- .../neoforge/NeoforgePlatformMain.java | 39 --------- .../neoforge/NeoforgePlatformText.java | 25 ------ .../neoforge/GitPackManagerInitializer.java} | 12 +-- ...sourcepackmanager.platform.PlatformCommand | 1 - ...bresourcepackmanager.platform.PlatformMain | 1 - ...kmanager.platform.PlatformServerProperties | 1 - ...bresourcepackmanager.platform.PlatformText | 1 - .../github-resourcepack-manager/icon.png | Bin 1761 -> 0 bytes .../github-resourcepack-manager.mixins.json | 13 --- .../paper/platform}/PaperPlatformCommand.java | 8 +- .../paper/platform}/PaperPlatformMain.java | 8 +- .../PaperPlatformServerProperties.java | 14 ++-- .../paper/platform}/PaperPlatformText.java | 8 +- ...sourcepackmanager.platform.PlatformCommand | 1 - ...sourcepackmanager.platform.PlatformLogging | 1 - ...bresourcepackmanager.platform.PlatformMain | 1 - ...kmanager.platform.PlatformServerProperties | 1 - ...bresourcepackmanager.platform.PlatformText | 1 - ...38.gitpackmanager.platform.PlatformCommand | 1 + ...38.gitpackmanager.platform.PlatformLogging | 1 + ...ey538.gitpackmanager.platform.PlatformMain | 1 + ...kmanager.platform.PlatformServerProperties | 1 + ...ey538.gitpackmanager.platform.PlatformText | 1 + .../mixin/DedicatedServerAccessor.java | 2 +- .../DedicatedServerSettingsAccessor.java | 2 +- .../modded}/mixin/SettingsAccessor.java | 2 +- .../platform/ModdedPlatformCommand.java | 14 ++-- .../modded/platform/ModdedPlatformMain.java | 34 ++++++++ .../ModdedPlatformServerProperties.java | 24 +++--- .../modded/platform/ModdedPlatformText.java | 25 ++++++ ...38.gitpackmanager.platform.PlatformCommand | 1 + ...ey538.gitpackmanager.platform.PlatformMain | 1 + ...kmanager.platform.PlatformServerProperties | 1 + ...ey538.gitpackmanager.platform.PlatformText | 1 + .../git-pack-manager.modded.mixins.json | 13 +++ 80 files changed, 316 insertions(+), 545 deletions(-) delete mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/DefaultWebhookBody.java delete mode 100644 common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/GithubResourcepackManager.java (83%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/command/GitPackManagerCommand.java (75%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/ConfigHandler.java (82%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/ModConfig.java (86%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/webhook/BasicWebhook.java (90%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/webhook/discord/basic/BasicFailMessage.java (73%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/webhook/discord/basic/BasicSuccessMessage.java (76%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/webhook/discord/embed/EmbedFailMessage.java (78%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/config/webhook/discord/embed/EmbedSuccessMessage.java (85%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/exception/GithubResourcepackManagerException.java (89%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/git/CommitProperties.java (93%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/handler/DataPackHandler.java (95%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/handler/GitHandler.java (95%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/handler/ResourcePackHandler.java (94%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/networking/FileHttpHandler.java (86%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/networking/MainHttpHandler.java (65%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/networking/WebhookHttpHandler.java (80%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/platform/PlatformCommand.java (50%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/platform/PlatformMain.java (67%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/platform/PlatformServerProperties.java (81%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/platform/ServiceLoader.java (84%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/utils/MyFileUtils.java (84%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/utils/StringUtils.java (87%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/utils/WebhookSender.java (89%) rename common/src/main/java/top/offsetmonkey538/{githubresourcepackmanager => gitpackmanager}/utils/ZipUtils.java (97%) rename {loader/fabric => common}/src/main/resources/assets/github-resourcepack-manager/icon.png (100%) delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java delete mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java create mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java delete mode 100644 loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand delete mode 100644 loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain delete mode 100644 loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties delete mode 100644 loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText delete mode 100644 loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json delete mode 100644 loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java delete mode 100644 loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java rename loader/neoforge/src/main/java/top/offsetmonkey538/{githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java => gitpackmanager/neoforge/GitPackManagerInitializer.java} (53%) delete mode 100644 loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand delete mode 100644 loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain delete mode 100644 loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties delete mode 100644 loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText delete mode 100644 loader/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png delete mode 100644 loader/neoforge/src/main/resources/github-resourcepack-manager.mixins.json rename loader/paper/src/main/java/top/offsetmonkey538/{githubresourcepackmanager/platform/paper => gitpackmanager/paper/platform}/PaperPlatformCommand.java (88%) rename loader/paper/src/main/java/top/offsetmonkey538/{githubresourcepackmanager/platform/paper => gitpackmanager/paper/platform}/PaperPlatformMain.java (79%) rename loader/paper/src/main/java/top/offsetmonkey538/{githubresourcepackmanager/platform/paper => gitpackmanager/paper/platform}/PaperPlatformServerProperties.java (78%) rename loader/paper/src/main/java/top/offsetmonkey538/{githubresourcepackmanager/platform/paper => gitpackmanager/paper/platform}/PaperPlatformText.java (76%) delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText rename {loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager => modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded}/mixin/DedicatedServerAccessor.java (84%) rename {loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager => modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded}/mixin/DedicatedServerSettingsAccessor.java (89%) rename {loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager => modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded}/mixin/SettingsAccessor.java (82%) rename loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java => modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java (73%) create mode 100644 modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java rename loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java => modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java (60%) create mode 100644 modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java create mode 100644 modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand create mode 100644 modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain create mode 100644 modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties create mode 100644 modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText create mode 100644 modded/src/main/resources/git-pack-manager.modded.mixins.json diff --git a/common/build.gradle b/common/build.gradle index ab6be8c..3826cec 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -16,7 +16,7 @@ dependencies { compileOnlyApi "top.offsetmonkey538.monkeylib538:monkeylib538-common:${rootProject.monkeylib538_version}+common" compileOnlyApi "top.offsetmonkey538.meshlib:meshlib-common:${rootProject.meshlib_version}+common" - implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" + api "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" // should be bundled with minecraft compileOnly "com.mojang:brigadier:${rootProject.brigadier_version}" diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/DefaultWebhookBody.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/DefaultWebhookBody.java deleted file mode 100644 index 5e0be6b..0000000 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/DefaultWebhookBody.java +++ /dev/null @@ -1,5 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook; - -public interface DefaultWebhookBody { - String getName(); -} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java deleted file mode 100644 index 84272d1..0000000 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformText.java +++ /dev/null @@ -1,11 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; - -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; - -import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; - -public interface PlatformText { - PlatformText INSTANCE = load(PlatformText.class); - - void sendUpdateMessage(final MonkeyLibText updateMessage, boolean adminsOnly); -} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java similarity index 83% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index 2222668..3cd0da4 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -1,34 +1,33 @@ -package top.offsetmonkey538.githubresourcepackmanager; +package top.offsetmonkey538.gitpackmanager; import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.command.GitPackManagerCommand; -import top.offsetmonkey538.githubresourcepackmanager.config.ModConfig; -import top.offsetmonkey538.githubresourcepackmanager.config.ConfigHandler; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.handler.DataPackHandler; -import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; -import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; -import top.offsetmonkey538.githubresourcepackmanager.networking.MainHttpHandler; -import top.offsetmonkey538.githubresourcepackmanager.platform.*; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; -import top.offsetmonkey538.meshlib.api.router.HttpRouter; -import top.offsetmonkey538.meshlib.api.router.HttpRouterRegistry; -import top.offsetmonkey538.meshlib.api.rule.rules.PathHttpRule; -import top.offsetmonkey538.monkeylib538.api.command.ConfigCommandApi; -import top.offsetmonkey538.monkeylib538.api.lifecycle.ServerLifecycleApi; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; -import top.offsetmonkey538.monkeylib538.api.platform.PlatformUtil; -import top.offsetmonkey538.monkeylib538.api.telemetry.TelemetryRegistry; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.api.text.TextFormattingApi; -import top.offsetmonkey538.monkeylib538.telemetry.TelemetryHandler; -import top.offsetmonkey538.offsetconfig538.api.config.ConfigHolder; -import top.offsetmonkey538.offsetconfig538.api.config.ConfigManager; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; +import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; +import top.offsetmonkey538.gitpackmanager.config.ModConfig; +import top.offsetmonkey538.gitpackmanager.config.ConfigHandler; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.handler.DataPackHandler; +import top.offsetmonkey538.gitpackmanager.handler.GitHandler; +import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; +import top.offsetmonkey538.gitpackmanager.networking.MainHttpHandler; +import top.offsetmonkey538.gitpackmanager.platform.*; +import top.offsetmonkey538.gitpackmanager.utils.StringUtils; +import top.offsetmonkey538.meshlib.common.api.router.HttpRouter; +import top.offsetmonkey538.meshlib.common.api.router.HttpRouterRegistry; +import top.offsetmonkey538.meshlib.common.api.rule.rules.PathHttpRule; +import top.offsetmonkey538.monkeylib538.common.api.command.ConfigCommandApi; +import top.offsetmonkey538.monkeylib538.common.api.lifecycle.ServerLifecycleApi; +import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; +import top.offsetmonkey538.monkeylib538.common.api.telemetry.TelemetryRegistry; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibStyle; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.common.api.text.TextFormattingApi; +import top.offsetmonkey538.offsetutils538.api.config.ConfigHolder; +import top.offsetmonkey538.offsetutils538.api.config.ConfigManager; +import top.offsetmonkey538.offsetutils538.api.log.OffsetLogger; import java.io.IOException; import java.nio.file.Files; @@ -44,11 +43,11 @@ private GithubResourcepackManager() { } - public static final String MOD_ID = "github-resourcepack-manager"; - public static final MonkeyLibLogger LOGGER = MonkeyLibLogger.create(MOD_ID); - public static final String MOD_URI = "gh-rp-manager"; + public static final String MOD_ID = "git-pack-manager"; + public static final String MOD_URI = MOD_ID; + public static final OffsetLogger LOGGER = OffsetLogger.create(MOD_ID); - public static final Path DATA_FOLDER = PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(".packs"); + public static final Path DATA_FOLDER = LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(".packs"); public static final Path GIT_FOLDER = DATA_FOLDER.resolve("git"); public static final Path RESOURCEPACK_FOLDER = DATA_FOLDER.resolve("resource-pack"); @@ -59,7 +58,7 @@ private GithubResourcepackManager() { public static final Pattern RESOURCEPACK_NAME_PATTERN = Pattern.compile("\\d+-"); public static final UUID RESOURCEPACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); - public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/gh-rp-manager request-pack"); + public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/git-pack-manager request-pack"); private static final Executor EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(MOD_ID + "-%d").build()); @@ -75,17 +74,17 @@ private GithubResourcepackManager() { } @SuppressWarnings("NotNullFieldNotInitialized") - public static @NotNull ConfigHolder config; + public static @NonNull ConfigHolder config; public static ResourcePackHandler resourcePackHandler; private static boolean disabled; public static void initialize() { - TelemetryRegistry.register("git-pack-manager"); // TODO: replace with MOD_ID once I do that + TelemetryRegistry.register(MOD_ID); addLogToAdminListeners(); - PlatformUtil.sendMessagesToAdminsOnJoin(() -> { + LoaderUtil.sendMessagesToAdminsOnJoin(() -> { if (MESSAGE_QUEUE.isEmpty()) return new MonkeyLibText[] {}; final MonkeyLibText[] result = new MonkeyLibText[MESSAGE_QUEUE.size() + 1]; @@ -95,7 +94,7 @@ public static void initialize() { }); // config should be initialized after the error listeners - config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER::error)); + config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER)); GitPackManagerCommand.register(); ConfigCommandApi.registerConfigCommand( @@ -119,15 +118,15 @@ public static void initialize() { )); }); - ServerLifecycleApi.runOnServerStarted(() -> updatePack(UpdateType.RESTART, true)); + ServerLifecycleApi.STARTED.listen(() -> updatePack(UpdateType.RESTART, true)); } private static void addLogToAdminListeners() { - LOGGER.addListener(MonkeyLibLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibStyle.Color.RED)); - LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibStyle.Color.YELLOW)); + LOGGER.addListener(OffsetLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibStyle.Color.RED)); + LOGGER.addListener(OffsetLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibStyle.Color.YELLOW)); } - private static MonkeyLibLogger.LogListener createLogToAdminListener(final int textColor) { + private static OffsetLogger.LogListener createLogToAdminListener(final int textColor) { return (message, error) -> { final MonkeyLibText text = MonkeyLibText .of("[%s] %s".formatted(MOD_ID, message)) diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java similarity index 75% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index 568d35b..66a6964 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -1,26 +1,26 @@ -package top.offsetmonkey538.githubresourcepackmanager.command; +package top.offsetmonkey538.gitpackmanager.command; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; import org.apache.commons.lang3.exception.ExceptionUtils; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.handler.GitHandler; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi; -import top.offsetmonkey538.monkeylib538.api.command.CommandRegistrationApi; -import top.offsetmonkey538.monkeylib538.api.log.MonkeyLibLogger; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibStyle; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.handler.GitHandler; +import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi; +import top.offsetmonkey538.monkeylib538.common.api.command.CommandRegistrationApi; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibStyle; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.offsetutils538.api.log.OffsetLogger; import java.util.Map; import static com.mojang.brigadier.arguments.BoolArgumentType.bool; import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.literal; -import static top.offsetmonkey538.monkeylib538.api.command.CommandAbstractionApi.sendText; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.literal; +import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.sendText; public final class GitPackManagerCommand { @@ -70,10 +70,10 @@ private static LiteralArgumentBuilder createCommand() { } private static void runTriggerUpdate(CommandContext context, boolean force) { - final MonkeyLibLogger.LogListener infoListener = (message, error) -> { + final OffsetLogger.LogListener infoListener = (message, error) -> { sendText(context, MonkeyLibText.of(String.format("[%s] %s", MOD_ID, message)).applyStyle(style -> style.withColor(MonkeyLibStyle.Color.GRAY))); }; - final MonkeyLibLogger.LogListener warnListener = (message, error) -> { + final OffsetLogger.LogListener warnListener = (message, error) -> { final MonkeyLibText text = MonkeyLibText .of("[%s] %s".formatted(MOD_ID, message)) .applyStyle(style -> style.withColor(MonkeyLibStyle.Color.YELLOW)); @@ -82,12 +82,12 @@ private static void runTriggerUpdate(CommandContext context, boolean for sendText(context, text); }; - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.addListener(OffsetLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.addListener(OffsetLogger.LogLevel.WARN, warnListener); GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND, false).thenRun(() -> { - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(MonkeyLibLogger.LogLevel.WARN, warnListener); + GithubResourcepackManager.LOGGER.removeListener(OffsetLogger.LogLevel.INFO, infoListener); + GithubResourcepackManager.LOGGER.removeListener(OffsetLogger.LogLevel.WARN, warnListener); }); } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java similarity index 82% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index 0b2fc06..ceadf6e 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -1,13 +1,13 @@ -package top.offsetmonkey538.githubresourcepackmanager.config; +package top.offsetmonkey538.gitpackmanager.config; import blue.endless.jankson.*; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.BasicWebhook; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicFailMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic.BasicSuccessMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedFailMessage; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed.EmbedSuccessMessage; +import org.jspecify.annotations.NonNull; +import top.offsetmonkey538.gitpackmanager.config.webhook.BasicWebhook; +import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicFailMessage; +import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicSuccessMessage; +import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedFailMessage; +import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedSuccessMessage; import java.io.IOException; import java.nio.file.Files; @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public final class ConfigHandler { private ConfigHandler() { @@ -63,7 +63,7 @@ private static void createDefaultWebhooks() { } } - private static @NotNull List checkConfigErrors() { + private static @NonNull List checkConfigErrors() { final List errors = new ArrayList<>(); if (config.get().serverInfo.publicIp == null) errors.add("Field 'serverInfo.publicIp' not set!"); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java similarity index 86% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index ca142d0..a7a74a0 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -1,16 +1,16 @@ -package top.offsetmonkey538.githubresourcepackmanager.config; +package top.offsetmonkey538.gitpackmanager.config; import blue.endless.jankson.*; import blue.endless.jankson.api.Marshaller; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; -import top.offsetmonkey538.githubresourcepackmanager.utils.WebhookSender; -import top.offsetmonkey538.monkeylib538.api.platform.PlatformUtil; -import top.offsetmonkey538.offsetconfig538.api.config.Config; -import top.offsetmonkey538.offsetconfig538.api.config.Datafixer; +import org.jspecify.annotations.NonNull; +import org.jspecify.annotations.Nullable; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.utils.StringUtils; +import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; +import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; +import top.offsetmonkey538.offsetutils538.api.config.Config; +import top.offsetmonkey538.offsetutils538.api.config.Datafixer; import java.io.IOException; import java.net.URI; @@ -18,7 +18,7 @@ import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public class ModConfig implements Config { @@ -147,7 +147,7 @@ public void trigger(final boolean updateSucceeded, final Map pla } @Override - public @NotNull Datafixer[] getDatafixers() { + public @NonNull Datafixer[] getDatafixers() { return new Datafixer[]{ (original, jankson) -> { // 0 -> 1 @@ -217,10 +217,10 @@ public void trigger(final boolean updateSucceeded, final Map pla }; } - private static void datafixField(final @NotNull JsonObject originalObject, final @NotNull String originalKey, final @NotNull String newKey) { + private static void datafixField(final @NonNull JsonObject originalObject, final @NonNull String originalKey, final @NonNull String newKey) { datafixField(originalObject, originalKey, originalObject, newKey); } - private static void datafixField(final @NotNull JsonObject originalObject, final @NotNull String originalKey, final @NotNull JsonObject newObject, final @NotNull String newKey) { + private static void datafixField(final @NonNull JsonObject originalObject, final @NonNull String originalKey, final @NonNull JsonObject newObject, final @NonNull String newKey) { final JsonElement originalValue = originalObject.get(originalKey); if (originalValue == null) { LOGGER.warn("JSON of current config doesn't contain value with key '%s', new value with key '%s' will be reset to default!", originalKey, newKey); @@ -232,7 +232,7 @@ private static void datafixField(final @NotNull JsonObject originalObject, final } @Nullable - private static T datafixGetAndRemove(final @NotNull Marshaller marsh, final @NotNull Class type, final @NotNull JsonObject object, final @NotNull String key) { + private static T datafixGetAndRemove(final @NonNull Marshaller marsh, final @NonNull Class type, final @NonNull JsonObject object, final @NonNull String key) { final JsonElement jsonValue = object.get(key); if (jsonValue == null) { LOGGER.warn("JSON of current config doesn't contain value with key '%s'!", key); @@ -242,7 +242,7 @@ private static T datafixGetAndRemove(final @NotNull Marshaller marsh, final return marsh.marshall(type, jsonValue); } - private static JsonObject datafix3to4UpdateMessage(final @NotNull JsonObject originalJson, final @NotNull Marshaller marsh) { + private static JsonObject datafix3to4UpdateMessage(final @NonNull JsonObject originalJson, final @NonNull Marshaller marsh) { final String updateMessage = datafixGetAndRemove(marsh, String.class, originalJson, "updateMessage"); if (updateMessage == null) { originalJson.put("updateMessage", JsonNull.INSTANCE); @@ -268,33 +268,35 @@ public int getConfigVersion() { } @Override - public @NotNull Path getConfigDirPath() { - return PlatformUtil.getConfigDir(); + public @NonNull Path getConfigDirPath() { + return LoaderUtil.getConfigDir(); } @Override - public @NotNull String getId() { - return MOD_ID + "config/main"; + public @NonNull String getId() { + return MOD_ID + "config/main"; // TODO: this looks wrong } @Override public void beforeLoadStart() { - if (Files.exists(PlatformUtil.getConfigDir().resolve(MOD_ID + ".json"))) { + // TODO: replace all instances of MOD_ID here with "github-resourcepack-manager" + if (Files.exists(LoaderUtil.getConfigDir().resolve("github-resourcepack-manager.json"))) { try { - Files.createDirectories(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json").getParent()); - Files.move(PlatformUtil.getConfigDir().resolve(MOD_ID + ".json"), PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json")); + Files.createDirectories(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json").getParent()); + Files.move(LoaderUtil.getConfigDir().resolve(MOD_ID + ".json"), LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json")); } catch (IOException e) { throw new RuntimeException("Failed to move config file to new location!", e); } } - if (Files.exists(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"))) { + if (Files.exists(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"))) { try { Files.createDirectories(getFilePath().getParent()); - Files.move(PlatformUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"), getFilePath()); + Files.move(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"), getFilePath()); } catch (IOException e) { throw new RuntimeException("Failed to move config file to new location!", e); } } + } @SuppressWarnings("HttpUrlsUsage") diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/BasicWebhook.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java similarity index 90% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/BasicWebhook.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java index 224ffa2..f5f0bd3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/BasicWebhook.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook; +package top.offsetmonkey538.gitpackmanager.config.webhook; public final class BasicWebhook implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java new file mode 100644 index 0000000..75b35b3 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java @@ -0,0 +1,5 @@ +package top.offsetmonkey538.gitpackmanager.config.webhook; + +public interface DefaultWebhookBody { + String getName(); +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java similarity index 73% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java index a52ef58..1c29d69 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic; +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; public final class BasicFailMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java similarity index 76% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java index 6f29821..8962188 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/basic/BasicSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.basic; +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; public final class BasicSuccessMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java similarity index 78% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java index 11e7313..d25ad89 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed; +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; public final class EmbedFailMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java similarity index 85% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java index 3af4d13..781f4ac 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.config.webhook.discord.embed; +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; -import top.offsetmonkey538.githubresourcepackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; public final class EmbedSuccessMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/exception/GithubResourcepackManagerException.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java similarity index 89% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/exception/GithubResourcepackManagerException.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java index bf397a0..163ad24 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/exception/GithubResourcepackManagerException.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.exception; +package top.offsetmonkey538.gitpackmanager.exception; public class GithubResourcepackManagerException extends Exception { public GithubResourcepackManagerException(String message) { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/git/CommitProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java similarity index 93% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/git/CommitProperties.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java index 9d3de19..e609967 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/git/CommitProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.git; +package top.offsetmonkey538.gitpackmanager.git; import java.util.Map; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java similarity index 95% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java index 4b81956..12068ba 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java @@ -1,10 +1,10 @@ -package top.offsetmonkey538.githubresourcepackmanager.handler; +package top.offsetmonkey538.gitpackmanager.handler; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.file.PathUtils; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.io.IOException; import java.nio.file.Files; @@ -12,7 +12,7 @@ import java.util.*; import java.util.stream.Stream; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public class DataPackHandler { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java similarity index 95% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index fdac1e4..5894184 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.handler; +package top.offsetmonkey538.gitpackmanager.handler; import org.apache.commons.io.file.PathUtils; import org.eclipse.jgit.api.Git; @@ -16,15 +16,15 @@ import org.eclipse.jgit.transport.CredentialsProvider; import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.CanonicalTreeParser; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.git.CommitProperties; +import org.jspecify.annotations.Nullable; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.git.CommitProperties; import java.io.IOException; import java.util.List; import java.util.Optional; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public class GitHandler { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java index 7c4ac35..0954482 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java @@ -1,12 +1,12 @@ -package top.offsetmonkey538.githubresourcepackmanager.handler; +package top.offsetmonkey538.gitpackmanager.handler; import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.utils.MyFileUtils; -import top.offsetmonkey538.githubresourcepackmanager.utils.StringUtils; -import top.offsetmonkey538.githubresourcepackmanager.utils.ZipUtils; +import org.jspecify.annotations.Nullable; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.utils.MyFileUtils; +import top.offsetmonkey538.gitpackmanager.utils.StringUtils; +import top.offsetmonkey538.gitpackmanager.utils.ZipUtils; import java.io.File; import java.io.IOException; @@ -17,7 +17,7 @@ import java.util.Random; import java.util.stream.Stream; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public class ResourcePackHandler { private Path outputPackPath; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java similarity index 86% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java index a534078..6d51c33 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/FileHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.networking; +package top.offsetmonkey538.gitpackmanager.networking; import io.netty.channel.*; import io.netty.handler.codec.http.*; @@ -10,8 +10,8 @@ import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE; import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.resourcePackHandler; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; public final class FileHttpHandler { private FileHttpHandler() {} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java similarity index 65% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java index 517f67b..371670d 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java @@ -1,19 +1,19 @@ -package top.offsetmonkey538.githubresourcepackmanager.networking; +package top.offsetmonkey538.gitpackmanager.networking; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.meshlib.api.handler.HttpHandler; -import top.offsetmonkey538.meshlib.api.rule.HttpRule; +import org.jspecify.annotations.NonNull; +import top.offsetmonkey538.meshlib.common.api.handler.HttpHandler; +import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import static io.netty.handler.codec.http.HttpResponseStatus.*; -import static top.offsetmonkey538.meshlib.api.util.HttpResponseUtil.sendError; +import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendError; public class MainHttpHandler implements HttpHandler { @Override - public void handleRequest(@NotNull ChannelHandlerContext ctx, @NotNull FullHttpRequest request, @NotNull HttpRule rule) throws Exception { + public void handleRequest(@NonNull ChannelHandlerContext ctx, @NonNull FullHttpRequest request, @NonNull HttpRule rule) throws Exception { final HttpMethod method = request.method(); // GET request should go to fileserver diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java similarity index 80% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java index b7e4b9d..acade49 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/networking/WebhookHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java @@ -1,8 +1,8 @@ -package top.offsetmonkey538.githubresourcepackmanager.networking; +package top.offsetmonkey538.gitpackmanager.networking; import io.netty.channel.*; import io.netty.handler.codec.http.*; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; import static io.netty.handler.codec.http.HttpResponseStatus.*; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java similarity index 50% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java index 5050000..bcb0a4a 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java @@ -1,13 +1,13 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; +package top.offsetmonkey538.gitpackmanager.platform; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.NonNull; -import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformCommand { PlatformCommand INSTANCE = load(PlatformCommand.class); - int executeRequestPackCommand(final @NotNull CommandContext ctx) throws CommandSyntaxException; + int executeRequestPackCommand(final @NonNull CommandContext ctx) throws CommandSyntaxException; } diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java similarity index 67% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java index e37818a..1c493c8 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java @@ -1,10 +1,8 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; +package top.offsetmonkey538.gitpackmanager.platform; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; -import java.util.List; - -import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformMain { PlatformMain INSTANCE = load(PlatformMain.class); diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java similarity index 81% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java index 5685317..63c1914 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java @@ -1,15 +1,15 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; +package top.offsetmonkey538.gitpackmanager.platform; import com.google.common.hash.Hashing; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.handler.ResourcePackHandler; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; import java.io.IOException; import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.*; -import static top.offsetmonkey538.githubresourcepackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformServerProperties { PlatformServerProperties INSTANCE = load(PlatformServerProperties.class); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java new file mode 100644 index 0000000..16a1634 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java @@ -0,0 +1,11 @@ +package top.offsetmonkey538.gitpackmanager.platform; + +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; + +import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; + +public interface PlatformText { + PlatformText INSTANCE = load(PlatformText.class); + + void sendUpdateMessage(final MonkeyLibText updateMessage, boolean adminsOnly); +} diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/ServiceLoader.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java similarity index 84% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/ServiceLoader.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java index 47c081c..f6711d2 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/ServiceLoader.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform; +package top.offsetmonkey538.gitpackmanager.platform; public final class ServiceLoader { private ServiceLoader() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/MyFileUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java similarity index 84% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/MyFileUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java index 73fcaca..63ecc07 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/MyFileUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.utils; +package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java similarity index 87% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java index 7468c7b..46eba2f 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java @@ -1,13 +1,13 @@ -package top.offsetmonkey538.githubresourcepackmanager.utils; +package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import java.io.File; import java.util.Map; import java.util.regex.Matcher; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; -import static top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; public final class StringUtils { private StringUtils() { diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java similarity index 89% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java index 217655a..61ad2e3 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java @@ -1,7 +1,7 @@ -package top.offsetmonkey538.githubresourcepackmanager.utils; +package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import java.io.IOException; import java.net.URI; diff --git a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java similarity index 97% rename from common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/ZipUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index 81eaba3..a0c1f43 100644 --- a/common/src/main/java/top/offsetmonkey538/githubresourcepackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.githubresourcepackmanager.utils; +package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import java.io.*; import java.util.zip.ZipEntry; diff --git a/loader/fabric/src/main/resources/assets/github-resourcepack-manager/icon.png b/common/src/main/resources/assets/github-resourcepack-manager/icon.png similarity index 100% rename from loader/fabric/src/main/resources/assets/github-resourcepack-manager/icon.png rename to common/src/main/resources/assets/github-resourcepack-manager/icon.png diff --git a/loader/fabric/build.gradle b/loader/fabric/build.gradle index baf9995..48c1a77 100644 --- a/loader/fabric/build.gradle +++ b/loader/fabric/build.gradle @@ -13,7 +13,7 @@ allprojects { extra = ["discord": "https://discord.offsetmonkey538.top"] } environment = Environment.SERVER - serverEntrypoint("top.offsetmonkey538.gitpackmanager.fabric.platform.PlatformUtilImpl\$GitPackManagerInitializer") + serverEntrypoint("top.offsetmonkey538.gitpackmanager.fabric.GitPackManagerInitializer") mixin("git-pack-manager.modded.mixins.json") depends("fabric-api", "*") diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java deleted file mode 100644 index 95da1e6..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/AbstractPropertiesHandlerAccessor.java +++ /dev/null @@ -1,14 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; - -import net.minecraft.server.dedicated.AbstractPropertiesHandler; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -import java.util.Properties; - -@Mixin(AbstractPropertiesHandler.class) -public interface AbstractPropertiesHandlerAccessor { - - @Accessor - Properties getProperties(); -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java deleted file mode 100644 index abfa7de..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/MinecraftDedicatedServerAccessor.java +++ /dev/null @@ -1,13 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; - -import net.minecraft.server.dedicated.MinecraftDedicatedServer; -import net.minecraft.server.dedicated.ServerPropertiesLoader; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - -@Mixin(MinecraftDedicatedServer.class) -public interface MinecraftDedicatedServerAccessor { - - @Accessor - ServerPropertiesLoader getPropertiesLoader(); -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java deleted file mode 100644 index d4db21c..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/ServerPropertiesLoaderAccessor.java +++ /dev/null @@ -1,20 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; - -import net.minecraft.server.dedicated.ServerPropertiesHandler; -import net.minecraft.server.dedicated.ServerPropertiesLoader; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.gen.Accessor; - -import java.nio.file.Path; - -@Mixin(ServerPropertiesLoader.class) -public interface ServerPropertiesLoaderAccessor { - - @Accessor - Path getPath(); - - @Mutable - @Accessor - void setPropertiesHandler(ServerPropertiesHandler handler); -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java deleted file mode 100644 index b309e01..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformCommand.java +++ /dev/null @@ -1,41 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; - -import com.mojang.brigadier.context.CommandContext; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import net.minecraft.command.ControlFlowAware; -import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.text.Text; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.fabric.api.command.FabricCommandAbstractionApi; - -import java.util.Optional; - -public class FabricPlatformCommand implements PlatformCommand { - @Override - public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { - final ServerCommandSource source = FabricCommandAbstractionApi.get(ctx); - final ServerPlayerEntity player = source.getPlayerOrThrow(); - final MinecraftServer.ServerResourcePackProperties resourcePackProperties = source.getServer().getResourcePackProperties().orElse(null); - if (resourcePackProperties == null) { - source.sendFeedback(() -> Text.literal("Failed to send pack update packet to client!"), true); - return 0; - } - - player.networkHandler.send( - new ResourcePackSendS2CPacket( - resourcePackProperties.id(), - resourcePackProperties.url(), - resourcePackProperties.hash(), - resourcePackProperties.isRequired(), - Optional.ofNullable(resourcePackProperties.prompt()) - ), - null - ); - - return ControlFlowAware.Command.SINGLE_SUCCESS; - } -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java deleted file mode 100644 index 4509c87..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformMain.java +++ /dev/null @@ -1,45 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; - -import net.fabricmc.api.DedicatedServerModInitializer; -import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.server.MinecraftServer; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.fabric.api.player.FabricPlayerApi; -import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; - -import java.util.List; - -public class FabricPlatformMain implements PlatformMain, DedicatedServerModInitializer { - private static @Nullable MinecraftServer minecraftServer = null; - - @Override - public void onInitializeServer() { - GithubResourcepackManager.initialize(); - - ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer1 -> minecraftServer = minecraftServer1); - } - - public static @Nullable MinecraftServer getServer() { - return minecraftServer; - } - - - @Override - public void sendMessageToAdmins(MonkeyLibText message) { - if (getServer() == null) return; - for (final PlayerEntity player : getServer().getPlayerManager().getPlayerList()) { - if (!FabricPlayerApi.isPlayerOp(getServer().getPlayerManager(), player)) continue; - player.sendMessage(FabricMonkeyLibText.of(message).getText(), false); - } - } - - @Override - public void refreshDatapacks() { - getServer().getDataPackManager().scanPacks(); - } -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java deleted file mode 100644 index f4b816f..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformServerProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.dedicated.ServerPropertiesHandler; -import net.minecraft.server.dedicated.ServerPropertiesLoader; -import net.minecraft.util.WorldSavePath; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.mixin.AbstractPropertiesHandlerAccessor; -import top.offsetmonkey538.githubresourcepackmanager.mixin.MinecraftDedicatedServerAccessor; -import top.offsetmonkey538.githubresourcepackmanager.mixin.ServerPropertiesLoaderAccessor; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; - -import java.nio.file.Path; -import java.util.Map; -import java.util.Optional; -import java.util.Properties; - -public class FabricPlatformServerProperties implements PlatformServerProperties { - - @Override - public String getResourcePackUrl() { - final Optional resourcePackProperties = FabricPlatformMain.getServer().getResourcePackProperties(); - - return resourcePackProperties.map(MinecraftServer.ServerResourcePackProperties::url).orElse(null); - } - - @Override - public String getServerPort() { - return String.valueOf(FabricPlatformMain.getServer().getServerPort()); - } - - @Override - public Path getDatapacksDir() { - return FabricPlatformMain.getServer().getSavePath(WorldSavePath.DATAPACKS); - } - - @Override - public void setProperties(Map properties) { - final ServerPropertiesLoader propertiesLoader = ((MinecraftDedicatedServerAccessor) FabricPlatformMain.getServer()).getPropertiesLoader(); - - propertiesLoader.apply(propertiesHandler -> { - final Properties serverProperties = ((AbstractPropertiesHandlerAccessor) propertiesHandler).getProperties(); - - properties.forEach(serverProperties::setProperty); - - return propertiesHandler; - }); - } - - @Override - public void reload() throws GithubResourcepackManagerException { - final ServerPropertiesLoader propertiesLoader = ((MinecraftDedicatedServerAccessor) FabricPlatformMain.getServer()).getPropertiesLoader(); - final ServerPropertiesLoaderAccessor propertiesLoaderAccess = (ServerPropertiesLoaderAccessor) propertiesLoader; - - propertiesLoaderAccess.setPropertiesHandler(ServerPropertiesHandler.load(propertiesLoaderAccess.getPath())); - } -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java b/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java deleted file mode 100644 index 9fabeaa..0000000 --- a/loader/fabric/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/fabric/FabricPlatformText.java +++ /dev/null @@ -1,27 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.fabric; - -import net.minecraft.server.PlayerManager; -import net.minecraft.server.network.ServerPlayerEntity; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.fabric.api.player.FabricPlayerApi; -import top.offsetmonkey538.monkeylib538.fabric.api.text.FabricMonkeyLibText; - -public class FabricPlatformText implements PlatformText { - @Override - public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { - assert FabricPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; - final PlayerManager playerManager = FabricPlatformMain.getServer().getPlayerManager(); - if (playerManager == null) return; - - if (!adminsOnly) { - playerManager.broadcast(FabricMonkeyLibText.of(updateMessage).getText(), false); - return; - } - - for (final ServerPlayerEntity player : playerManager.getPlayerList()) { - if (!FabricPlayerApi.isPlayerOp(playerManager, player)) continue; - player.sendMessageToClient(FabricMonkeyLibText.of(updateMessage).getText(), false); - } - } -} diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java new file mode 100644 index 0000000..27a507f --- /dev/null +++ b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java @@ -0,0 +1,15 @@ +package top.offsetmonkey538.gitpackmanager.fabric; + +import net.fabricmc.api.DedicatedServerModInitializer; +import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; + +public class GitPackManagerInitializer implements DedicatedServerModInitializer { + @Override + public void onInitializeServer() { + GithubResourcepackManager.initialize(); + + ServerLifecycleEvents.SERVER_STARTING.register(ModdedPlatformMain::setServer); + } +} diff --git a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand deleted file mode 100644 index 8bb05be..0000000 --- a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformCommand \ No newline at end of file diff --git a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain deleted file mode 100644 index 9dced14..0000000 --- a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformMain \ No newline at end of file diff --git a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties deleted file mode 100644 index 5fc63aa..0000000 --- a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformServerProperties \ No newline at end of file diff --git a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText deleted file mode 100644 index 2614502..0000000 --- a/loader/fabric/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.fabric.FabricPlatformText \ No newline at end of file diff --git a/loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json b/loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json deleted file mode 100644 index d6a8c7a..0000000 --- a/loader/fabric/src/main/resources/github-resourcepack-manager.mixins.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "required": true, - "package": "top.offsetmonkey538.githubresourcepackmanager.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [ - "AbstractPropertiesHandlerAccessor", - "MinecraftDedicatedServerAccessor", - "ServerPropertiesLoaderAccessor" - ], - "injectors": { - "defaultRequire": 1 - } -} diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java deleted file mode 100644 index 758f969..0000000 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformMain.java +++ /dev/null @@ -1,39 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; - -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.entity.player.Player; -import net.neoforged.neoforge.common.NeoForge; -import net.neoforged.neoforge.event.entity.player.PlayerEvent; -import org.jetbrains.annotations.Nullable; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.neoforge.api.text.NeoforgeMonkeyLibText; - -import java.util.List; - -public class NeoforgePlatformMain implements PlatformMain { - private static @Nullable MinecraftServer minecraftServer = null; - - public static @Nullable MinecraftServer getServer() { - return minecraftServer; - } - - public static void setServer(MinecraftServer server) { - minecraftServer = server; - } - - - @Override - public void sendMessageToAdmins(MonkeyLibText message) { - if (getServer() == null) return; - for (final Player player : getServer().getPlayerList().getPlayers()) { - if (!getServer().getPlayerList().isOp(player.getGameProfile())) continue; - player.displayClientMessage(NeoforgeMonkeyLibText.of(message).getText(), false); - } - } - - @Override - public void refreshDatapacks() { - getServer().getPackRepository().reload(); - } -} diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java b/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java deleted file mode 100644 index a564e4f..0000000 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformText.java +++ /dev/null @@ -1,25 +0,0 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; - -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.server.players.PlayerList; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.neoforge.api.text.NeoforgeMonkeyLibText; - -public class NeoforgePlatformText implements PlatformText { - @Override - public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { - assert NeoforgePlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; - final PlayerList playerManager = NeoforgePlatformMain.getServer().getPlayerList(); - - if (!adminsOnly) { - playerManager.broadcastSystemMessage(NeoforgeMonkeyLibText.of(updateMessage).getText(), false); - return; - } - - for (final ServerPlayer player : playerManager.getPlayers()) { - if (!playerManager.isOp(player.getGameProfile())) continue; - player.sendSystemMessage(NeoforgeMonkeyLibText.of(updateMessage).getText(), false); - } - } -} diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java similarity index 53% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java rename to loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java index 0d9fd2a..dcbe320 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformInitializer.java +++ b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; +package top.offsetmonkey538.gitpackmanager.neoforge; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; @@ -6,17 +6,17 @@ import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.server.ServerStartingEvent; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; @Mod( value = "git_pack_manager", dist = Dist.DEDICATED_SERVER ) -public class NeoforgePlatformInitializer { - - public NeoforgePlatformInitializer(IEventBus modEventBus, ModContainer modContainer) { +public class GitPackManagerInitializer { + public GitPackManagerInitializer(IEventBus modEventBus, ModContainer modContainer) { GithubResourcepackManager.initialize(); - NeoForge.EVENT_BUS.addListener(ServerStartingEvent.class, serverStartingEvent -> NeoforgePlatformMain.setServer(serverStartingEvent.getServer())); + NeoForge.EVENT_BUS.addListener(ServerStartingEvent.class, serverStartingEvent -> ModdedPlatformMain.setServer(serverStartingEvent.getServer())); } } diff --git a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand deleted file mode 100644 index e14ad3a..0000000 --- a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformCommand \ No newline at end of file diff --git a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain deleted file mode 100644 index 9d0e114..0000000 --- a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformMain \ No newline at end of file diff --git a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties deleted file mode 100644 index 425ca86..0000000 --- a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformServerProperties \ No newline at end of file diff --git a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText deleted file mode 100644 index 712b8d3..0000000 --- a/loader/neoforge/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.neoforge.NeoforgePlatformText \ No newline at end of file diff --git a/loader/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png b/loader/neoforge/src/main/resources/assets/github-resourcepack-manager/icon.png deleted file mode 100644 index a6544fae6f35cbb6b9f002277050d34f8bfaeba3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1761 zcmV<71|Io|P)Px*n@L1LRCt{2oxhG8MG(g8EGK}Il`b<#PLOeg99Rfm#4kZ+C&%K*USERaL*fY> zAd&F~NQi*&fDq%9y})t;(h(f9o|)^JuI{ets_L$vbkgnK%xvF$UsqTEnck!CzW?zO zoNl=xT>wWGH$dmy1oV<9-T?}V|BaR#ZBRU2*20tVQz}E8NxItK~QQQc8 zWEp^4xTWj65$GW`0JT7F1b$EkkQO5J`ECLlOmqWJUOc@fI8~zAJJAR*ztPe)&!Yh? zs|L^}{us?=vjn;c&~}4EO@cQI=`0#xd^0iPO9&7umzy9B@+45g1Rf3Y3FZK)wSRuj zn3_!oRf4$LZ6~ky+g)~Qx- z2u(PhK6(=Uoc(q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loader/neoforge/src/main/resources/github-resourcepack-manager.mixins.json deleted file mode 100644 index 2262de0..0000000 --- a/loader/neoforge/src/main/resources/github-resourcepack-manager.mixins.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "required": true, - "package": "top.offsetmonkey538.githubresourcepackmanager.mixin", - "compatibilityLevel": "JAVA_17", - "mixins": [ - "SettingsAccessor", - "DedicatedServerAccessor", - "DedicatedServerSettingsAccessor" - ], - "injectors": { - "defaultRequire": 1 - } -} diff --git a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java similarity index 88% rename from loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java rename to loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java index 5e64904..680739b 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformCommand.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +package top.offsetmonkey538.gitpackmanager.paper.platform; import com.mojang.brigadier.Command; import com.mojang.brigadier.context.CommandContext; @@ -8,15 +8,15 @@ import net.kyori.adventure.resource.ResourcePackRequest; import net.minecraft.server.MinecraftServer; import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; +import org.jspecify.annotations.NonNull; +import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import java.net.URI; public class PaperPlatformCommand implements PlatformCommand { @SuppressWarnings("UnstableApiUsage") @Override - public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { + public int executeRequestPackCommand(@NonNull CommandContext ctx) throws CommandSyntaxException { // TODO: once monke has papier: final CommandSourceStack source = PaperCommandAbstractionApi.get(ctx); final CommandSourceStack source = null; if (source == null) return 0; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java similarity index 79% rename from loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java rename to loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index 20ec27f..8175710 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -1,11 +1,11 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +package top.offsetmonkey538.gitpackmanager.paper.platform; import net.minecraft.server.MinecraftServer; import org.bukkit.OfflinePlayer; import org.bukkit.plugin.java.JavaPlugin; -import top.offsetmonkey538.githubresourcepackmanager.GithubResourcepackManager; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; public class PaperPlatformMain implements PlatformMain { private static GitPackManagerInitializer plugin; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java similarity index 78% rename from loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java rename to loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java index 8a56c04..e2ee7a1 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformServerProperties.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java @@ -1,13 +1,12 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +package top.offsetmonkey538.gitpackmanager.paper.platform; import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; -import xyz.jpenilla.reflectionremapper.ReflectionRemapper; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.lang.reflect.Field; import java.nio.file.Path; @@ -47,12 +46,9 @@ public void setProperties(Map properties) { public void reload() throws GithubResourcepackManagerException { final DedicatedServerSettings settings = ((DedicatedServer) MinecraftServer.getServer()).settings; - final ReflectionRemapper reflectionRemapper = ReflectionRemapper.forReobfMappingsInPaperJar(); - - try { - final Field sourceField = DedicatedServerSettings.class.getDeclaredField(reflectionRemapper.remapFieldName(DedicatedServerSettings.class, "source")); - final Field propertiesField = DedicatedServerSettings.class.getDeclaredField(reflectionRemapper.remapFieldName(DedicatedServerSettings.class, "properties")); + final Field sourceField = DedicatedServerSettings.class.getDeclaredField("source"); + final Field propertiesField = DedicatedServerSettings.class.getDeclaredField("properties"); sourceField.setAccessible(true); propertiesField.setAccessible(true); diff --git a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java similarity index 76% rename from loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java rename to loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java index 50e3ab6..ee490b0 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/paper/PaperPlatformText.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java @@ -1,11 +1,11 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.paper; +package top.offsetmonkey538.gitpackmanager.paper.platform; import net.minecraft.network.chat.*; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText; -import top.offsetmonkey538.monkeylib538.api.text.MonkeyLibText; +import top.offsetmonkey538.gitpackmanager.platform.PlatformText; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; public class PaperPlatformText implements PlatformText { @Override @@ -18,7 +18,7 @@ public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { } for (final ServerPlayer player : players.players) { - if (!players.isOp(player.getGameProfile())) continue; + // TODO: GAME PROFILE ISNT CORRETCT: if (!players.isOp(player.getGameProfile())) continue; player.sendSystemMessage(Component.empty()); // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(updateMessage).getText()); } diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand deleted file mode 100644 index d8331b3..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlatformCommand \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging deleted file mode 100644 index f3f2b72..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformLogging +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlatformLogging \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain deleted file mode 100644 index 4f830cb..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformMain +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlatformMain \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties deleted file mode 100644 index 744beda..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlatformServerProperties \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText deleted file mode 100644 index f27ec27..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.githubresourcepackmanager.platform.PlatformText +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.githubresourcepackmanager.platform.paper.PaperPlatformText \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand new file mode 100644 index 0000000..32adb30 --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.paper.platform.PaperPlatformCommand \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging new file mode 100644 index 0000000..b465428 --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.platform.paper.PaperPlatformLogging \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain new file mode 100644 index 0000000..0f34156 --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.paper.platform.PaperPlatformMain \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties new file mode 100644 index 0000000..3e6d56f --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.paper.platform.PaperPlatformServerProperties \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText new file mode 100644 index 0000000..c80f956 --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.paper.platform.PaperPlatformText \ No newline at end of file diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerAccessor.java similarity index 84% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java rename to modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerAccessor.java index 41d4c9a..e9ed807 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerAccessor.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerAccessor.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; +package top.offsetmonkey538.gitpackmanager.modded.mixin; import net.minecraft.server.dedicated.DedicatedServer; import net.minecraft.server.dedicated.DedicatedServerSettings; diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerSettingsAccessor.java similarity index 89% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java rename to modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerSettingsAccessor.java index 66638ba..1484e9b 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/DedicatedServerSettingsAccessor.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/DedicatedServerSettingsAccessor.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; +package top.offsetmonkey538.gitpackmanager.modded.mixin; import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/SettingsAccessor.java similarity index 82% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java rename to modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/SettingsAccessor.java index 565a199..1072918 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/mixin/SettingsAccessor.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/SettingsAccessor.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.mixin; +package top.offsetmonkey538.gitpackmanager.modded.mixin; import net.minecraft.server.dedicated.Settings; import org.spongepowered.asm.mixin.Mixin; diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java similarity index 73% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java rename to modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java index a41ec2a..36720db 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformCommand.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; +package top.offsetmonkey538.gitpackmanager.modded.platform; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; @@ -7,18 +7,18 @@ import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import org.jetbrains.annotations.NotNull; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformCommand; -import top.offsetmonkey538.monkeylib538.neoforge.api.command.NeoforgeCommandAbstractionApi; +import org.jspecify.annotations.NonNull; +import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.monkeylib538.modded.api.command.ModdedCommandAbstractionApi; import java.util.Optional; import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -public class NeoforgePlatformCommand implements PlatformCommand { +public class ModdedPlatformCommand implements PlatformCommand { @Override - public int executeRequestPackCommand(@NotNull CommandContext ctx) throws CommandSyntaxException { - final CommandSourceStack source = NeoforgeCommandAbstractionApi.get(ctx); + public int executeRequestPackCommand(@NonNull CommandContext ctx) throws CommandSyntaxException { + final CommandSourceStack source = ModdedCommandAbstractionApi.get(ctx); final ServerPlayer player = source.getPlayerOrException(); final MinecraftServer.ServerResourcePackInfo resourcePackProperties = source.getServer().getServerResourcePack().orElse(null); if (resourcePackProperties == null) { diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java new file mode 100644 index 0000000..d956a4a --- /dev/null +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java @@ -0,0 +1,34 @@ +package top.offsetmonkey538.gitpackmanager.modded.platform; + +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.entity.player.Player; +import org.jspecify.annotations.Nullable; +import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; + +public class ModdedPlatformMain implements PlatformMain { + private static @Nullable MinecraftServer minecraftServer = null; + + public static @Nullable MinecraftServer getServer() { + return minecraftServer; + } + + public static void setServer(MinecraftServer server) { + minecraftServer = server; + } + + @Override + public void sendMessageToAdmins(MonkeyLibText message) { + if (getServer() == null) return; + for (final Player player : getServer().getPlayerList().getPlayers()) { + // TODO: GAME PROFILE ISNT CORRETCT: if (!getServer().getPlayerList().isOp(player.getGameProfile())) continue; + player.displayClientMessage(ModdedMonkeyLibText.of(message).getText(), false); + } + } + + @Override + public void refreshDatapacks() { + getServer().getPackRepository().reload(); + } +} diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java similarity index 60% rename from loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java rename to modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 73d86a6..688f5f3 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/githubresourcepackmanager/platform/neoforge/NeoforgePlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -1,42 +1,42 @@ -package top.offsetmonkey538.githubresourcepackmanager.platform.neoforge; +package top.offsetmonkey538.gitpackmanager.modded.platform; import net.minecraft.server.MinecraftServer; import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; -import top.offsetmonkey538.githubresourcepackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.githubresourcepackmanager.mixin.SettingsAccessor; -import top.offsetmonkey538.githubresourcepackmanager.mixin.DedicatedServerAccessor; -import top.offsetmonkey538.githubresourcepackmanager.mixin.DedicatedServerSettingsAccessor; -import top.offsetmonkey538.githubresourcepackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; +import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; +import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; +import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.nio.file.Path; import java.util.Map; import java.util.Optional; import java.util.Properties; -public class NeoforgePlatformServerProperties implements PlatformServerProperties { +public class ModdedPlatformServerProperties implements PlatformServerProperties { @Override public String getResourcePackUrl() { - final Optional resourcePackProperties = NeoforgePlatformMain.getServer().getServerResourcePack(); + final Optional resourcePackProperties = ModdedPlatformMain.getServer().getServerResourcePack(); return resourcePackProperties.map(MinecraftServer.ServerResourcePackInfo::url).orElse(null); } @Override public String getServerPort() { - return String.valueOf(NeoforgePlatformMain.getServer().getPort()); + return String.valueOf(ModdedPlatformMain.getServer().getPort()); } @Override public Path getDatapacksDir() { - return NeoforgePlatformMain.getServer().getWorldPath(LevelResource.DATAPACK_DIR); + return ModdedPlatformMain.getServer().getWorldPath(LevelResource.DATAPACK_DIR); } @Override public void setProperties(Map properties) { - final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) NeoforgePlatformMain.getServer()).getSettings(); + final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) ModdedPlatformMain.getServer()).getSettings(); propertiesLoader.update(propertiesHandler -> { final Properties serverProperties = ((SettingsAccessor) propertiesHandler).getProperties(); @@ -49,7 +49,7 @@ public void setProperties(Map properties) { @Override public void reload() throws GithubResourcepackManagerException { - final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) NeoforgePlatformMain.getServer()).getSettings(); + final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) ModdedPlatformMain.getServer()).getSettings(); final DedicatedServerSettingsAccessor propertiesLoaderAccess = (DedicatedServerSettingsAccessor) propertiesLoader; propertiesLoaderAccess.setProperties(DedicatedServerProperties.fromFile(propertiesLoaderAccess.getSource())); diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java new file mode 100644 index 0000000..14a9e2a --- /dev/null +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java @@ -0,0 +1,25 @@ +package top.offsetmonkey538.gitpackmanager.modded.platform; + +import net.minecraft.server.level.ServerPlayer; +import net.minecraft.server.players.PlayerList; +import top.offsetmonkey538.gitpackmanager.platform.PlatformText; +import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; + +public class ModdedPlatformText implements PlatformText { + @Override + public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { + assert ModdedPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; + final PlayerList playerManager = ModdedPlatformMain.getServer().getPlayerList(); + + if (!adminsOnly) { + playerManager.broadcastSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); + return; + } + + for (final ServerPlayer player : playerManager.getPlayers()) { + // TODO: GAME PROFILE ISNT CORRETCT: if (!playerManager.isOp(player.getGameProfile())) continue; + player.sendSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); + } + } +} diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand new file mode 100644 index 0000000..5c1ea6d --- /dev/null +++ b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformCommand \ No newline at end of file diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain new file mode 100644 index 0000000..5572c8e --- /dev/null +++ b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain \ No newline at end of file diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties new file mode 100644 index 0000000..a9a3020 --- /dev/null +++ b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformServerProperties \ No newline at end of file diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText new file mode 100644 index 0000000..a32fccb --- /dev/null +++ b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformText \ No newline at end of file diff --git a/modded/src/main/resources/git-pack-manager.modded.mixins.json b/modded/src/main/resources/git-pack-manager.modded.mixins.json new file mode 100644 index 0000000..1bf50ba --- /dev/null +++ b/modded/src/main/resources/git-pack-manager.modded.mixins.json @@ -0,0 +1,13 @@ +{ + "required": true, + "package": "top.offsetmonkey538.gitpackmanager.modded.mixin", + "compatibilityLevel": "JAVA_17", + "mixins": [ + "SettingsAccessor", + "DedicatedServerAccessor", + "DedicatedServerSettingsAccessor" + ], + "injectors": { + "defaultRequire": 1 + } +} From 5c880ab9c88a346c1c9a81c1892fd0cb07e3b98e Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 21:01:45 +0200 Subject: [PATCH 57/89] fix config location --- .../gitpackmanager/config/ModConfig.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index a7a74a0..34a34b8 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -274,29 +274,34 @@ public int getConfigVersion() { @Override public @NonNull String getId() { - return MOD_ID + "config/main"; // TODO: this looks wrong + return MOD_ID + "/main"; } @Override public void beforeLoadStart() { - // TODO: replace all instances of MOD_ID here with "github-resourcepack-manager" - if (Files.exists(LoaderUtil.getConfigDir().resolve("github-resourcepack-manager.json"))) { - try { - Files.createDirectories(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json").getParent()); - Files.move(LoaderUtil.getConfigDir().resolve(MOD_ID + ".json"), LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json")); - } catch (IOException e) { - throw new RuntimeException("Failed to move config file to new location!", e); - } - } - if (Files.exists(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"))) { + tryMoveConfig( + LoaderUtil.getConfigDir().resolve("github-resourcepack-manager.json"), + LoaderUtil.getConfigDir().resolve("github-resourcepack-manager").resolve("github-resourcepack-manager.json") + ); + tryMoveConfig( + LoaderUtil.getConfigDir().resolve("github-resourcepack-manager").resolve("github-resourcepack-manager.json"), + LoaderUtil.getConfigDir().resolve("github-resourcepack-manager/main.json") + ); + tryMoveConfig( + LoaderUtil.getConfigDir().resolve("github-resourcepack-manager/main.json"), + getFilePath() + ); + } + + private static void tryMoveConfig(final Path oldPath, final Path newPath) { + if (Files.exists(oldPath)) { try { - Files.createDirectories(getFilePath().getParent()); - Files.move(LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(MOD_ID + ".json"), getFilePath()); + Files.createDirectories(newPath.getParent()); + Files.move(oldPath, newPath); } catch (IOException e) { throw new RuntimeException("Failed to move config file to new location!", e); } } - } @SuppressWarnings("HttpUrlsUsage") From 11567d731a63a1724a544715306a7f5959d78c99 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 21:02:00 +0200 Subject: [PATCH 58/89] Fix todos --- .../paper/platform/PaperPlatformCommand.java | 5 ++-- .../paper/platform/PaperPlatformMain.java | 3 ++- .../paper/platform/PaperPlatformText.java | 26 +++++++++++-------- .../modded/platform/ModdedPlatformMain.java | 3 ++- .../modded/platform/ModdedPlatformText.java | 9 ++++--- 5 files changed, 26 insertions(+), 20 deletions(-) diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java index 680739b..ef43cc1 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java @@ -10,6 +10,7 @@ import org.bukkit.entity.Player; import org.jspecify.annotations.NonNull; import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.monkeylib538.paper.api.command.PaperCommandAbstractionApi; import java.net.URI; @@ -17,9 +18,7 @@ public class PaperPlatformCommand implements PlatformCommand { @SuppressWarnings("UnstableApiUsage") @Override public int executeRequestPackCommand(@NonNull CommandContext ctx) throws CommandSyntaxException { - // TODO: once monke has papier: final CommandSourceStack source = PaperCommandAbstractionApi.get(ctx); - final CommandSourceStack source = null; - if (source == null) return 0; + final CommandSourceStack source = PaperCommandAbstractionApi.get(ctx); final Player player = (Player) source.getExecutor(); if (player == null) return 0; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index 8175710..d6ced6e 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -6,6 +6,7 @@ import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; public class PaperPlatformMain implements PlatformMain { private static GitPackManagerInitializer plugin; @@ -19,7 +20,7 @@ public void refreshDatapacks() { public void sendMessageToAdmins(MonkeyLibText message) { for (final OfflinePlayer operator : getPlugin().getServer().getOperators()) { if (operator.getPlayer() == null) continue; - // todo: once monkeylib has da paper: operator.getPlayer().sendMessage(PaperMonkeyLibText.of(text)); + operator.getPlayer().sendMessage(PaperMonkeyLibText.of(message).getText()); } } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java index ee490b0..3112465 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java @@ -1,26 +1,30 @@ package top.offsetmonkey538.gitpackmanager.paper.platform; -import net.minecraft.network.chat.*; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.server.players.PlayerList; +import net.kyori.adventure.text.Component; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; import top.offsetmonkey538.gitpackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; + +import java.util.Collection; public class PaperPlatformText implements PlatformText { @Override public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { - final PlayerList players = MinecraftServer.getServer().getPlayerList(); + final Collection players = Bukkit.getOnlinePlayers(); if (!adminsOnly) { - players.broadcastSystemMessage(Component.empty(), false); - // TODO: once I implement paper version of monke: players.broadcastSystemMessage(PaperMonkeyLibText.of(updateMessage).getText(), false); + sendToAll(players, PaperMonkeyLibText.of(updateMessage).getText()); return; } - for (final ServerPlayer player : players.players) { - // TODO: GAME PROFILE ISNT CORRETCT: if (!players.isOp(player.getGameProfile())) continue; - player.sendSystemMessage(Component.empty()); - // TODO: once I implement paper version of monke: player.sendSystemMessage(PaperMonkeyLibText.of(updateMessage).getText()); + for (final Player player : players) { + if (!player.isOp()) continue; + player.sendMessage(PaperMonkeyLibText.of(updateMessage).getText()); } } + + private static void sendToAll(Collection players, Component component) { + for (Player player : players) player.sendMessage(component); + } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java index d956a4a..2badd92 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java @@ -5,6 +5,7 @@ import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; public class ModdedPlatformMain implements PlatformMain { @@ -22,7 +23,7 @@ public static void setServer(MinecraftServer server) { public void sendMessageToAdmins(MonkeyLibText message) { if (getServer() == null) return; for (final Player player : getServer().getPlayerList().getPlayers()) { - // TODO: GAME PROFILE ISNT CORRETCT: if (!getServer().getPlayerList().isOp(player.getGameProfile())) continue; + if (!ModdedPlayerApi.isPlayerOp(getServer().getPlayerList(), player)) continue; player.displayClientMessage(ModdedMonkeyLibText.of(message).getText(), false); } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java index 14a9e2a..6e5ad47 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java @@ -4,21 +4,22 @@ import net.minecraft.server.players.PlayerList; import top.offsetmonkey538.gitpackmanager.platform.PlatformText; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; public class ModdedPlatformText implements PlatformText { @Override public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { assert ModdedPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; - final PlayerList playerManager = ModdedPlatformMain.getServer().getPlayerList(); + final PlayerList playerList = ModdedPlatformMain.getServer().getPlayerList(); if (!adminsOnly) { - playerManager.broadcastSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); + playerList.broadcastSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); return; } - for (final ServerPlayer player : playerManager.getPlayers()) { - // TODO: GAME PROFILE ISNT CORRETCT: if (!playerManager.isOp(player.getGameProfile())) continue; + for (final ServerPlayer player : playerList.getPlayers()) { + if (!ModdedPlayerApi.isPlayerOp(playerList, player)) continue; player.sendSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); } } From 3ebe33c23cb8cabbba610689c95834b4cbdada5d Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 21:49:10 +0200 Subject: [PATCH 59/89] code cleanup --- .../GithubResourcepackManager.java | 9 ++-- .../gitpackmanager/command/package-info.java | 4 ++ .../gitpackmanager/config/ConfigHandler.java | 3 +- .../gitpackmanager/config/ModConfig.java | 32 ++++++------- .../gitpackmanager/config/package-info.java | 4 ++ .../webhook/discord/basic/package-info.java | 4 ++ .../webhook/discord/embed/package-info.java | 4 ++ .../config/webhook/package-info.java | 4 ++ .../exception/package-info.java | 4 ++ .../gitpackmanager/git/package-info.java | 4 ++ .../gitpackmanager/handler/GitHandler.java | 6 +-- .../handler/ResourcePackHandler.java | 19 ++++---- .../gitpackmanager/handler/package-info.java | 4 ++ .../networking/FileHttpHandler.java | 48 ------------------- .../networking/MainHttpHandler.java | 20 +++++--- .../networking/WebhookHttpHandler.java | 17 ------- .../networking/package-info.java | 4 ++ .../gitpackmanager/package-info.java | 4 ++ .../platform/PlatformCommand.java | 3 +- .../platform/PlatformServerProperties.java | 4 +- .../platform/ServiceLoader.java | 7 +-- .../gitpackmanager/platform/package-info.java | 4 ++ .../gitpackmanager/utils/MyFileUtils.java | 4 +- .../gitpackmanager/utils/StringUtils.java | 4 +- .../gitpackmanager/utils/WebhookSender.java | 21 ++------ .../gitpackmanager/utils/ZipUtils.java | 4 +- .../gitpackmanager/utils/package-info.java | 4 ++ jitpack.yml | 4 -- .../gitpackmanager/fabric/package-info.java | 4 ++ .../gitpackmanager/neoforge/package-info.java | 4 ++ .../paper/platform/PaperPlatformCommand.java | 3 +- .../paper/platform/PaperPlatformMain.java | 5 +- .../PaperPlatformServerProperties.java | 8 +--- .../paper/platform/package-info.java | 4 ++ .../modded/mixin/package-info.java | 4 ++ .../platform/ModdedPlatformCommand.java | 3 +- .../ModdedPlatformServerProperties.java | 8 +--- .../modded/platform/package-info.java | 4 ++ 38 files changed, 137 insertions(+), 163 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java delete mode 100644 jitpack.yml create mode 100644 loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/package-info.java create mode 100644 loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/package-info.java create mode 100644 loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/package-info.java create mode 100644 modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/package-info.java create mode 100644 modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/package-info.java diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index 3cd0da4..491adb5 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -3,7 +3,6 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; import top.offsetmonkey538.gitpackmanager.config.ModConfig; @@ -74,9 +73,9 @@ private GithubResourcepackManager() { } @SuppressWarnings("NotNullFieldNotInitialized") - public static @NonNull ConfigHolder config; + public static ConfigHolder config; - public static ResourcePackHandler resourcePackHandler; + public static @Nullable ResourcePackHandler resourcePackHandler = null; private static boolean disabled; @@ -352,7 +351,7 @@ public static Map generatePlaceholders(final GitHandler gitHandl final Map placeholders = new HashMap<>(); if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); - if (resourcePackHandler != null) placeholders.put("{downloadUrl}", config.get().getPackUrl(resourcePackHandler.getOutputPackName())); + if (resourcePackHandler != null) placeholders.put("{downloadUrl}", config.get().getPackUrl(Objects.requireNonNull(resourcePackHandler.getOutputPackName()))); placeholders.putAll(STATIC_PLACEHOLDERS); placeholders.put("{packType}", packType); placeholders.put("{updateType}", updateType.name()); @@ -366,7 +365,7 @@ public static void clearAdminMessageQueue() { MESSAGE_QUEUE.clear(); } - private static String getOldResourcePackName() { + private static @Nullable String getOldResourcePackName() { final String oldPackUrl = PlatformServerProperties.INSTANCE.getResourcePackUrl(); if (oldPackUrl == null) return null; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java new file mode 100644 index 0000000..b59d12c --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.command; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index ceadf6e..960ffaa 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -1,7 +1,6 @@ package top.offsetmonkey538.gitpackmanager.config; import blue.endless.jankson.*; -import org.jspecify.annotations.NonNull; import top.offsetmonkey538.gitpackmanager.config.webhook.BasicWebhook; import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicFailMessage; @@ -63,7 +62,7 @@ private static void createDefaultWebhooks() { } } - private static @NonNull List checkConfigErrors() { + private static List checkConfigErrors() { final List errors = new ArrayList<>(); if (config.get().serverInfo.publicIp == null) errors.add("Field 'serverInfo.publicIp' not set!"); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 34a34b8..47a1f5f 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -2,7 +2,6 @@ import blue.endless.jankson.*; import blue.endless.jankson.api.Marshaller; -import org.jspecify.annotations.NonNull; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; @@ -32,25 +31,26 @@ public class ModConfig implements Config { public static class ServerInfo { @SuppressWarnings("HttpUrlsUsage") @Comment("The public ip of your server, may also specify the protocol (\"123.45.67.89\" or \"http://play.coolserver.net\")") - public String publicIp = null; + public @Nullable String publicIp = null; @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. The HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") - public String proxyPort = null; + // TODO: rename to externalPort and make it required + public @Nullable String proxyPort = null; } public static class RepositoryInfo { @Comment("Should be \"[YOUR BRANCH NAME HERE]\". Common names include \"master\" and \"main\"") public String branch = "master"; @Comment("The URL of your repository. For example \"https://github.com/MyName/MyRepository\"") - public String url = null; + public @Nullable String url = null; @Comment("Whether or not the repository is private. Username and token will need to be populated when this is set to 'true'!") public boolean isPrivate = false; @Comment("The two values below only need to be set when 'isPrivate' is true!") - public String username = null; + public @Nullable String username = null; @Comment("PLEASE DO NOT SHARE THIS WITH ANYONE") - public String token = null; + public @Nullable String token = null; } public static class ResourcePackProvider { @@ -118,9 +118,9 @@ public WebhookInfo() { public boolean enabled = false; @Comment("The URL to send the webhook to. For example \"https://discord.com/api/webhooks/1234567890123456789/eW91J3JlIG5vdCBzdGVhbGluZyBhIHRva2Vu_bm9wZQ==_eWVyJyBub3Q=\" or something custom like \"https://api.example.com/NDI6IHRoZSBtZWFuaW5nIG9mIGxpZmUsIHRoZSB1bml2ZXJzZSwgYW5kIGV2ZXJ5dGhpbmc=\"") - public String url = null; + public @Nullable String url = null; @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") - public String body = null; + public @Nullable String body = null; public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GithubResourcepackManagerException { if (!enabled) return; @@ -147,7 +147,7 @@ public void trigger(final boolean updateSucceeded, final Map pla } @Override - public @NonNull Datafixer[] getDatafixers() { + public Datafixer[] getDatafixers() { return new Datafixer[]{ (original, jankson) -> { // 0 -> 1 @@ -217,10 +217,10 @@ public void trigger(final boolean updateSucceeded, final Map pla }; } - private static void datafixField(final @NonNull JsonObject originalObject, final @NonNull String originalKey, final @NonNull String newKey) { + private static void datafixField(final JsonObject originalObject, final String originalKey, final String newKey) { datafixField(originalObject, originalKey, originalObject, newKey); } - private static void datafixField(final @NonNull JsonObject originalObject, final @NonNull String originalKey, final @NonNull JsonObject newObject, final @NonNull String newKey) { + private static void datafixField(final JsonObject originalObject, final String originalKey, final JsonObject newObject, final String newKey) { final JsonElement originalValue = originalObject.get(originalKey); if (originalValue == null) { LOGGER.warn("JSON of current config doesn't contain value with key '%s', new value with key '%s' will be reset to default!", originalKey, newKey); @@ -232,7 +232,7 @@ private static void datafixField(final @NonNull JsonObject originalObject, final } @Nullable - private static T datafixGetAndRemove(final @NonNull Marshaller marsh, final @NonNull Class type, final @NonNull JsonObject object, final @NonNull String key) { + private static T datafixGetAndRemove(final Marshaller marsh, final Class type, final JsonObject object, final String key) { final JsonElement jsonValue = object.get(key); if (jsonValue == null) { LOGGER.warn("JSON of current config doesn't contain value with key '%s'!", key); @@ -242,7 +242,7 @@ private static T datafixGetAndRemove(final @NonNull Marshaller marsh, final return marsh.marshall(type, jsonValue); } - private static JsonObject datafix3to4UpdateMessage(final @NonNull JsonObject originalJson, final @NonNull Marshaller marsh) { + private static JsonObject datafix3to4UpdateMessage(final JsonObject originalJson, final Marshaller marsh) { final String updateMessage = datafixGetAndRemove(marsh, String.class, originalJson, "updateMessage"); if (updateMessage == null) { originalJson.put("updateMessage", JsonNull.INSTANCE); @@ -268,12 +268,12 @@ public int getConfigVersion() { } @Override - public @NonNull Path getConfigDirPath() { + public Path getConfigDirPath() { return LoaderUtil.getConfigDir(); } @Override - public @NonNull String getId() { + public String getId() { return MOD_ID + "/main"; } @@ -310,7 +310,7 @@ public String getPackUrl(String outputFileName) { "%s%s:%s/%s/%s", (serverInfo.publicIp.startsWith("http://") || serverInfo.publicIp.startsWith("https://") ? "" : "http://"), serverInfo.publicIp, - serverInfo.proxyPort == null ? PlatformServerProperties.INSTANCE.getServerPort() : serverInfo.proxyPort, + serverInfo.proxyPort, MOD_URI, outputFileName ); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java new file mode 100644 index 0000000..865e9b3 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.config; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java new file mode 100644 index 0000000..3d56a65 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java new file mode 100644 index 0000000..0598cf2 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java new file mode 100644 index 0000000..fdaf6b6 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.config.webhook; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java new file mode 100644 index 0000000..c22642b --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.exception; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java new file mode 100644 index 0000000..b37f066 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.git; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index 5894184..30cc227 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -28,7 +28,7 @@ public class GitHandler { - private CommitProperties commitProperties; + private @Nullable CommitProperties commitProperties = null; private @Nullable List changedFiles; public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcepackManagerException { @@ -128,7 +128,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan } } - private static void cloneRepository(CredentialsProvider credentialsProvider) throws GithubResourcepackManagerException { + private static void cloneRepository(@Nullable CredentialsProvider credentialsProvider) throws GithubResourcepackManagerException { try { Git git = Git.cloneRepository() .setURI(config.get().repositoryInfo.url) @@ -192,7 +192,7 @@ private static Repository getRepository() throws GithubResourcepackManagerExcept } } - public CommitProperties getCommitProperties() { + public @Nullable CommitProperties getCommitProperties() { return commitProperties; } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java index 0954482..e9ff3b5 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java @@ -14,15 +14,16 @@ import java.nio.file.Path; import java.util.Comparator; import java.util.List; +import java.util.Objects; import java.util.Random; import java.util.stream.Stream; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; public class ResourcePackHandler { - private Path outputPackPath; + private @Nullable Path outputPackPath = null; - public void generatePack(boolean wasUpdated, Path oldPackPath, String oldPackName) throws GithubResourcepackManagerException { + public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) throws GithubResourcepackManagerException { outputPackPath = handleOldPackAndGetOutputPackPath(wasUpdated, oldPackPath, oldPackName); // If using the old pack, don't generate a new one. @@ -67,7 +68,7 @@ private void generateNewPack() throws GithubResourcepackManagerException { // Zip the pack content and put the output file in the output directory. try { - ZipUtils.zipDirectory(tempOutputDir, outputPackPath.toFile()); + ZipUtils.zipDirectory(tempOutputDir, Objects.requireNonNull(getOutputPackFile())); } catch (GithubResourcepackManagerException e) { throw new GithubResourcepackManagerException("Failed to zip pack content!", e); } @@ -167,7 +168,7 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException } - private Path handleOldPackAndGetOutputPackPath(boolean wasUpdated, @Nullable Path oldPackPath, String oldPackName) { + private @Nullable Path handleOldPackAndGetOutputPackPath(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) { if (!wasUpdated) return oldPackPath; final String newPackName = generateRandomPackName(oldPackName); @@ -193,15 +194,15 @@ private String generateRandomPackName(@Nullable String oldPackNameString) { return newPackName + ".zip"; } - public Path getOutputPackPath() { + public @Nullable Path getOutputPackPath() { return outputPackPath; } - public File getOutputPackFile() { - return getOutputPackPath().toFile(); + public @Nullable File getOutputPackFile() { + return getOutputPackPath() == null ? null : getOutputPackPath().toFile(); } - public String getOutputPackName() { - return getOutputPackFile().getName(); + public @Nullable String getOutputPackName() { + return getOutputPackFile() == null ? null : getOutputPackFile().getName(); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java new file mode 100644 index 0000000..fbd0862 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.handler; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java deleted file mode 100644 index 6d51c33..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/FileHttpHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -package top.offsetmonkey538.gitpackmanager.networking; - -import io.netty.channel.*; -import io.netty.handler.codec.http.*; - -import java.io.File; -import java.nio.file.Files; - -import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH; -import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE; -import static io.netty.handler.codec.http.HttpResponseStatus.OK; -import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; - -public final class FileHttpHandler { - private FileHttpHandler() {} - - public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { - final File fileToServe = resourcePackHandler.getOutputPackFile(); - - final long fileLength = fileToServe.length(); - - final HttpResponse response = new DefaultHttpResponse(HTTP_1_1, OK); - response.headers().set(CONTENT_LENGTH, fileLength); - response.headers().set(CONTENT_TYPE, Files.probeContentType(fileToServe.toPath())); - - ctx.write(response); - - final ChannelFuture sendFileFuture = ctx.write(new DefaultFileRegion(fileToServe, 0, fileLength), ctx.newProgressivePromise()); - - // progress - sendFileFuture.addListener(new ChannelProgressiveFutureListener() { - @Override - public void operationProgressed(ChannelProgressiveFuture future, long progress, long total) throws Exception { - LOGGER.debug("%s Transfer Progress: %s/%s\n", future.channel(), progress, total); - } - - @Override - public void operationComplete(ChannelProgressiveFuture future) throws Exception { - LOGGER.debug("%s Transfer complete!\n", future.channel()); - } - }); - - - ctx.writeAndFlush(LastHttpContent.EMPTY_LAST_CONTENT).addListener(ChannelFutureListener.CLOSE); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java index 371670d..e6067e7 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java @@ -1,30 +1,36 @@ package top.offsetmonkey538.gitpackmanager.networking; import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; -import org.jspecify.annotations.NonNull; +import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; import top.offsetmonkey538.meshlib.common.api.handler.HttpHandler; import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; +import top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil; import static io.netty.handler.codec.http.HttpResponseStatus.*; +import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendError; +import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendFile; public class MainHttpHandler implements HttpHandler { - @Override - public void handleRequest(@NonNull ChannelHandlerContext ctx, @NonNull FullHttpRequest request, @NonNull HttpRule rule) throws Exception { + public void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request, HttpRule rule) throws Exception { final HttpMethod method = request.method(); - // GET request should go to fileserver + // GET request should be sent the resource pack if (method == HttpMethod.GET) { - FileHttpHandler.handleRequest(ctx, request); + if (resourcePackHandler.getOutputPackPath() == null) sendError(ctx, request, NOT_FOUND); + else sendFile(ctx, request, resourcePackHandler.getOutputPackPath()); return; } - // POST request should go to the webhook handler + // POST request should trigger a pack update if (method == HttpMethod.POST) { - WebhookHttpHandler.handleRequest(ctx, request); + HttpResponseUtil.sendResponse(ctx, request, new DefaultFullHttpResponse(HTTP_1_1, OK)); + GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK, false); return; } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java deleted file mode 100644 index acade49..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/WebhookHttpHandler.java +++ /dev/null @@ -1,17 +0,0 @@ -package top.offsetmonkey538.gitpackmanager.networking; - -import io.netty.channel.*; -import io.netty.handler.codec.http.*; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; - -import static io.netty.handler.codec.http.HttpResponseStatus.*; -import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; - -public final class WebhookHttpHandler { - private WebhookHttpHandler() {} - - public static void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception { - ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, OK)).addListener(ChannelFutureListener.CLOSE); - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK, false); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java new file mode 100644 index 0000000..e3ae1f4 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.networking; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java new file mode 100644 index 0000000..ac869ae --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java index bcb0a4a..ccb2669 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java @@ -2,12 +2,11 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import org.jspecify.annotations.NonNull; import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformCommand { PlatformCommand INSTANCE = load(PlatformCommand.class); - int executeRequestPackCommand(final @NonNull CommandContext ctx) throws CommandSyntaxException; + int executeRequestPackCommand(final CommandContext ctx) throws CommandSyntaxException; } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java index 63c1914..a869752 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java @@ -1,6 +1,7 @@ package top.offsetmonkey538.gitpackmanager.platform; import com.google.common.hash.Hashing; +import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; @@ -14,8 +15,7 @@ public interface PlatformServerProperties { PlatformServerProperties INSTANCE = load(PlatformServerProperties.class); - String getResourcePackUrl(); - String getServerPort(); + @Nullable String getResourcePackUrl(); Path getDatapacksDir(); void setProperties(Map properties); void reload() throws GithubResourcepackManagerException; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java index f6711d2..d81ef2e 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java @@ -1,11 +1,12 @@ package top.offsetmonkey538.gitpackmanager.platform; -public final class ServiceLoader { - private ServiceLoader() { +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; - } +public final class ServiceLoader { + private ServiceLoader() {} public static T load(Class clazz) { + LOGGER.info("Loading service for: %s", clazz); return java.util.ServiceLoader.load(clazz, ServiceLoader.class.getClassLoader()) .findFirst() .orElseThrow(() -> new RuntimeException("Failed to load service for " + clazz.getName())); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java new file mode 100644 index 0000000..79d27b0 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.platform; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java index 63ecc07..f6c58c1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java @@ -6,9 +6,7 @@ import java.io.IOException; public final class MyFileUtils { - private MyFileUtils() { - - } + private MyFileUtils() {} public static File createDir(File file) throws GithubResourcepackManagerException { if (!file.exists() && !file.mkdirs()) throw new GithubResourcepackManagerException("Failed to create directory '%s'!", file); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java index 46eba2f..d1e8e79 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java @@ -10,9 +10,7 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; public final class StringUtils { - private StringUtils() { - - } + private StringUtils() {} /** * Replaces all instances of the keys in the placeholders map with their values. diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java index 61ad2e3..5606485 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java @@ -10,9 +10,7 @@ import java.net.http.HttpResponse; public final class WebhookSender { - private WebhookSender() { - - } + private WebhookSender() {} public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean updateSucceeded) throws GithubResourcepackManagerException { final HttpRequest request = HttpRequest.newBuilder(url) @@ -22,27 +20,14 @@ public static void send(String body, URI url, GithubResourcepackManager.UpdateTy .POST(HttpRequest.BodyPublishers.ofString(body)) .build(); - final HttpClient client = HttpClient.newHttpClient(); - final HttpResponse response; - try { + // I think we now depend on JDK 21 so HttpClient will always be AutoCloseable + try (final HttpClient client = HttpClient.newHttpClient()) { response = client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (IOException | InterruptedException e) { throw new GithubResourcepackManagerException("Failed to send http request!", e); } - // From JDK 21 the HttpClient class extends AutoCloseable, but as we want to support Minecraft versions - // that use JDK 17, where HttpClient doesn't extend AutoCloseable, we need to check if it's - // an instance of AutoCloseable before trying to close it. - //noinspection ConstantValue - if (client instanceof AutoCloseable) { - try { - ((AutoCloseable) client).close(); - } catch (Exception e) { - throw new IllegalStateException(e); - } - } - final int statusCode = response.statusCode(); if (statusCode < 200 || statusCode >= 300) { throw new GithubResourcepackManagerException("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index a0c1f43..86db2b1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -8,9 +8,7 @@ import java.util.zip.ZipOutputStream; public final class ZipUtils { - private ZipUtils() { - - } + private ZipUtils() {} public static void zipDirectory(File directoryToZip, File destinationFile) throws GithubResourcepackManagerException { if (!directoryToZip.exists()) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java new file mode 100644 index 0000000..02f6101 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.utils; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml deleted file mode 100644 index 11927c4..0000000 --- a/jitpack.yml +++ /dev/null @@ -1,4 +0,0 @@ -jdk: - - openjdk17 -env: - DISABLE_PROPERTIES_UPDATE: true \ No newline at end of file diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/package-info.java b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/package-info.java new file mode 100644 index 0000000..f22e6c5 --- /dev/null +++ b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.fabric; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/package-info.java b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/package-info.java new file mode 100644 index 0000000..07d89ac --- /dev/null +++ b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.neoforge; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java index ef43cc1..86b6942 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java @@ -8,7 +8,6 @@ import net.kyori.adventure.resource.ResourcePackRequest; import net.minecraft.server.MinecraftServer; import org.bukkit.entity.Player; -import org.jspecify.annotations.NonNull; import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.paper.api.command.PaperCommandAbstractionApi; @@ -17,7 +16,7 @@ public class PaperPlatformCommand implements PlatformCommand { @SuppressWarnings("UnstableApiUsage") @Override - public int executeRequestPackCommand(@NonNull CommandContext ctx) throws CommandSyntaxException { + public int executeRequestPackCommand(CommandContext ctx) throws CommandSyntaxException { final CommandSourceStack source = PaperCommandAbstractionApi.get(ctx); final Player player = (Player) source.getExecutor(); if (player == null) return 0; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index d6ced6e..b0034b0 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -3,13 +3,14 @@ import net.minecraft.server.MinecraftServer; import org.bukkit.OfflinePlayer; import org.bukkit.plugin.java.JavaPlugin; +import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; public class PaperPlatformMain implements PlatformMain { - private static GitPackManagerInitializer plugin; + private static @Nullable GitPackManagerInitializer plugin = null; @Override public void refreshDatapacks() { @@ -28,7 +29,7 @@ private static void setPlugin(GitPackManagerInitializer plugin) { PaperPlatformMain.plugin = plugin; } - public static GitPackManagerInitializer getPlugin() { + public static @Nullable GitPackManagerInitializer getPlugin() { return plugin; } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java index e2ee7a1..9e28663 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java @@ -5,6 +5,7 @@ import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; +import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; @@ -15,17 +16,12 @@ public class PaperPlatformServerProperties implements PlatformServerProperties { @Override - public String getResourcePackUrl() { + public @Nullable String getResourcePackUrl() { final Optional resourcePackProperties = MinecraftServer.getServer().getServerResourcePack(); return resourcePackProperties.map(MinecraftServer.ServerResourcePackInfo::url).orElse(null); } - @Override - public String getServerPort() { - return String.valueOf(MinecraftServer.getServer().getPort()); - } - @Override public Path getDatapacksDir() { return MinecraftServer.getServer().getWorldPath(LevelResource.DATAPACK_DIR); diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/package-info.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/package-info.java new file mode 100644 index 0000000..05208fc --- /dev/null +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.paper.platform; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/package-info.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/package-info.java new file mode 100644 index 0000000..740e44e --- /dev/null +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/mixin/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.modded.mixin; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java index 36720db..497a1a5 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java @@ -7,7 +7,6 @@ import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import org.jspecify.annotations.NonNull; import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.modded.api.command.ModdedCommandAbstractionApi; @@ -17,7 +16,7 @@ public class ModdedPlatformCommand implements PlatformCommand { @Override - public int executeRequestPackCommand(@NonNull CommandContext ctx) throws CommandSyntaxException { + public int executeRequestPackCommand(CommandContext ctx) throws CommandSyntaxException { final CommandSourceStack source = ModdedCommandAbstractionApi.get(ctx); final ServerPlayer player = source.getPlayerOrException(); final MinecraftServer.ServerResourcePackInfo resourcePackProperties = source.getServer().getServerResourcePack().orElse(null); diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 688f5f3..69e1341 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -4,6 +4,7 @@ import net.minecraft.server.dedicated.DedicatedServerProperties; import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; +import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; @@ -18,17 +19,12 @@ public class ModdedPlatformServerProperties implements PlatformServerProperties { @Override - public String getResourcePackUrl() { + public @Nullable String getResourcePackUrl() { final Optional resourcePackProperties = ModdedPlatformMain.getServer().getServerResourcePack(); return resourcePackProperties.map(MinecraftServer.ServerResourcePackInfo::url).orElse(null); } - @Override - public String getServerPort() { - return String.valueOf(ModdedPlatformMain.getServer().getPort()); - } - @Override public Path getDatapacksDir() { return ModdedPlatformMain.getServer().getWorldPath(LevelResource.DATAPACK_DIR); diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/package-info.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/package-info.java new file mode 100644 index 0000000..b3fc67c --- /dev/null +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.modded.platform; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file From 0b4daf72c0f75a0d6840ac21d5b09095e27db83a Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Tue, 27 Jan 2026 21:49:54 +0200 Subject: [PATCH 60/89] optimize imports --- .../gitpackmanager/GithubResourcepackManager.java | 13 ++++++++++--- .../command/GitPackManagerCommand.java | 9 ++++++++- .../gitpackmanager/config/ConfigHandler.java | 6 ++++-- .../gitpackmanager/config/ModConfig.java | 14 +++++++++++--- .../gitpackmanager/handler/DataPackHandler.java | 7 +++++-- .../gitpackmanager/handler/GitHandler.java | 4 +++- .../handler/ResourcePackHandler.java | 5 ++++- .../gitpackmanager/networking/MainHttpHandler.java | 4 +++- .../platform/PlatformServerProperties.java | 4 +++- .../gitpackmanager/utils/StringUtils.java | 2 +- .../gitpackmanager/utils/ZipUtils.java | 6 +++++- .../platform/ModdedPlatformServerProperties.java | 2 +- .../resources/git-pack-manager.modded.mixins.json | 4 ++-- 13 files changed, 60 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index 491adb5..818b20c 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -5,14 +5,16 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; -import top.offsetmonkey538.gitpackmanager.config.ModConfig; import top.offsetmonkey538.gitpackmanager.config.ConfigHandler; +import top.offsetmonkey538.gitpackmanager.config.ModConfig; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.handler.DataPackHandler; import top.offsetmonkey538.gitpackmanager.handler.GitHandler; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; import top.offsetmonkey538.gitpackmanager.networking.MainHttpHandler; -import top.offsetmonkey538.gitpackmanager.platform.*; +import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; +import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.platform.PlatformText; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.meshlib.common.api.router.HttpRouter; import top.offsetmonkey538.meshlib.common.api.router.HttpRouterRegistry; @@ -31,7 +33,12 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Executor; import java.util.concurrent.Executors; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index 66a6964..00d947b 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -18,7 +18,14 @@ import static com.mojang.brigadier.arguments.BoolArgumentType.bool; import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.clearAdminMessageQueue; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.createUpdateMessage; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.generatePlaceholders; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.literal; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.sendText; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index 960ffaa..3fcbb31 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -1,6 +1,7 @@ package top.offsetmonkey538.gitpackmanager.config; -import blue.endless.jankson.*; +import blue.endless.jankson.Jankson; +import blue.endless.jankson.JsonGrammar; import top.offsetmonkey538.gitpackmanager.config.webhook.BasicWebhook; import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicFailMessage; @@ -14,7 +15,8 @@ import java.util.ArrayList; import java.util.List; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; public final class ConfigHandler { private ConfigHandler() { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 47a1f5f..5171e68 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -1,10 +1,13 @@ package top.offsetmonkey538.gitpackmanager.config; -import blue.endless.jankson.*; +import blue.endless.jankson.Comment; +import blue.endless.jankson.JsonArray; +import blue.endless.jankson.JsonElement; +import blue.endless.jankson.JsonNull; +import blue.endless.jankson.JsonObject; import blue.endless.jankson.api.Marshaller; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; @@ -17,7 +20,12 @@ import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_URI; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; public class ModConfig implements Config { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java index 12068ba..bfbae6a 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java @@ -9,10 +9,13 @@ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.*; +import java.util.Arrays; +import java.util.List; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.DATAPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; public class DataPackHandler { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index 30cc227..33acd57 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -24,7 +24,9 @@ import java.util.List; import java.util.Optional; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; public class GitHandler { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java index e9ff3b5..c6f20c1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java @@ -18,7 +18,10 @@ import java.util.Random; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_OUTPUT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; public class ResourcePackHandler { private @Nullable Path outputPackPath = null; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java index e6067e7..2d90d88 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java @@ -9,7 +9,9 @@ import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil; -import static io.netty.handler.codec.http.HttpResponseStatus.*; +import static io.netty.handler.codec.http.HttpResponseStatus.METHOD_NOT_ALLOWED; +import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; +import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendError; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java index a869752..cb1c0a7 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java @@ -9,7 +9,9 @@ import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.*; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_UUID; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformServerProperties { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java index d1e8e79..95cfdd3 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java @@ -6,8 +6,8 @@ import java.util.Map; import java.util.regex.Matcher; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; public final class StringUtils { private StringUtils() {} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index 86db2b1..acc7d8f 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -2,7 +2,11 @@ import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; -import java.io.*; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 69e1341..15a368c 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -6,9 +6,9 @@ import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; -import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; +import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.nio.file.Path; diff --git a/modded/src/main/resources/git-pack-manager.modded.mixins.json b/modded/src/main/resources/git-pack-manager.modded.mixins.json index 1bf50ba..293639c 100644 --- a/modded/src/main/resources/git-pack-manager.modded.mixins.json +++ b/modded/src/main/resources/git-pack-manager.modded.mixins.json @@ -3,9 +3,9 @@ "package": "top.offsetmonkey538.gitpackmanager.modded.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ - "SettingsAccessor", "DedicatedServerAccessor", - "DedicatedServerSettingsAccessor" + "DedicatedServerSettingsAccessor", + "SettingsAccessor" ], "injectors": { "defaultRequire": 1 From f8814c0d811143bd54ac17896d8171a389d75c7d Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:05:11 +0200 Subject: [PATCH 61/89] use mesh lib routing rule in config --- .../GithubResourcepackManager.java | 65 ++++++++++--------- .../gitpackmanager/config/ConfigHandler.java | 21 ++++-- .../gitpackmanager/config/ModConfig.java | 40 ++++++------ gradle.properties | 2 +- 4 files changed, 70 insertions(+), 58 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index 818b20c..b8c9834 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -50,7 +50,6 @@ private GithubResourcepackManager() { } public static final String MOD_ID = "git-pack-manager"; - public static final String MOD_URI = MOD_ID; public static final OffsetLogger LOGGER = OffsetLogger.create(MOD_ID); public static final Path DATA_FOLDER = LoaderUtil.getConfigDir().resolve(MOD_ID).resolve(".packs"); @@ -79,8 +78,7 @@ private GithubResourcepackManager() { } } - @SuppressWarnings("NotNullFieldNotInitialized") - public static ConfigHolder config; + public static ConfigHolder config = ConfigHolder.create(ModConfig::new, LOGGER); public static @Nullable ResourcePackHandler resourcePackHandler = null; @@ -89,42 +87,45 @@ private GithubResourcepackManager() { public static void initialize() { TelemetryRegistry.register(MOD_ID); - addLogToAdminListeners(); - LoaderUtil.sendMessagesToAdminsOnJoin(() -> { - if (MESSAGE_QUEUE.isEmpty()) return new MonkeyLibText[] {}; + // Have to run all this stuff (definitely initializing config at least) after other mods have initialized. Namely, after MESH-Lib has its rule serialization stuff to the jankson event + ServerLifecycleApi.STARTED.listen(() -> { + addLogToAdminListeners(); + LoaderUtil.sendMessagesToAdminsOnJoin(() -> { + if (MESSAGE_QUEUE.isEmpty()) return new MonkeyLibText[]{}; - final MonkeyLibText[] result = new MonkeyLibText[MESSAGE_QUEUE.size() + 1]; - MESSAGE_QUEUE.toArray(result); - result[result.length - 1] = MESSAGE_QUEUE_EMPTY_MESSAGE; - return result; - }); + final MonkeyLibText[] result = new MonkeyLibText[MESSAGE_QUEUE.size() + 1]; + MESSAGE_QUEUE.toArray(result); + result[result.length - 1] = MESSAGE_QUEUE_EMPTY_MESSAGE; + return result; + }); - // config should be initialized after the error listeners - config = ConfigManager.init(ConfigHolder.create(ModConfig::new, LOGGER)); + // config should be initialized after the error listeners + ConfigManager.init(config); - GitPackManagerCommand.register(); - ConfigCommandApi.registerConfigCommand( - config, - () -> disabled = ConfigHandler.handleConfig(), - "gh-rp-manager", "config" - ); + GitPackManagerCommand.register(); + ConfigCommandApi.registerConfigCommand( + config, + () -> disabled = ConfigHandler.handleConfig(), + "gh-rp-manager", "config" + ); - disabled = ConfigHandler.handleConfig(); + disabled = ConfigHandler.handleConfig(); - try { - createFolderStructure(); - } catch (GithubResourcepackManagerException e) { - LOGGER.error("Failed to create folder structure!", e); - } + try { + createFolderStructure(); + } catch (GithubResourcepackManagerException e) { + LOGGER.error("Failed to create folder structure!", e); + } - HttpRouterRegistry.HTTP_ROUTER_REGISTRATION_EVENT.listen(registry -> { - registry.register(MOD_ID, new HttpRouter( - new PathHttpRule(MOD_URI), - new MainHttpHandler() - )); + updatePack(UpdateType.RESTART, true); }); - ServerLifecycleApi.STARTED.listen(() -> updatePack(UpdateType.RESTART, true)); + HttpRouterRegistry.HTTP_ROUTER_REGISTRATION_EVENT.listen(registry -> registry.register( + MOD_ID, new HttpRouter( + config.get().serverInfo.routingRule, + new MainHttpHandler() + ) + )); } private static void addLogToAdminListeners() { @@ -169,7 +170,7 @@ private static void updatePack(final UpdateType updateType) { } if (disabled) { - LOGGER.warn("Skipping pack updating because config was invalid!"); + LOGGER.warn("Skipping pack updating because mod is disabled!"); return; } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index 3fcbb31..f3744f9 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -8,6 +8,7 @@ import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicSuccessMessage; import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedFailMessage; import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedSuccessMessage; +import top.offsetmonkey538.meshlib.common.api.MESHLibApi; import java.io.IOException; import java.nio.file.Files; @@ -24,19 +25,27 @@ private ConfigHandler() { } public static boolean handleConfig() { + MESHLibApi.reload(); + LOGGER.info("Writing default webhook bodies"); createDefaultWebhooks(); // Checking if config is valid final List errors = checkConfigErrors(); - // Return false when nothing's wrong (disables the mod) - if (errors.isEmpty()) return false; + boolean success = true; + if (!errors.isEmpty()) { + // There were errors, time to log em. + LOGGER.error("There were problems with the config for Git Pack Manager, see below for more details!"); + errors.stream().map(string -> " " + string).forEach(LOGGER::error); + success = false; + } + if (MESHLibApi.getExternalPort() == null) { + LOGGER.error("MESH Lib hasn't been configured correctly! Disabling Git Pack Manager!"); + success = false; + } - // There were errors, time to log em. - LOGGER.error("There were problems with the config for GitHub Resourcepack Manager, see below for more details!"); - errors.stream().map(string -> " " + string).forEach(LOGGER::error); - return true; + return !success; } private static void createDefaultWebhooks() { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 5171e68..9eaa9a8 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -10,6 +10,9 @@ import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; +import top.offsetmonkey538.meshlib.common.api.MESHLibApi; +import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; +import top.offsetmonkey538.meshlib.common.api.rule.rules.PathHttpRule; import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; import top.offsetmonkey538.offsetutils538.api.config.Config; import top.offsetmonkey538.offsetutils538.api.config.Datafixer; @@ -23,9 +26,9 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_URI; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.UpdateType; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class ModConfig implements Config { @@ -37,13 +40,13 @@ public class ModConfig implements Config { public static class ServerInfo { - @SuppressWarnings("HttpUrlsUsage") - @Comment("The public ip of your server, may also specify the protocol (\"123.45.67.89\" or \"http://play.coolserver.net\")") + @Comment("The MESH Lib rule to use for routing to the Git Pack Manager http handler. See MESH Lib docs: https://mesh-lib.docs.offsetmonkey538.top/WHATEVER/PAGE/WILL/TELL/YOU/HOW/TO/USE/RULES") // TODO: real link once meshlib has docs + public HttpRule routingRule = new PathHttpRule(MOD_ID); + @Comment("The public ip of your server. (\"123.45.67.89\" or \"play.coolserver.net\")") public @Nullable String publicIp = null; - - @Comment("If set, this port will be used in the server.properties file instead of the Minecraft server port. The HTTP server will still be hosted on the Minecraft port. Only useful when running the server behind a proxy like nginx, traefik, cloudflare tunnel, etc.") - // TODO: rename to externalPort and make it required - public @Nullable String proxyPort = null; + @SuppressWarnings("HttpUrlsUsage") + @Comment("The url matched by the routing rule defined above. May include placeholders for \"{exposedPort}\" (defined in MESH Lib config), \"{publicIp}\" (defined above) and \"{filename}\" (the file to download). Used for generating the download url for clients. Default value: \"http://{publicIp}:{exposedPort}/" + MOD_ID + "/{filename}\"") + public String downloadUrlPattern = "http://{publicIp}:{exposedPort}/" + MOD_ID + "/{filename}"; } public static class RepositoryInfo { @@ -68,8 +71,8 @@ public static class ResourcePackProvider { public String rootLocation = "/resourcepacks"; @Comment("Messages sent in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") - public String[] updateMessage = new String[] { - "&{hoverText,'{longDescription}','Server resourcepack has been updated!'}", + public @Nullable String[] updateMessage = new String[] { + "&{hoverText,'{longDescription}','Server resource pack has been updated!'}", "&{hoverText,'{longDescription}','Please click &{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'} to get the most up to date pack.'}" }; @@ -221,6 +224,10 @@ public Datafixer[] getDatafixers() { original.put("resourcePackProvider", datafix3to4UpdateMessage((JsonObject) original.get("resourcePackProvider"), marsh)); original.put("dataPackProvider", datafix3to4UpdateMessage((JsonObject) original.get("dataPackProvider"), marsh)); + }, + (original, jankson) -> { + // 4 -> 5 + original.remove("proxyPort"); } }; } @@ -272,7 +279,7 @@ private static JsonObject datafix3to4UpdateMessage(final JsonObject originalJson @Override public int getConfigVersion() { - return 4; + return 5; } @Override @@ -312,16 +319,11 @@ private static void tryMoveConfig(final Path oldPath, final Path newPath) { } } - @SuppressWarnings("HttpUrlsUsage") public String getPackUrl(String outputFileName) { - return String.format( - "%s%s:%s/%s/%s", - (serverInfo.publicIp.startsWith("http://") || serverInfo.publicIp.startsWith("https://") ? "" : "http://"), - serverInfo.publicIp, - serverInfo.proxyPort, - MOD_URI, - outputFileName - ); + return serverInfo.downloadUrlPattern + .replace("{publicIp}", serverInfo.publicIp) + .replace("{exposedPort}", String.valueOf(MESHLibApi.getExternalPort())) + .replace("{filename}", outputFileName); } public String getGithubRef() { diff --git a/gradle.properties b/gradle.properties index c070740..2606326 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 monkeylib538_version = 3.0.0-beta.2.1769533505281+9e950f8 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1769533647381+4a26cb6 +meshlib_version = 2.0.0-alpha.0.1769614581048+a8207ac # JGit jgit_version = 6.9.0.202403050737-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify From 8e3a986a5f7cf5403365e72a73349eed2cd7ef84 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:16:52 +0200 Subject: [PATCH 62/89] Replace String.format and formatted usages with ArgReplaced from OffsetUtils. --- .../gitpackmanager/GithubResourcepackManager.java | 4 +++- .../gitpackmanager/command/GitPackManagerCommand.java | 5 +++-- .../gitpackmanager/config/ConfigHandler.java | 7 ++++--- .../offsetmonkey538/gitpackmanager/config/ModConfig.java | 2 +- .../gitpackmanager/handler/DataPackHandler.java | 3 ++- .../offsetmonkey538/gitpackmanager/handler/GitHandler.java | 5 +++-- .../top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java | 4 +++- 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index b8c9834..cd6cbd8 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -44,6 +44,8 @@ import java.util.concurrent.Executors; import java.util.regex.Pattern; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; + public final class GithubResourcepackManager { private GithubResourcepackManager() { @@ -136,7 +138,7 @@ private static void addLogToAdminListeners() { private static OffsetLogger.LogListener createLogToAdminListener(final int textColor) { return (message, error) -> { final MonkeyLibText text = MonkeyLibText - .of("[%s] %s".formatted(MOD_ID, message)) + .of(replaceArgs("[%s] %s", MOD_ID, message)) .applyStyle(style -> style.withColor(textColor)); if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index 00d947b..3f3af29 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -28,6 +28,7 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.literal; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.sendText; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public final class GitPackManagerCommand { @@ -78,11 +79,11 @@ private static LiteralArgumentBuilder createCommand() { private static void runTriggerUpdate(CommandContext context, boolean force) { final OffsetLogger.LogListener infoListener = (message, error) -> { - sendText(context, MonkeyLibText.of(String.format("[%s] %s", MOD_ID, message)).applyStyle(style -> style.withColor(MonkeyLibStyle.Color.GRAY))); + sendText(context, MonkeyLibText.of(replaceArgs("[%s] %s", MOD_ID, message)).applyStyle(style -> style.withColor(MonkeyLibStyle.Color.GRAY))); }; final OffsetLogger.LogListener warnListener = (message, error) -> { final MonkeyLibText text = MonkeyLibText - .of("[%s] %s".formatted(MOD_ID, message)) + .of(replaceArgs("[%s] %s", MOD_ID, message)) .applyStyle(style -> style.withColor(MonkeyLibStyle.Color.YELLOW)); if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index f3744f9..1e22d85 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -18,6 +18,7 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public final class ConfigHandler { private ConfigHandler() { @@ -97,10 +98,10 @@ private static List checkConfigErrors() { private static void checkWebhookErrors(final List errors, final ModConfig.WebhookInfo webhook, final String webhookPath) { if (!webhook.enabled) return; - if (webhook.url == null) errors.add("Field '%s.url' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); - if (webhook.body == null) errors.add("Field '%s.body' not set, but '%s.enabled' is true!".formatted(webhookPath, webhookPath)); + if (webhook.url == null) errors.add(replaceArgs("Field '%s.url' not set, but '%s.enabled' is true!", webhookPath, webhookPath)); + if (webhook.body == null) errors.add(replaceArgs("Field '%s.body' not set, but '%s.enabled' is true!", webhookPath, webhookPath)); final Path bodyPath = webhook.getBodyPath(); - if (bodyPath != null && !Files.exists(bodyPath)) errors.add("Field '%s.body' points to file '%s', which doesn't exist!".formatted(webhookPath, bodyPath.toAbsolutePath())); + if (bodyPath != null && !Files.exists(bodyPath)) errors.add(replaceArgs("Field '%s.body' points to file '%s', which doesn't exist!", webhookPath, bodyPath.toAbsolutePath())); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 9eaa9a8..80d4442 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -270,7 +270,7 @@ private static JsonObject datafix3to4UpdateMessage(final JsonObject originalJson for (int i = 0; i < newUpdateMessage.length; i++) { newUpdateMessage[i] = newUpdateMessage[i].replaceAll("\\{packUpdateCommand}", "&{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'}"); if (updateMessageHoverMessage != null) - newUpdateMessage[i] = "&{hoverText,'%s','%s'}".formatted(updateMessageHoverMessage, newUpdateMessage[i].replace("'", "\\'")); + newUpdateMessage[i] = replaceArgs("&{hoverText,'%s','%s'}", updateMessageHoverMessage, newUpdateMessage[i].replace("'", "\\'")); } originalJson.put("updateMessage", new JsonArray(newUpdateMessage, marsh)); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java index bfbae6a..18843b1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java @@ -16,6 +16,7 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.DATAPACK_FOLDER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class DataPackHandler { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); @@ -105,7 +106,7 @@ private void writeStateFile(List files) throws IOException { private State readStateFile() throws IOException { if (Files.notExists(STATE_FILE)) { - LOGGER.warn("State file '%s' not found! No datapacks will be deleted!".formatted(STATE_FILE)); + LOGGER.warn(replaceArgs("State file '%s' not found! No datapacks will be deleted!", STATE_FILE)); return new State(new String[]{}); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index 33acd57..0fb8bdb 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -27,6 +27,7 @@ import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class GitHandler { @@ -161,8 +162,8 @@ private static List getDiff(String startingHash) throws IOException, Git final Repository repository = git.getRepository(); final ObjectId headCommit = repository.resolve("HEAD^{tree}"); - final ObjectId startingCommit = repository.resolve("%s^{tree}".formatted(startingHash)); - if (startingCommit == null) throw new IllegalArgumentException("Previous commit (hash '%s') doesn't exist!".formatted(startingHash)); + final ObjectId startingCommit = repository.resolve(startingHash + "^{tree}"); + if (startingCommit == null) throw new IllegalArgumentException(replaceArgs("Previous commit (hash '%s') doesn't exist!", startingHash)); try (final ObjectReader repoReader = repository.newObjectReader()) { final CanonicalTreeParser headTreeParser = new CanonicalTreeParser(); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index acc7d8f..cb49240 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -11,6 +11,8 @@ import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; + public final class ZipUtils { private ZipUtils() {} @@ -159,7 +161,7 @@ private static File newFileFromZipEntry(File destinationDir, ZipEntry zipEntry) String destinationFilePath = destinationFile.getCanonicalPath(); if (!destinationFilePath.startsWith(destinationDirPath + File.separator)) { - throw new IOException(String.format("Entry is outside of the target dir '%s'!", zipEntry.getName())); + throw new IOException(replaceArgs("Entry is outside of the target dir '%s'!", zipEntry.getName())); } return destinationFile; From c8ba23b2b35a3041bc730dbeb611c08bc45261e0 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:18:27 +0200 Subject: [PATCH 63/89] Rename GithubResourcepackManagerException to GitPackManagerException --- .../GithubResourcepackManager.java | 39 ++++++++-------- .../command/GitPackManagerCommand.java | 6 +-- .../gitpackmanager/config/ModConfig.java | 6 +-- .../exception/GitPackManager.java | 19 ++++++++ .../GithubResourcepackManagerException.java | 19 -------- .../handler/DataPackHandler.java | 26 +++++------ .../gitpackmanager/handler/GitHandler.java | 26 +++++------ .../handler/ResourcePackHandler.java | 44 +++++++++---------- .../platform/PlatformServerProperties.java | 8 ++-- .../gitpackmanager/utils/MyFileUtils.java | 12 ++--- .../gitpackmanager/utils/StringUtils.java | 6 +-- .../gitpackmanager/utils/WebhookSender.java | 8 ++-- .../gitpackmanager/utils/ZipUtils.java | 40 ++++++++--------- .../PaperPlatformServerProperties.java | 6 +-- .../ModdedPlatformServerProperties.java | 4 +- 15 files changed, 134 insertions(+), 135 deletions(-) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java index cd6cbd8..833fd97 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java @@ -7,7 +7,7 @@ import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; import top.offsetmonkey538.gitpackmanager.config.ConfigHandler; import top.offsetmonkey538.gitpackmanager.config.ModConfig; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.handler.DataPackHandler; import top.offsetmonkey538.gitpackmanager.handler.GitHandler; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; @@ -18,7 +18,6 @@ import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.meshlib.common.api.router.HttpRouter; import top.offsetmonkey538.meshlib.common.api.router.HttpRouterRegistry; -import top.offsetmonkey538.meshlib.common.api.rule.rules.PathHttpRule; import top.offsetmonkey538.monkeylib538.common.api.command.ConfigCommandApi; import top.offsetmonkey538.monkeylib538.common.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; @@ -115,7 +114,7 @@ public static void initialize() { try { createFolderStructure(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to create folder structure!", e); } @@ -148,13 +147,13 @@ private static OffsetLogger.LogListener createLogToAdminListener(final int textC }; } - private static void createFolderStructure() throws GithubResourcepackManagerException { + private static void createFolderStructure() throws GitPackManager { try { Files.createDirectories(RESOURCEPACK_OUTPUT_FOLDER); Files.createDirectories(DATAPACK_FOLDER); Files.createDirectories(GIT_FOLDER); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to create directory!", e); + throw new GitPackManager("Failed to create directory!", e); } } @@ -190,7 +189,7 @@ private static void updatePack(final UpdateType updateType) { try { createFolderStructure(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to create folder structure!", e); } @@ -201,7 +200,7 @@ private static void updatePack(final UpdateType updateType) { boolean failed = false; try { gitHandler.updateRepositoryAndGenerateCommitProperties(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to update git repository!", e); failed = true; } @@ -240,7 +239,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update boolean failed = false; try { resourcePackHandler.generatePack(wasUpdated, oldResourcePackPath, oldResourcePackName); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to generate pack!", e); failed = updateFailed = true; } @@ -250,7 +249,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Update server.properties file. try { PlatformServerProperties.INSTANCE.updatePackProperties(resourcePackHandler); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to update server.properties file!", e); } @@ -260,7 +259,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Send chat message try { if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, wasUpdated, placeholders); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to send update message for resource pack in chat!", e); } @@ -271,12 +270,12 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update } if (!updateFailed) try { config.get().resourcePackProvider.successWebhook.trigger(true, placeholders, updateType); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { config.get().resourcePackProvider.failWebhook.trigger(false, placeholders, updateType); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to trigger fail webhook!", e); } } @@ -295,7 +294,7 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType LOGGER.info("Getting pack location..."); try { dataPackHandler.generatePack(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to generate pack!", e); updateFailed = true; } @@ -310,28 +309,28 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType // Send chat message try { sendUpdateMessage(config.get().dataPackProvider.updateMessage, true, placeholders, true); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to send update message for datapack in chat!", e); } // Trigger webhooks if (!updateFailed) try { config.get().dataPackProvider.successWebhook.trigger(true, placeholders, updateType); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { config.get().dataPackProvider.failWebhook.trigger(false, placeholders, updateType); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { LOGGER.error("Failed to trigger fail webhook!", e); } } - private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders) throws GithubResourcepackManagerException { + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders) throws GitPackManager { sendUpdateMessage(updateMessage, wasUpdated, placeholders, false); } - private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GithubResourcepackManagerException { + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GitPackManager { if (!wasUpdated) { LOGGER.info("Not sending chat message because pack was not updated."); return; @@ -341,7 +340,7 @@ private static void sendUpdateMessage(final String[] updateMessage, boolean wasU PlatformText.INSTANCE.sendUpdateMessage(line, adminsOnly); } - public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GithubResourcepackManagerException { + public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GitPackManager { final MonkeyLibText[] result = new MonkeyLibText[updateMessage.length]; for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { @@ -350,7 +349,7 @@ public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, try { result[lineIndex] = TextFormattingApi.styleText(line); } catch (Exception e) { - throw new GithubResourcepackManagerException("Failed to style update message at line %s!", e, lineIndex); + throw new GitPackManager("Failed to style update message at line %s!", e, lineIndex); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index 3f3af29..e7bee3e 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -4,7 +4,7 @@ import com.mojang.brigadier.context.CommandContext; import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.handler.GitHandler; import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi; @@ -103,7 +103,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean final GitHandler gitHandler = new GitHandler(); try { gitHandler.updateRepositoryAndGenerateCommitProperties(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { CommandAbstractionApi.sendError(context, "Failed to update repository, git related placeholders will not be replaced!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); LOGGER.error("Failed to update repository, git related placeholders will not be replaced!", e); @@ -113,7 +113,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean final MonkeyLibText[] text; try { text = createUpdateMessage(isResource ? config.get().resourcePackProvider.updateMessage : config.get().dataPackProvider.updateMessage, placeholders); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { CommandAbstractionApi.sendError(context, "Failed to create update message!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); LOGGER.error("Failed to create update message for %spack!", e, isResource ? "resource" : "data"); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 80d4442..2b432d0 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -7,7 +7,7 @@ import blue.endless.jankson.JsonObject; import blue.endless.jankson.api.Marshaller; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; import top.offsetmonkey538.meshlib.common.api.MESHLibApi; @@ -133,7 +133,7 @@ public WebhookInfo() { @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") public @Nullable String body = null; - public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GithubResourcepackManagerException { + public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GitPackManager { if (!enabled) return; try { @@ -143,7 +143,7 @@ public void trigger(final boolean updateSucceeded, final Map pla WebhookSender.send(webhookBody, getWebhookUrl(), updateType, updateSucceeded); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to read content of webhook body file '%s'!", e, config.get().resourcePackProvider.successWebhook.body); + throw new GitPackManager("Failed to read content of webhook body file '%s'!", e, config.get().resourcePackProvider.successWebhook.body); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java new file mode 100644 index 0000000..286ea5f --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java @@ -0,0 +1,19 @@ +package top.offsetmonkey538.gitpackmanager.exception; + +public class GitPackManager extends Exception { + public GitPackManager(String message) { + super(message); + } + + public GitPackManager(String message, Object... args) { + this(String.format(message, args)); + } + + public GitPackManager(String message, Throwable cause) { + super(message, cause); + } + + public GitPackManager(String message, Throwable cause, Object... args) { + this(String.format(message, args), cause); + } +} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java deleted file mode 100644 index 163ad24..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GithubResourcepackManagerException.java +++ /dev/null @@ -1,19 +0,0 @@ -package top.offsetmonkey538.gitpackmanager.exception; - -public class GithubResourcepackManagerException extends Exception { - public GithubResourcepackManagerException(String message) { - super(message); - } - - public GithubResourcepackManagerException(String message, Object... args) { - this(String.format(message, args)); - } - - public GithubResourcepackManagerException(String message, Throwable cause) { - super(message, cause); - } - - public GithubResourcepackManagerException(String message, Throwable cause, Object... args) { - this(String.format(message, args), cause); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java index 18843b1..953b119 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java @@ -3,7 +3,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.file.PathUtils; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.io.IOException; @@ -23,7 +23,7 @@ public class DataPackHandler { private static final Path STATE_FILE = DATAPACK_FOLDER.resolve("state.json"); - public void generatePack() throws GithubResourcepackManagerException { + public void generatePack() throws GitPackManager { final Path datapacks = PlatformServerProperties.INSTANCE.getDatapacksDir(); @@ -32,7 +32,7 @@ public void generatePack() throws GithubResourcepackManagerException { try { existingPacks = readStateFile(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to read state file!", e); + throw new GitPackManager("Failed to read state file!", e); } Arrays.stream(existingPacks.packs) @@ -57,8 +57,8 @@ public void generatePack() throws GithubResourcepackManagerException { try { sourcePacks = gatherSourcePacks(); - } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to gather source packs!", e); + } catch (GitPackManager e) { + throw new GitPackManager("Failed to gather source packs!", e); } // Delete ones with same name from datapacks @@ -71,7 +71,7 @@ public void generatePack() throws GithubResourcepackManagerException { PathUtils.delete(path); LOGGER.info("Deleted pack at '%s'!", path.toAbsolutePath()); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); + throw new GitPackManager("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); } } @@ -85,14 +85,14 @@ public void generatePack() throws GithubResourcepackManagerException { LOGGER.info("Copied pack from '%s' to '%s'.", path.toAbsolutePath(), destination.toAbsolutePath()); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to copy pack at '%s' to datapacks directory at '%s'!", e, path.toAbsolutePath(), datapacks.toAbsolutePath()); + throw new GitPackManager("Failed to copy pack at '%s' to datapacks directory at '%s'!", e, path.toAbsolutePath(), datapacks.toAbsolutePath()); } } try { writeStateFile(sourcePacks); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to write state file!", e); + throw new GitPackManager("Failed to write state file!", e); } } @@ -113,7 +113,7 @@ private State readStateFile() throws IOException { return GSON.fromJson(Files.readString(STATE_FILE), State.class); } - private List gatherSourcePacks() throws GithubResourcepackManagerException { + private List gatherSourcePacks() throws GitPackManager { LOGGER.info("Checking for 'pack.mcmeta' in data pack root..."); final boolean hasPackMcmeta = Files.exists(config.get().dataPackProvider.getPackRoot().resolve("pack.mcmeta")); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); @@ -124,7 +124,7 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackRoot().toAbsolutePath()); + throw new GitPackManager("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackRoot().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackPacksDir().toAbsolutePath()); @@ -142,7 +142,7 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException return gatherSourcePacksFrom(packsDir); } - private List gatherSourcePacksFrom(final Path packsDir) throws GithubResourcepackManagerException { + private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManager { try (final Stream sourcePacks = Files.list(packsDir)) { final List result = sourcePacks .filter(path -> { @@ -154,11 +154,11 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou .toList(); if (result.isEmpty()) - throw new GithubResourcepackManagerException("Repository contains empty 'packs' folder!"); + throw new GitPackManager("Repository contains empty 'packs' folder!"); return result; } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to list files in 'packs' folder'!", e); + throw new GitPackManager("Failed to list files in 'packs' folder'!", e); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index 0fb8bdb..496c362 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -17,7 +17,7 @@ import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.CanonicalTreeParser; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.git.CommitProperties; import java.io.IOException; @@ -34,11 +34,11 @@ public class GitHandler { private @Nullable CommitProperties commitProperties = null; private @Nullable List changedFiles; - public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcepackManagerException { + public void updateRepositoryAndGenerateCommitProperties() throws GitPackManager { String originalCommitHash; try { originalCommitHash = getLatestCommitHash(); - } catch (GithubResourcepackManagerException e) { + } catch (GitPackManager e) { if (!(e.getCause() instanceof RepositoryNotFoundException)) throw e; originalCommitHash = ""; @@ -60,7 +60,7 @@ public void updateRepositoryAndGenerateCommitProperties() throws GithubResourcep } - private static CommitProperties getLatestCommitProperties(String lastCommitHash, String newCommitHash) throws GithubResourcepackManagerException { + private static CommitProperties getLatestCommitProperties(String lastCommitHash, String newCommitHash) throws GitPackManager { try { final Repository repository = getRepository(); final RevCommit commit = new RevWalk(getRepository()).parseCommit(getLatestCommit().getObjectId()); @@ -76,11 +76,11 @@ private static CommitProperties getLatestCommitProperties(String lastCommitHash, String.valueOf(commit.getCommitTime()) ); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to parse latest commit!", e); + throw new GitPackManager("Failed to parse latest commit!", e); } } - private static void updateRepository(boolean retry) throws GithubResourcepackManagerException { + private static void updateRepository(boolean retry) throws GitPackManager { // Create credentials provider if repository is private CredentialsProvider credentialsProvider = null; if (config.get().repositoryInfo.isPrivate) @@ -131,7 +131,7 @@ private static void updateRepository(boolean retry) throws GithubResourcepackMan } } - private static void cloneRepository(@Nullable CredentialsProvider credentialsProvider) throws GithubResourcepackManagerException { + private static void cloneRepository(@Nullable CredentialsProvider credentialsProvider) throws GitPackManager { try { Git git = Git.cloneRepository() .setURI(config.get().repositoryInfo.url) @@ -141,19 +141,19 @@ private static void cloneRepository(@Nullable CredentialsProvider credentialsPro .call(); git.close(); } catch (GitAPIException e) { - throw new GithubResourcepackManagerException("Failed to clone repository!", e); + throw new GitPackManager("Failed to clone repository!", e); } } - private static String getLatestCommitHash() throws GithubResourcepackManagerException { + private static String getLatestCommitHash() throws GitPackManager { return getLatestCommit().getObjectId().getName(); } - private static Ref getLatestCommit() throws GithubResourcepackManagerException { + private static Ref getLatestCommit() throws GitPackManager { try { return getRepository().findRef("HEAD"); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to get latest commit in repository!", e); + throw new GitPackManager("Failed to get latest commit in repository!", e); } } @@ -187,11 +187,11 @@ private static List getDiff(String startingHash) throws IOException, Git } } - private static Repository getRepository() throws GithubResourcepackManagerException { + private static Repository getRepository() throws GitPackManager { try (Git git = Git.open(GIT_FOLDER.toFile())) { return git.getRepository(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to open repository!", e); + throw new GitPackManager("Failed to open repository!", e); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java index c6f20c1..622c689 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java @@ -3,7 +3,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.utils.MyFileUtils; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.ZipUtils; @@ -26,7 +26,7 @@ public class ResourcePackHandler { private @Nullable Path outputPackPath = null; - public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) throws GithubResourcepackManagerException { + public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) throws GitPackManager { outputPackPath = handleOldPackAndGetOutputPackPath(wasUpdated, oldPackPath, oldPackName); // If using the old pack, don't generate a new one. @@ -36,13 +36,13 @@ public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullab generateNewPack(); } - private void generateNewPack() throws GithubResourcepackManagerException { + private void generateNewPack() throws GitPackManager { final List sourcePacks; try { sourcePacks = gatherSourcePacks(); - } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to gather source packs!", e); + } catch (GitPackManager e) { + throw new GitPackManager("Failed to gather source packs!", e); } @@ -51,40 +51,40 @@ private void generateNewPack() throws GithubResourcepackManagerException { try { tmpDir = Files.createDirectories(RESOURCEPACK_FOLDER.resolve("temp")); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to create temporary directory!", e); + throw new GitPackManager("Failed to create temporary directory!", e); } final File tempOutputDir = MyFileUtils.createDir(tmpDir.resolve("output").toFile()); // Extract packs into the temporary packs directory try { extractSourcePacks(sourcePacks, tempOutputDir); - } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to extract source packs!", e); + } catch (GitPackManager e) { + throw new GitPackManager("Failed to extract source packs!", e); } // Write file with source pack names try { writeSourcePacksFile(sourcePacks, tempOutputDir); - } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to write pack content file!", e); + } catch (GitPackManager e) { + throw new GitPackManager("Failed to write pack content file!", e); } // Zip the pack content and put the output file in the output directory. try { ZipUtils.zipDirectory(tempOutputDir, Objects.requireNonNull(getOutputPackFile())); - } catch (GithubResourcepackManagerException e) { - throw new GithubResourcepackManagerException("Failed to zip pack content!", e); + } catch (GitPackManager e) { + throw new GitPackManager("Failed to zip pack content!", e); } // Delete temp directories. try { FileUtils.deleteDirectory(tmpDir.toFile()); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to delete temporary directory!", e); + throw new GitPackManager("Failed to delete temporary directory!", e); } } - private void writeSourcePacksFile(List sourcePacks, File outputDir) throws GithubResourcepackManagerException { + private void writeSourcePacksFile(List sourcePacks, File outputDir) throws GitPackManager { if (sourcePacks.size() == 1) return; final Path sourcePacksFile = outputDir.toPath().resolve("content.txt"); @@ -99,18 +99,18 @@ private void writeSourcePacksFile(List sourcePacks, File outputDir) throws try { Files.writeString(sourcePacksFile, fileContent); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to write to file '%s'!", e, sourcePacksFile); + throw new GitPackManager("Failed to write to file '%s'!", e, sourcePacksFile); } } - private void extractSourcePacks(List sourcePacks, File tempOutputDir) throws GithubResourcepackManagerException { + private void extractSourcePacks(List sourcePacks, File tempOutputDir) throws GitPackManager { // Extract source packs for (File sourcePack : sourcePacks) { if (sourcePack.isDirectory()) { try { FileUtils.copyDirectory(sourcePack, tempOutputDir, HiddenFileFilter.VISIBLE); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to copy pack '%s' into output directory '%s'!", e, sourcePack, tempOutputDir); + throw new GitPackManager("Failed to copy pack '%s' into output directory '%s'!", e, sourcePack, tempOutputDir); } continue; } @@ -124,10 +124,10 @@ private void extractSourcePacks(List sourcePacks, File tempOutputDir) thro } } - private List gatherSourcePacksFrom(final Path packsDir) throws GithubResourcepackManagerException { + private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManager { // Gather resource packs final File[] sourcePacksArray = packsDir.toFile().listFiles(); - if (sourcePacksArray == null) throw new GithubResourcepackManagerException("Repository contains empty 'packs' folder!"); + if (sourcePacksArray == null) throw new GitPackManager("Repository contains empty 'packs' folder!"); // Return source packs sorted in correct order. return Stream.of(sourcePacksArray) @@ -141,7 +141,7 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GithubResou .toList(); } - private List gatherSourcePacks() throws GithubResourcepackManagerException { + private List gatherSourcePacks() throws GitPackManager { LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); final boolean hasPackMcmeta = config.get().resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); @@ -152,7 +152,7 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GithubResourcepackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); + throw new GitPackManager("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); @@ -179,7 +179,7 @@ private List gatherSourcePacks() throws GithubResourcepackManagerException try { if (oldPackPath != null && Files.exists(oldPackPath)) Files.delete(oldPackPath); } catch (IOException e) { - LOGGER.error("Failed to delete old pack!", new GithubResourcepackManagerException("Failed to delete old pack '%s'!", e, oldPackPath)); + LOGGER.error("Failed to delete old pack!", new GitPackManager("Failed to delete old pack '%s'!", e, oldPackPath)); } return RESOURCEPACK_OUTPUT_FOLDER.resolve(newPackName); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java index cb1c0a7..43f36a2 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java @@ -2,7 +2,7 @@ import com.google.common.hash.Hashing; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; import java.io.IOException; @@ -20,9 +20,9 @@ public interface PlatformServerProperties { @Nullable String getResourcePackUrl(); Path getDatapacksDir(); void setProperties(Map properties); - void reload() throws GithubResourcepackManagerException; + void reload() throws GitPackManager; - default void updatePackProperties(ResourcePackHandler packHandler) throws GithubResourcepackManagerException { + default void updatePackProperties(ResourcePackHandler packHandler) throws GitPackManager { final String resourcePackUrl = config.get().getPackUrl(packHandler.getOutputPackName()); final String resourcePackSha1; try { @@ -30,7 +30,7 @@ default void updatePackProperties(ResourcePackHandler packHandler) throws Github //noinspection deprecation resourcePackSha1 = Hashing.sha1().hashBytes(com.google.common.io.Files.toByteArray(packHandler.getOutputPackFile())).toString(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to get sha1 hash from pack file '%s'!", e, packHandler.getOutputPackFile()); + throw new GitPackManager("Failed to get sha1 hash from pack file '%s'!", e, packHandler.getOutputPackFile()); } LOGGER.info("Saving new resource pack properties to 'server.properties' file..."); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java index f6c58c1..080acd2 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import java.io.File; import java.io.IOException; @@ -8,19 +8,19 @@ public final class MyFileUtils { private MyFileUtils() {} - public static File createDir(File file) throws GithubResourcepackManagerException { - if (!file.exists() && !file.mkdirs()) throw new GithubResourcepackManagerException("Failed to create directory '%s'!", file); + public static File createDir(File file) throws GitPackManager { + if (!file.exists() && !file.mkdirs()) throw new GitPackManager("Failed to create directory '%s'!", file); return file; } - public static void createNewFile(File file) throws GithubResourcepackManagerException { - if (file.exists() && !file.delete()) throw new GithubResourcepackManagerException("Failed to delete file '%s'!", file); + public static void createNewFile(File file) throws GitPackManager { + if (file.exists() && !file.delete()) throw new GitPackManager("Failed to delete file '%s'!", file); try { //noinspection ResultOfMethodCallIgnored file.createNewFile(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to create file '%s'!", e, file); + throw new GitPackManager("Failed to create file '%s'!", e, file); } } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java index 95cfdd3..e016727 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import java.io.File; import java.util.Map; @@ -55,12 +55,12 @@ private static int extractPriorityFromFileInternal(File file) { return Integer.parseInt(matcher.group().replace('-', ' ').strip()); } - public static String nameWithoutPriorityString(File file) throws GithubResourcepackManagerException { + public static String nameWithoutPriorityString(File file) throws GitPackManager { final String filename = file.getName(); final Matcher matcher = RESOURCEPACK_NAME_PATTERN.matcher(filename); - if (!matcher.find()) throw new GithubResourcepackManagerException("File '%s' doesn't start with priority!", file); + if (!matcher.find()) throw new GitPackManager("File '%s' doesn't start with priority!", file); return filename.replace(matcher.group(), "").strip(); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java index 5606485..25068d1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java @@ -1,7 +1,7 @@ package top.offsetmonkey538.gitpackmanager.utils; import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import java.io.IOException; import java.net.URI; @@ -12,7 +12,7 @@ public final class WebhookSender { private WebhookSender() {} - public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean updateSucceeded) throws GithubResourcepackManagerException { + public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean updateSucceeded) throws GitPackManager { final HttpRequest request = HttpRequest.newBuilder(url) .header("Content-Type", "application/json") .header("X-Resource-Pack-Update-Type", updateType.name()) @@ -25,12 +25,12 @@ public static void send(String body, URI url, GithubResourcepackManager.UpdateTy try (final HttpClient client = HttpClient.newHttpClient()) { response = client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (IOException | InterruptedException e) { - throw new GithubResourcepackManagerException("Failed to send http request!", e); + throw new GitPackManager("Failed to send http request!", e); } final int statusCode = response.statusCode(); if (statusCode < 200 || statusCode >= 300) { - throw new GithubResourcepackManagerException("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); + throw new GitPackManager("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); } } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index cb49240..8e6b43d 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import java.io.File; import java.io.FileInputStream; @@ -16,9 +16,9 @@ public final class ZipUtils { private ZipUtils() {} - public static void zipDirectory(File directoryToZip, File destinationFile) throws GithubResourcepackManagerException { + public static void zipDirectory(File directoryToZip, File destinationFile) throws GitPackManager { if (!directoryToZip.exists()) - throw new GithubResourcepackManagerException("Directory '%s' does not exist!", directoryToZip); + throw new GitPackManager("Directory '%s' does not exist!", directoryToZip); try { final FileOutputStream fos = new FileOutputStream(destinationFile); @@ -29,13 +29,13 @@ public static void zipDirectory(File directoryToZip, File destinationFile) throw zos.close(); fos.close(); } catch (FileNotFoundException e) { - throw new GithubResourcepackManagerException("Failed to find file '%s'!", e, destinationFile); + throw new GitPackManager("Failed to find file '%s'!", e, destinationFile); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to zip directory '%s' to file '%s'!", e, directoryToZip, destinationFile); + throw new GitPackManager("Failed to zip directory '%s' to file '%s'!", e, directoryToZip, destinationFile); } } - public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputStream) throws GithubResourcepackManagerException { + public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputStream) throws GitPackManager { if (!directoryToZip.isDirectory()) return; final File[] children = directoryToZip.listFiles(); @@ -45,7 +45,7 @@ public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputSt } } - private static void zipFile(File fileToZip, String filename, ZipOutputStream zipOutputStream) throws GithubResourcepackManagerException { + private static void zipFile(File fileToZip, String filename, ZipOutputStream zipOutputStream) throws GitPackManager { if (fileToZip.isHidden()) return; if (fileToZip.isDirectory()) { @@ -57,7 +57,7 @@ private static void zipFile(File fileToZip, String filename, ZipOutputStream zip zipOutputStream.putNextEntry(zipEntry); zipOutputStream.closeEntry(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to add directory '%s' to zip file!", e, filename); + throw new GitPackManager("Failed to add directory '%s' to zip file!", e, filename); } final File[] children = fileToZip.listFiles(); @@ -79,16 +79,16 @@ private static void zipFile(File fileToZip, String filename, ZipOutputStream zip zipOutputStream.write(bytes, 0, length); } } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to add file '%s' to zip file!", e, filename); + throw new GitPackManager("Failed to add file '%s' to zip file!", e, filename); } } - public static void unzipFile(File fileToUnzip, File destinationDir) throws GithubResourcepackManagerException { + public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPackManager { final ZipInputStream zipInputStream; try { zipInputStream = new ZipInputStream(new FileInputStream(fileToUnzip)); } catch (FileNotFoundException e) { - throw new GithubResourcepackManagerException("Failed to find zip file '%s'!", e, fileToUnzip); + throw new GitPackManager("Failed to find zip file '%s'!", e, fileToUnzip); } final byte[] buffer = new byte[1024]; @@ -96,7 +96,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws Githu try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to get next entry in zip file '%s'!", e, fileToUnzip); + throw new GitPackManager("Failed to get next entry in zip file '%s'!", e, fileToUnzip); } while (zipEntry != null) { @@ -104,19 +104,19 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws Githu try { newFile = newFileFromZipEntry(destinationDir, zipEntry); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to create file from zip entry '%s'!", e, zipEntry); + throw new GitPackManager("Failed to create file from zip entry '%s'!", e, zipEntry); } if (zipEntry.isDirectory()) { if (!newFile.isDirectory() && !newFile.mkdirs()) { - throw new GithubResourcepackManagerException("Failed to create directory '%s'!", newFile); + throw new GitPackManager("Failed to create directory '%s'!", newFile); } try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to get next entry in zip file '%'!", e, fileToUnzip); + throw new GitPackManager("Failed to get next entry in zip file '%'!", e, fileToUnzip); } continue; @@ -124,7 +124,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws Githu final File parent = newFile.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { - throw new GithubResourcepackManagerException("Failed to create directory '%s'", newFile); + throw new GitPackManager("Failed to create directory '%s'", newFile); } // Write file content @@ -134,15 +134,15 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws Githu fileOutputStream.write(buffer, 0, length); } } catch (FileNotFoundException e) { - throw new GithubResourcepackManagerException("Failed to find file!", e); + throw new GitPackManager("Failed to find file!", e); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to write file content!", e); + throw new GitPackManager("Failed to write file content!", e); } try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to get next entry in zip file '%'!", e, fileToUnzip); + throw new GitPackManager("Failed to get next entry in zip file '%'!", e, fileToUnzip); } } @@ -150,7 +150,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws Githu zipInputStream.closeEntry(); zipInputStream.close(); } catch (IOException e) { - throw new GithubResourcepackManagerException("Failed to close zip file '%s'!", e, fileToUnzip); + throw new GitPackManager("Failed to close zip file '%s'!", e, fileToUnzip); } } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java index 9e28663..4b6cd6c 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java @@ -6,7 +6,7 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.lang.reflect.Field; @@ -39,7 +39,7 @@ public void setProperties(Map properties) { } @Override - public void reload() throws GithubResourcepackManagerException { + public void reload() throws GitPackManager { final DedicatedServerSettings settings = ((DedicatedServer) MinecraftServer.getServer()).settings; try { @@ -54,7 +54,7 @@ public void reload() throws GithubResourcepackManagerException { DedicatedServerProperties.fromFile((Path) sourceField.get(settings), MinecraftServer.getServer().options) ); } catch (NoSuchFieldException | IllegalAccessException e) { - throw new GithubResourcepackManagerException("Failed to reload 'server.properties' file!", e); + throw new GitPackManager("Failed to reload 'server.properties' file!", e); } } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 15a368c..17938a1 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -5,7 +5,7 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GithubResourcepackManagerException; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; @@ -44,7 +44,7 @@ public void setProperties(Map properties) { } @Override - public void reload() throws GithubResourcepackManagerException { + public void reload() throws GitPackManager { final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) ModdedPlatformMain.getServer()).getSettings(); final DedicatedServerSettingsAccessor propertiesLoaderAccess = (DedicatedServerSettingsAccessor) propertiesLoader; From 85fb33d4e20498bf13c66837563317313b36c60e Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:19:37 +0200 Subject: [PATCH 64/89] Make GitPackManagerException use ArgReplacer, add constructor overloads for ArgReplacer overloads --- .../exception/GitPackManager.java | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java index 286ea5f..2bfef15 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java @@ -1,19 +1,37 @@ package top.offsetmonkey538.gitpackmanager.exception; +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; + public class GitPackManager extends Exception { public GitPackManager(String message) { super(message); } + public GitPackManager(String message, Object arg) { + this(replaceArgs(message, arg)); + } + + public GitPackManager(String message, Object arg1, Object arg2) { + this(replaceArgs(message, arg1, arg2)); + } + public GitPackManager(String message, Object... args) { - this(String.format(message, args)); + this(replaceArgs(message, args)); } public GitPackManager(String message, Throwable cause) { super(message, cause); } + public GitPackManager(String message, Throwable cause, Object arg) { + this(replaceArgs(message, arg), cause); + } + + public GitPackManager(String message, Throwable cause, Object arg1, Object arg2) { + this(replaceArgs(message, arg1, arg2), cause); + } + public GitPackManager(String message, Throwable cause, Object... args) { - this(String.format(message, args), cause); + this(replaceArgs(message, args), cause); } } From e8edec78c16530c6aa8632aa4e94110d01345699 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:31:27 +0200 Subject: [PATCH 65/89] Rename (hopefully) all usages of github resourcepack manager to git pack manager. Also rename GitPackManager to GitPackManagerException cause that's what it's supposed to be lol --- README.md | 4 +- ...cepackManager.java => GitPackManager.java} | 42 ++++++------- .../command/GitPackManagerCommand.java | 34 +++++------ .../gitpackmanager/config/ConfigHandler.java | 4 +- .../gitpackmanager/config/ModConfig.java | 18 +++--- .../discord/basic/BasicFailMessage.java | 4 +- .../discord/basic/BasicSuccessMessage.java | 4 +- .../discord/embed/EmbedFailMessage.java | 4 +- .../discord/embed/EmbedSuccessMessage.java | 4 +- .../exception/GitPackManager.java | 37 ------------ .../exception/GitPackManagerException.java | 37 ++++++++++++ .../handler/DataPackHandler.java | 32 +++++----- .../gitpackmanager/handler/GitHandler.java | 32 +++++----- .../handler/ResourcePackHandler.java | 56 +++++++++--------- .../networking/MainHttpHandler.java | 6 +- .../platform/PlatformServerProperties.java | 14 ++--- .../platform/ServiceLoader.java | 2 +- .../gitpackmanager/utils/MyFileUtils.java | 12 ++-- .../gitpackmanager/utils/StringUtils.java | 10 ++-- .../gitpackmanager/utils/WebhookSender.java | 10 ++-- .../gitpackmanager/utils/ZipUtils.java | 40 ++++++------- .../icon.png | Bin .../fabric/GitPackManagerInitializer.java | 4 +- .../neoforge/GitPackManagerInitializer.java | 4 +- .../paper/platform/PaperPlatformMain.java | 4 +- .../PaperPlatformServerProperties.java | 6 +- .../ModdedPlatformServerProperties.java | 4 +- 27 files changed, 214 insertions(+), 214 deletions(-) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{GithubResourcepackManager.java => GitPackManager.java} (94%) delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java rename common/src/main/resources/assets/{github-resourcepack-manager => git-pack-manager}/icon.png (100%) diff --git a/README.md b/README.md index fb5796d..08e0c63 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# GitHub Resourcepack Manager +# Git Pack Manager [![discord-singular](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/social/discord-singular_vector.svg)](https://discord.offsetmonkey538.top/) [![modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/mod/git-pack-manager) [![requires-monkeylib538](https://raw.githubusercontent.com/OffsetMods538/MonkeyLib538/master/images/requires_monkeylib538.png)](https://modrinth.com/mod/monkeylib538) [![Requires Fabric API](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/requires/fabric-api_vector.svg)](https://modrinth.com/mod/fabric-api) TODO: badge for mesh-lib I guess? -Please read the documentation located [here](https://github-resourcepack-manager.docs.offsetmonkey538.top) and if you have any questions, feel free to contact me on [discord](https://discord.offsetmonkey538.top/) +Please read the documentation located [here](https://git-pack-manager.docs.offsetmonkey538.top) and if you have any questions, feel free to contact me on [discord](https://discord.offsetmonkey538.top/) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java index 833fd97..a3fd866 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GithubResourcepackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java @@ -7,7 +7,7 @@ import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; import top.offsetmonkey538.gitpackmanager.config.ConfigHandler; import top.offsetmonkey538.gitpackmanager.config.ModConfig; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.handler.DataPackHandler; import top.offsetmonkey538.gitpackmanager.handler.GitHandler; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; @@ -45,8 +45,8 @@ import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; -public final class GithubResourcepackManager { - private GithubResourcepackManager() { +public final class GitPackManager { + private GitPackManager() { } @@ -114,7 +114,7 @@ public static void initialize() { try { createFolderStructure(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to create folder structure!", e); } @@ -147,13 +147,13 @@ private static OffsetLogger.LogListener createLogToAdminListener(final int textC }; } - private static void createFolderStructure() throws GitPackManager { + private static void createFolderStructure() throws GitPackManagerException { try { Files.createDirectories(RESOURCEPACK_OUTPUT_FOLDER); Files.createDirectories(DATAPACK_FOLDER); Files.createDirectories(GIT_FOLDER); } catch (IOException e) { - throw new GitPackManager("Failed to create directory!", e); + throw new GitPackManagerException("Failed to create directory!", e); } } @@ -189,7 +189,7 @@ private static void updatePack(final UpdateType updateType) { try { createFolderStructure(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to create folder structure!", e); } @@ -200,7 +200,7 @@ private static void updatePack(final UpdateType updateType) { boolean failed = false; try { gitHandler.updateRepositoryAndGenerateCommitProperties(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to update git repository!", e); failed = true; } @@ -239,7 +239,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update boolean failed = false; try { resourcePackHandler.generatePack(wasUpdated, oldResourcePackPath, oldResourcePackName); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to generate pack!", e); failed = updateFailed = true; } @@ -249,7 +249,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Update server.properties file. try { PlatformServerProperties.INSTANCE.updatePackProperties(resourcePackHandler); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to update server.properties file!", e); } @@ -259,7 +259,7 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update // Send chat message try { if (!failed) sendUpdateMessage(config.get().resourcePackProvider.updateMessage, wasUpdated, placeholders); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to send update message for resource pack in chat!", e); } @@ -270,12 +270,12 @@ private static void updateResourcePack(final GitHandler gitHandler, final Update } if (!updateFailed) try { config.get().resourcePackProvider.successWebhook.trigger(true, placeholders, updateType); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { config.get().resourcePackProvider.failWebhook.trigger(false, placeholders, updateType); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to trigger fail webhook!", e); } } @@ -294,7 +294,7 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType LOGGER.info("Getting pack location..."); try { dataPackHandler.generatePack(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to generate pack!", e); updateFailed = true; } @@ -309,28 +309,28 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType // Send chat message try { sendUpdateMessage(config.get().dataPackProvider.updateMessage, true, placeholders, true); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to send update message for datapack in chat!", e); } // Trigger webhooks if (!updateFailed) try { config.get().dataPackProvider.successWebhook.trigger(true, placeholders, updateType); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to trigger success webhook!", e); } else try { config.get().dataPackProvider.failWebhook.trigger(false, placeholders, updateType); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { LOGGER.error("Failed to trigger fail webhook!", e); } } - private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders) throws GitPackManager { + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders) throws GitPackManagerException { sendUpdateMessage(updateMessage, wasUpdated, placeholders, false); } - private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GitPackManager { + private static void sendUpdateMessage(final String[] updateMessage, boolean wasUpdated, final Map placeholders, boolean adminsOnly) throws GitPackManagerException { if (!wasUpdated) { LOGGER.info("Not sending chat message because pack was not updated."); return; @@ -340,7 +340,7 @@ private static void sendUpdateMessage(final String[] updateMessage, boolean wasU PlatformText.INSTANCE.sendUpdateMessage(line, adminsOnly); } - public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GitPackManager { + public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GitPackManagerException { final MonkeyLibText[] result = new MonkeyLibText[updateMessage.length]; for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { @@ -349,7 +349,7 @@ public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, try { result[lineIndex] = TextFormattingApi.styleText(line); } catch (Exception e) { - throw new GitPackManager("Failed to style update message at line %s!", e, lineIndex); + throw new GitPackManagerException("Failed to style update message at line %s!", e, lineIndex); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index e7bee3e..a3c1957 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -3,8 +3,8 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; import org.apache.commons.lang3.exception.ExceptionUtils; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.handler.GitHandler; import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi; @@ -18,14 +18,14 @@ import static com.mojang.brigadier.arguments.BoolArgumentType.bool; import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.UpdateType; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.clearAdminMessageQueue; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.createUpdateMessage; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.generatePlaceholders; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.clearAdminMessageQueue; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.createUpdateMessage; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.generatePlaceholders; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.resourcePackHandler; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.literal; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.sendText; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; @@ -90,12 +90,12 @@ private static void runTriggerUpdate(CommandContext context, boolean for sendText(context, text); }; - GithubResourcepackManager.LOGGER.addListener(OffsetLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.addListener(OffsetLogger.LogLevel.WARN, warnListener); + GitPackManager.LOGGER.addListener(OffsetLogger.LogLevel.INFO, infoListener); + GitPackManager.LOGGER.addListener(OffsetLogger.LogLevel.WARN, warnListener); - GithubResourcepackManager.updatePack(force ? GithubResourcepackManager.UpdateType.COMMAND_FORCE : GithubResourcepackManager.UpdateType.COMMAND, false).thenRun(() -> { - GithubResourcepackManager.LOGGER.removeListener(OffsetLogger.LogLevel.INFO, infoListener); - GithubResourcepackManager.LOGGER.removeListener(OffsetLogger.LogLevel.WARN, warnListener); + GitPackManager.updatePack(force ? GitPackManager.UpdateType.COMMAND_FORCE : GitPackManager.UpdateType.COMMAND, false).thenRun(() -> { + GitPackManager.LOGGER.removeListener(OffsetLogger.LogLevel.INFO, infoListener); + GitPackManager.LOGGER.removeListener(OffsetLogger.LogLevel.WARN, warnListener); }); } @@ -103,7 +103,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean final GitHandler gitHandler = new GitHandler(); try { gitHandler.updateRepositoryAndGenerateCommitProperties(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { CommandAbstractionApi.sendError(context, "Failed to update repository, git related placeholders will not be replaced!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); LOGGER.error("Failed to update repository, git related placeholders will not be replaced!", e); @@ -113,7 +113,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean final MonkeyLibText[] text; try { text = createUpdateMessage(isResource ? config.get().resourcePackProvider.updateMessage : config.get().dataPackProvider.updateMessage, placeholders); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { CommandAbstractionApi.sendError(context, "Failed to create update message!"); CommandAbstractionApi.sendError(context, "Cause:\n%s\n", e); LOGGER.error("Failed to create update message for %spack!", e, isResource ? "resource" : "data"); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java index 1e22d85..55dd2af 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java @@ -16,8 +16,8 @@ import java.util.ArrayList; import java.util.List; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public final class ConfigHandler { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 2b432d0..71856da 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -7,7 +7,7 @@ import blue.endless.jankson.JsonObject; import blue.endless.jankson.api.Marshaller; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; import top.offsetmonkey538.meshlib.common.api.MESHLibApi; @@ -23,16 +23,16 @@ import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.MOD_ID; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.UpdateType; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class ModConfig implements Config { - @Comment("!!!!Please check the wiki for how to set up the mod. It is linked on both the Modrinth and GitHub pages!!!!") + @Comment("!!!! Please check the wiki for how to set up the mod. It should be available here: https://git-pack-manager.docs.offsetmonkey538.top and is also linked on the Modrinth page. !!!!") public ServerInfo serverInfo = new ServerInfo(); public RepositoryInfo repositoryInfo = new RepositoryInfo(); public ResourcePackProvider resourcePackProvider = new ResourcePackProvider(); @@ -133,7 +133,7 @@ public WebhookInfo() { @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") public @Nullable String body = null; - public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GitPackManager { + public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GitPackManagerException { if (!enabled) return; try { @@ -143,7 +143,7 @@ public void trigger(final boolean updateSucceeded, final Map pla WebhookSender.send(webhookBody, getWebhookUrl(), updateType, updateSucceeded); } catch (IOException e) { - throw new GitPackManager("Failed to read content of webhook body file '%s'!", e, config.get().resourcePackProvider.successWebhook.body); + throw new GitPackManagerException("Failed to read content of webhook body file '%s'!", e, config.get().resourcePackProvider.successWebhook.body); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java index 1c29d69..292fd7f 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java @@ -4,8 +4,8 @@ public final class BasicFailMessage implements DefaultWebhookBody { - public final String username = "GitHub Resource Pack Manager"; - public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final String username = "Git Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Git-Pack-Manager/blob/master/common/src/main/resources/assets/git-pack-manager/icon.png?raw=true"; public final String content = "Pack update failed!"; @Override diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java index 8962188..0471431 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java @@ -4,8 +4,8 @@ public final class BasicSuccessMessage implements DefaultWebhookBody { - public final String username = "GitHub Resource Pack Manager"; - public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final String username = "Git Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Git-Pack-Manager/blob/master/common/src/main/resources/assets/git-pack-manager/icon.png?raw=true"; public final String content = "New update for pack released!\nDescription: {shortDescription}\nDownload [here]({downloadUrl})"; @Override diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java index d25ad89..f599363 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java @@ -4,8 +4,8 @@ public final class EmbedFailMessage implements DefaultWebhookBody { - public final String username = "GitHub Resource Pack Manager"; - public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final String username = "Git Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Git-Pack-Manager/blob/master/common/src/main/resources/assets/git-pack-manager/icon.png?raw=true"; public final Embed[] embeds = new Embed[] { new Embed( "Pack update failed!", diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java index 781f4ac..2661256 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java @@ -4,8 +4,8 @@ public final class EmbedSuccessMessage implements DefaultWebhookBody { - public final String username = "GitHub Resource Pack Manager"; - public final String avatar_url = "https://github.com/OffsetMods538/Github-Resourcepack-Manager/blob/master/src/main/resources/assets/github-resourcepack-manager/icon.png?raw=true"; + public final String username = "Git Pack Manager"; + public final String avatar_url = "https://github.com/OffsetMods538/Git-Pack-Manager/blob/master/common/src/main/resources/assets/git-pack-manager/icon.png?raw=true"; public final Embed[] embeds = new Embed[] { new Embed( "New update for pack released!", diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java deleted file mode 100644 index 2bfef15..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManager.java +++ /dev/null @@ -1,37 +0,0 @@ -package top.offsetmonkey538.gitpackmanager.exception; - -import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; - -public class GitPackManager extends Exception { - public GitPackManager(String message) { - super(message); - } - - public GitPackManager(String message, Object arg) { - this(replaceArgs(message, arg)); - } - - public GitPackManager(String message, Object arg1, Object arg2) { - this(replaceArgs(message, arg1, arg2)); - } - - public GitPackManager(String message, Object... args) { - this(replaceArgs(message, args)); - } - - public GitPackManager(String message, Throwable cause) { - super(message, cause); - } - - public GitPackManager(String message, Throwable cause, Object arg) { - this(replaceArgs(message, arg), cause); - } - - public GitPackManager(String message, Throwable cause, Object arg1, Object arg2) { - this(replaceArgs(message, arg1, arg2), cause); - } - - public GitPackManager(String message, Throwable cause, Object... args) { - this(replaceArgs(message, args), cause); - } -} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java new file mode 100644 index 0000000..6994dc5 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java @@ -0,0 +1,37 @@ +package top.offsetmonkey538.gitpackmanager.exception; + +import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; + +public class GitPackManagerException extends Exception { + public GitPackManagerException(String message) { + super(message); + } + + public GitPackManagerException(String message, Object arg) { + this(replaceArgs(message, arg)); + } + + public GitPackManagerException(String message, Object arg1, Object arg2) { + this(replaceArgs(message, arg1, arg2)); + } + + public GitPackManagerException(String message, Object... args) { + this(replaceArgs(message, args)); + } + + public GitPackManagerException(String message, Throwable cause) { + super(message, cause); + } + + public GitPackManagerException(String message, Throwable cause, Object arg) { + this(replaceArgs(message, arg), cause); + } + + public GitPackManagerException(String message, Throwable cause, Object arg1, Object arg2) { + this(replaceArgs(message, arg1, arg2), cause); + } + + public GitPackManagerException(String message, Throwable cause, Object... args) { + this(replaceArgs(message, args), cause); + } +} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java index 953b119..45038b1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java @@ -3,7 +3,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.file.PathUtils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.io.IOException; @@ -13,9 +13,9 @@ import java.util.List; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.DATAPACK_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.DATAPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class DataPackHandler { @@ -23,7 +23,7 @@ public class DataPackHandler { private static final Path STATE_FILE = DATAPACK_FOLDER.resolve("state.json"); - public void generatePack() throws GitPackManager { + public void generatePack() throws GitPackManagerException { final Path datapacks = PlatformServerProperties.INSTANCE.getDatapacksDir(); @@ -32,7 +32,7 @@ public void generatePack() throws GitPackManager { try { existingPacks = readStateFile(); } catch (IOException e) { - throw new GitPackManager("Failed to read state file!", e); + throw new GitPackManagerException("Failed to read state file!", e); } Arrays.stream(existingPacks.packs) @@ -57,8 +57,8 @@ public void generatePack() throws GitPackManager { try { sourcePacks = gatherSourcePacks(); - } catch (GitPackManager e) { - throw new GitPackManager("Failed to gather source packs!", e); + } catch (GitPackManagerException e) { + throw new GitPackManagerException("Failed to gather source packs!", e); } // Delete ones with same name from datapacks @@ -71,7 +71,7 @@ public void generatePack() throws GitPackManager { PathUtils.delete(path); LOGGER.info("Deleted pack at '%s'!", path.toAbsolutePath()); } catch (IOException e) { - throw new GitPackManager("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); + throw new GitPackManagerException("Failed to delete pack at '%s'!", e, path.toAbsolutePath()); } } @@ -85,14 +85,14 @@ public void generatePack() throws GitPackManager { LOGGER.info("Copied pack from '%s' to '%s'.", path.toAbsolutePath(), destination.toAbsolutePath()); } catch (IOException e) { - throw new GitPackManager("Failed to copy pack at '%s' to datapacks directory at '%s'!", e, path.toAbsolutePath(), datapacks.toAbsolutePath()); + throw new GitPackManagerException("Failed to copy pack at '%s' to datapacks directory at '%s'!", e, path.toAbsolutePath(), datapacks.toAbsolutePath()); } } try { writeStateFile(sourcePacks); } catch (IOException e) { - throw new GitPackManager("Failed to write state file!", e); + throw new GitPackManagerException("Failed to write state file!", e); } } @@ -113,7 +113,7 @@ private State readStateFile() throws IOException { return GSON.fromJson(Files.readString(STATE_FILE), State.class); } - private List gatherSourcePacks() throws GitPackManager { + private List gatherSourcePacks() throws GitPackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in data pack root..."); final boolean hasPackMcmeta = Files.exists(config.get().dataPackProvider.getPackRoot().resolve("pack.mcmeta")); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); @@ -124,7 +124,7 @@ private List gatherSourcePacks() throws GitPackManager { LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GitPackManager("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackRoot().toAbsolutePath()); + throw new GitPackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackRoot().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in data pack root '%s'!", config.get().dataPackProvider.getPackPacksDir().toAbsolutePath()); @@ -142,7 +142,7 @@ private List gatherSourcePacks() throws GitPackManager { return gatherSourcePacksFrom(packsDir); } - private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManager { + private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManagerException { try (final Stream sourcePacks = Files.list(packsDir)) { final List result = sourcePacks .filter(path -> { @@ -154,11 +154,11 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GitPackMana .toList(); if (result.isEmpty()) - throw new GitPackManager("Repository contains empty 'packs' folder!"); + throw new GitPackManagerException("Repository contains empty 'packs' folder!"); return result; } catch (IOException e) { - throw new GitPackManager("Failed to list files in 'packs' folder'!", e); + throw new GitPackManagerException("Failed to list files in 'packs' folder'!", e); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java index 496c362..6a4be61 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java @@ -17,16 +17,16 @@ import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.CanonicalTreeParser; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.git.CommitProperties; import java.io.IOException; import java.util.List; import java.util.Optional; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.GIT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class GitHandler { @@ -34,11 +34,11 @@ public class GitHandler { private @Nullable CommitProperties commitProperties = null; private @Nullable List changedFiles; - public void updateRepositoryAndGenerateCommitProperties() throws GitPackManager { + public void updateRepositoryAndGenerateCommitProperties() throws GitPackManagerException { String originalCommitHash; try { originalCommitHash = getLatestCommitHash(); - } catch (GitPackManager e) { + } catch (GitPackManagerException e) { if (!(e.getCause() instanceof RepositoryNotFoundException)) throw e; originalCommitHash = ""; @@ -60,7 +60,7 @@ public void updateRepositoryAndGenerateCommitProperties() throws GitPackManager } - private static CommitProperties getLatestCommitProperties(String lastCommitHash, String newCommitHash) throws GitPackManager { + private static CommitProperties getLatestCommitProperties(String lastCommitHash, String newCommitHash) throws GitPackManagerException { try { final Repository repository = getRepository(); final RevCommit commit = new RevWalk(getRepository()).parseCommit(getLatestCommit().getObjectId()); @@ -76,11 +76,11 @@ private static CommitProperties getLatestCommitProperties(String lastCommitHash, String.valueOf(commit.getCommitTime()) ); } catch (IOException e) { - throw new GitPackManager("Failed to parse latest commit!", e); + throw new GitPackManagerException("Failed to parse latest commit!", e); } } - private static void updateRepository(boolean retry) throws GitPackManager { + private static void updateRepository(boolean retry) throws GitPackManagerException { // Create credentials provider if repository is private CredentialsProvider credentialsProvider = null; if (config.get().repositoryInfo.isPrivate) @@ -131,7 +131,7 @@ private static void updateRepository(boolean retry) throws GitPackManager { } } - private static void cloneRepository(@Nullable CredentialsProvider credentialsProvider) throws GitPackManager { + private static void cloneRepository(@Nullable CredentialsProvider credentialsProvider) throws GitPackManagerException { try { Git git = Git.cloneRepository() .setURI(config.get().repositoryInfo.url) @@ -141,19 +141,19 @@ private static void cloneRepository(@Nullable CredentialsProvider credentialsPro .call(); git.close(); } catch (GitAPIException e) { - throw new GitPackManager("Failed to clone repository!", e); + throw new GitPackManagerException("Failed to clone repository!", e); } } - private static String getLatestCommitHash() throws GitPackManager { + private static String getLatestCommitHash() throws GitPackManagerException { return getLatestCommit().getObjectId().getName(); } - private static Ref getLatestCommit() throws GitPackManager { + private static Ref getLatestCommit() throws GitPackManagerException { try { return getRepository().findRef("HEAD"); } catch (IOException e) { - throw new GitPackManager("Failed to get latest commit in repository!", e); + throw new GitPackManagerException("Failed to get latest commit in repository!", e); } } @@ -187,11 +187,11 @@ private static List getDiff(String startingHash) throws IOException, Git } } - private static Repository getRepository() throws GitPackManager { + private static Repository getRepository() throws GitPackManagerException { try (Git git = Git.open(GIT_FOLDER.toFile())) { return git.getRepository(); } catch (IOException e) { - throw new GitPackManager("Failed to open repository!", e); + throw new GitPackManagerException("Failed to open repository!", e); } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java index 622c689..a01fa27 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java @@ -3,7 +3,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.utils.MyFileUtils; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; import top.offsetmonkey538.gitpackmanager.utils.ZipUtils; @@ -18,15 +18,15 @@ import java.util.Random; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_OUTPUT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_OUTPUT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; public class ResourcePackHandler { private @Nullable Path outputPackPath = null; - public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) throws GitPackManager { + public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullable String oldPackName) throws GitPackManagerException { outputPackPath = handleOldPackAndGetOutputPackPath(wasUpdated, oldPackPath, oldPackName); // If using the old pack, don't generate a new one. @@ -36,61 +36,61 @@ public void generatePack(boolean wasUpdated, @Nullable Path oldPackPath, @Nullab generateNewPack(); } - private void generateNewPack() throws GitPackManager { + private void generateNewPack() throws GitPackManagerException { final List sourcePacks; try { sourcePacks = gatherSourcePacks(); - } catch (GitPackManager e) { - throw new GitPackManager("Failed to gather source packs!", e); + } catch (GitPackManagerException e) { + throw new GitPackManagerException("Failed to gather source packs!", e); } // Create temp directories to extract pack(s) into. final Path tmpDir; try { - tmpDir = Files.createDirectories(RESOURCEPACK_FOLDER.resolve("temp")); + tmpDir = Files.createDirectories(RESOURCEPACK_FOLDER.resolve(".temp")); } catch (IOException e) { - throw new GitPackManager("Failed to create temporary directory!", e); + throw new GitPackManagerException("Failed to create temporary directory!", e); } final File tempOutputDir = MyFileUtils.createDir(tmpDir.resolve("output").toFile()); // Extract packs into the temporary packs directory try { extractSourcePacks(sourcePacks, tempOutputDir); - } catch (GitPackManager e) { - throw new GitPackManager("Failed to extract source packs!", e); + } catch (GitPackManagerException e) { + throw new GitPackManagerException("Failed to extract source packs!", e); } // Write file with source pack names try { writeSourcePacksFile(sourcePacks, tempOutputDir); - } catch (GitPackManager e) { - throw new GitPackManager("Failed to write pack content file!", e); + } catch (GitPackManagerException e) { + throw new GitPackManagerException("Failed to write pack content file!", e); } // Zip the pack content and put the output file in the output directory. try { ZipUtils.zipDirectory(tempOutputDir, Objects.requireNonNull(getOutputPackFile())); - } catch (GitPackManager e) { - throw new GitPackManager("Failed to zip pack content!", e); + } catch (GitPackManagerException e) { + throw new GitPackManagerException("Failed to zip pack content!", e); } // Delete temp directories. try { FileUtils.deleteDirectory(tmpDir.toFile()); } catch (IOException e) { - throw new GitPackManager("Failed to delete temporary directory!", e); + throw new GitPackManagerException("Failed to delete temporary directory!", e); } } - private void writeSourcePacksFile(List sourcePacks, File outputDir) throws GitPackManager { + private void writeSourcePacksFile(List sourcePacks, File outputDir) throws GitPackManagerException { if (sourcePacks.size() == 1) return; final Path sourcePacksFile = outputDir.toPath().resolve("content.txt"); MyFileUtils.createNewFile(sourcePacksFile.toFile()); - StringBuilder fileContent = new StringBuilder("This pack was put together using GitHub Resourcepack Manager from the following packs:\n\n"); + StringBuilder fileContent = new StringBuilder("This pack was put together using Git Pack Manager from the following packs:\n\n"); for (File pack : sourcePacks) { fileContent.append("- ").append(StringUtils.nameWithoutPriorityString(pack)).append("\n"); @@ -99,18 +99,18 @@ private void writeSourcePacksFile(List sourcePacks, File outputDir) throws try { Files.writeString(sourcePacksFile, fileContent); } catch (IOException e) { - throw new GitPackManager("Failed to write to file '%s'!", e, sourcePacksFile); + throw new GitPackManagerException("Failed to write to file '%s'!", e, sourcePacksFile); } } - private void extractSourcePacks(List sourcePacks, File tempOutputDir) throws GitPackManager { + private void extractSourcePacks(List sourcePacks, File tempOutputDir) throws GitPackManagerException { // Extract source packs for (File sourcePack : sourcePacks) { if (sourcePack.isDirectory()) { try { FileUtils.copyDirectory(sourcePack, tempOutputDir, HiddenFileFilter.VISIBLE); } catch (IOException e) { - throw new GitPackManager("Failed to copy pack '%s' into output directory '%s'!", e, sourcePack, tempOutputDir); + throw new GitPackManagerException("Failed to copy pack '%s' into output directory '%s'!", e, sourcePack, tempOutputDir); } continue; } @@ -124,10 +124,10 @@ private void extractSourcePacks(List sourcePacks, File tempOutputDir) thro } } - private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManager { + private List gatherSourcePacksFrom(final Path packsDir) throws GitPackManagerException { // Gather resource packs final File[] sourcePacksArray = packsDir.toFile().listFiles(); - if (sourcePacksArray == null) throw new GitPackManager("Repository contains empty 'packs' folder!"); + if (sourcePacksArray == null) throw new GitPackManagerException("Repository contains empty 'packs' folder!"); // Return source packs sorted in correct order. return Stream.of(sourcePacksArray) @@ -141,7 +141,7 @@ private List gatherSourcePacksFrom(final Path packsDir) throws GitPackMana .toList(); } - private List gatherSourcePacks() throws GitPackManager { + private List gatherSourcePacks() throws GitPackManagerException { LOGGER.info("Checking for 'pack.mcmeta' in resource pack root..."); final boolean hasPackMcmeta = config.get().resourcePackProvider.getPackRoot().resolve("pack.mcmeta").toFile().exists(); LOGGER.info("%sFound!", hasPackMcmeta ? "" : "Not "); @@ -152,7 +152,7 @@ private List gatherSourcePacks() throws GitPackManager { LOGGER.info("%sFound!", hasPacksFolder ? "" : "Not "); if (hasPackMcmeta && hasPacksFolder) { - throw new GitPackManager("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); + throw new GitPackManagerException("Found both 'pack.mcmeta' and the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); } if (!hasPackMcmeta && !hasPacksFolder) { LOGGER.info("Found neither 'pack.mcmeta' nor the 'packs' directory in resource pack root '%s'!", config.get().resourcePackProvider.getPackPacksDir().toAbsolutePath()); @@ -179,7 +179,7 @@ private List gatherSourcePacks() throws GitPackManager { try { if (oldPackPath != null && Files.exists(oldPackPath)) Files.delete(oldPackPath); } catch (IOException e) { - LOGGER.error("Failed to delete old pack!", new GitPackManager("Failed to delete old pack '%s'!", e, oldPackPath)); + LOGGER.error("Failed to delete old pack!", new GitPackManagerException("Failed to delete old pack '%s'!", e, oldPackPath)); } return RESOURCEPACK_OUTPUT_FOLDER.resolve(newPackName); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java index 2d90d88..0c5b213 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java @@ -4,7 +4,7 @@ import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.meshlib.common.api.handler.HttpHandler; import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil; @@ -13,7 +13,7 @@ import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.resourcePackHandler; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.resourcePackHandler; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendError; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendFile; @@ -32,7 +32,7 @@ public void handleRequest(ChannelHandlerContext ctx, FullHttpRequest request, Ht // POST request should trigger a pack update if (method == HttpMethod.POST) { HttpResponseUtil.sendResponse(ctx, request, new DefaultFullHttpResponse(HTTP_1_1, OK)); - GithubResourcepackManager.updatePack(GithubResourcepackManager.UpdateType.WEBHOOK, false); + GitPackManager.updatePack(GitPackManager.UpdateType.WEBHOOK, false); return; } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java index 43f36a2..52d8b8d 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java @@ -2,16 +2,16 @@ import com.google.common.hash.Hashing; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; import java.io.IOException; import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_UUID; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.config; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_UUID; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformServerProperties { @@ -20,9 +20,9 @@ public interface PlatformServerProperties { @Nullable String getResourcePackUrl(); Path getDatapacksDir(); void setProperties(Map properties); - void reload() throws GitPackManager; + void reload() throws GitPackManagerException; - default void updatePackProperties(ResourcePackHandler packHandler) throws GitPackManager { + default void updatePackProperties(ResourcePackHandler packHandler) throws GitPackManagerException { final String resourcePackUrl = config.get().getPackUrl(packHandler.getOutputPackName()); final String resourcePackSha1; try { @@ -30,7 +30,7 @@ default void updatePackProperties(ResourcePackHandler packHandler) throws GitPac //noinspection deprecation resourcePackSha1 = Hashing.sha1().hashBytes(com.google.common.io.Files.toByteArray(packHandler.getOutputPackFile())).toString(); } catch (IOException e) { - throw new GitPackManager("Failed to get sha1 hash from pack file '%s'!", e, packHandler.getOutputPackFile()); + throw new GitPackManagerException("Failed to get sha1 hash from pack file '%s'!", e, packHandler.getOutputPackFile()); } LOGGER.info("Saving new resource pack properties to 'server.properties' file..."); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java index d81ef2e..1fe939a 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.platform; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; public final class ServiceLoader { private ServiceLoader() {} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java index 080acd2..37429c5 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import java.io.File; import java.io.IOException; @@ -8,19 +8,19 @@ public final class MyFileUtils { private MyFileUtils() {} - public static File createDir(File file) throws GitPackManager { - if (!file.exists() && !file.mkdirs()) throw new GitPackManager("Failed to create directory '%s'!", file); + public static File createDir(File file) throws GitPackManagerException { + if (!file.exists() && !file.mkdirs()) throw new GitPackManagerException("Failed to create directory '%s'!", file); return file; } - public static void createNewFile(File file) throws GitPackManager { - if (file.exists() && !file.delete()) throw new GitPackManager("Failed to delete file '%s'!", file); + public static void createNewFile(File file) throws GitPackManagerException { + if (file.exists() && !file.delete()) throw new GitPackManagerException("Failed to delete file '%s'!", file); try { //noinspection ResultOfMethodCallIgnored file.createNewFile(); } catch (IOException e) { - throw new GitPackManager("Failed to create file '%s'!", e, file); + throw new GitPackManagerException("Failed to create file '%s'!", e, file); } } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java index e016727..5d5fbec 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java @@ -1,13 +1,13 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import java.io.File; import java.util.Map; import java.util.regex.Matcher; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GithubResourcepackManager.RESOURCEPACK_NAME_PATTERN; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_NAME_PATTERN; public final class StringUtils { private StringUtils() {} @@ -55,12 +55,12 @@ private static int extractPriorityFromFileInternal(File file) { return Integer.parseInt(matcher.group().replace('-', ' ').strip()); } - public static String nameWithoutPriorityString(File file) throws GitPackManager { + public static String nameWithoutPriorityString(File file) throws GitPackManagerException { final String filename = file.getName(); final Matcher matcher = RESOURCEPACK_NAME_PATTERN.matcher(filename); - if (!matcher.find()) throw new GitPackManager("File '%s' doesn't start with priority!", file); + if (!matcher.find()) throw new GitPackManagerException("File '%s' doesn't start with priority!", file); return filename.replace(matcher.group(), "").strip(); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java index 25068d1..88abab7 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java @@ -1,7 +1,7 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import java.io.IOException; import java.net.URI; @@ -12,7 +12,7 @@ public final class WebhookSender { private WebhookSender() {} - public static void send(String body, URI url, GithubResourcepackManager.UpdateType updateType, boolean updateSucceeded) throws GitPackManager { + public static void send(String body, URI url, GitPackManager.UpdateType updateType, boolean updateSucceeded) throws GitPackManagerException { final HttpRequest request = HttpRequest.newBuilder(url) .header("Content-Type", "application/json") .header("X-Resource-Pack-Update-Type", updateType.name()) @@ -25,12 +25,12 @@ public static void send(String body, URI url, GithubResourcepackManager.UpdateTy try (final HttpClient client = HttpClient.newHttpClient()) { response = client.send(request, HttpResponse.BodyHandlers.ofString()); } catch (IOException | InterruptedException e) { - throw new GitPackManager("Failed to send http request!", e); + throw new GitPackManagerException("Failed to send http request!", e); } final int statusCode = response.statusCode(); if (statusCode < 200 || statusCode >= 300) { - throw new GitPackManager("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); + throw new GitPackManagerException("Http status code '%s'! Response was: '%s'.", statusCode, response.body()); } } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java index 8e6b43d..94f6423 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import java.io.File; import java.io.FileInputStream; @@ -16,9 +16,9 @@ public final class ZipUtils { private ZipUtils() {} - public static void zipDirectory(File directoryToZip, File destinationFile) throws GitPackManager { + public static void zipDirectory(File directoryToZip, File destinationFile) throws GitPackManagerException { if (!directoryToZip.exists()) - throw new GitPackManager("Directory '%s' does not exist!", directoryToZip); + throw new GitPackManagerException("Directory '%s' does not exist!", directoryToZip); try { final FileOutputStream fos = new FileOutputStream(destinationFile); @@ -29,13 +29,13 @@ public static void zipDirectory(File directoryToZip, File destinationFile) throw zos.close(); fos.close(); } catch (FileNotFoundException e) { - throw new GitPackManager("Failed to find file '%s'!", e, destinationFile); + throw new GitPackManagerException("Failed to find file '%s'!", e, destinationFile); } catch (IOException e) { - throw new GitPackManager("Failed to zip directory '%s' to file '%s'!", e, directoryToZip, destinationFile); + throw new GitPackManagerException("Failed to zip directory '%s' to file '%s'!", e, directoryToZip, destinationFile); } } - public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputStream) throws GitPackManager { + public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputStream) throws GitPackManagerException { if (!directoryToZip.isDirectory()) return; final File[] children = directoryToZip.listFiles(); @@ -45,7 +45,7 @@ public static void zipDirectory(File directoryToZip, ZipOutputStream zipOutputSt } } - private static void zipFile(File fileToZip, String filename, ZipOutputStream zipOutputStream) throws GitPackManager { + private static void zipFile(File fileToZip, String filename, ZipOutputStream zipOutputStream) throws GitPackManagerException { if (fileToZip.isHidden()) return; if (fileToZip.isDirectory()) { @@ -57,7 +57,7 @@ private static void zipFile(File fileToZip, String filename, ZipOutputStream zip zipOutputStream.putNextEntry(zipEntry); zipOutputStream.closeEntry(); } catch (IOException e) { - throw new GitPackManager("Failed to add directory '%s' to zip file!", e, filename); + throw new GitPackManagerException("Failed to add directory '%s' to zip file!", e, filename); } final File[] children = fileToZip.listFiles(); @@ -79,16 +79,16 @@ private static void zipFile(File fileToZip, String filename, ZipOutputStream zip zipOutputStream.write(bytes, 0, length); } } catch (IOException e) { - throw new GitPackManager("Failed to add file '%s' to zip file!", e, filename); + throw new GitPackManagerException("Failed to add file '%s' to zip file!", e, filename); } } - public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPackManager { + public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPackManagerException { final ZipInputStream zipInputStream; try { zipInputStream = new ZipInputStream(new FileInputStream(fileToUnzip)); } catch (FileNotFoundException e) { - throw new GitPackManager("Failed to find zip file '%s'!", e, fileToUnzip); + throw new GitPackManagerException("Failed to find zip file '%s'!", e, fileToUnzip); } final byte[] buffer = new byte[1024]; @@ -96,7 +96,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPa try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GitPackManager("Failed to get next entry in zip file '%s'!", e, fileToUnzip); + throw new GitPackManagerException("Failed to get next entry in zip file '%s'!", e, fileToUnzip); } while (zipEntry != null) { @@ -104,19 +104,19 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPa try { newFile = newFileFromZipEntry(destinationDir, zipEntry); } catch (IOException e) { - throw new GitPackManager("Failed to create file from zip entry '%s'!", e, zipEntry); + throw new GitPackManagerException("Failed to create file from zip entry '%s'!", e, zipEntry); } if (zipEntry.isDirectory()) { if (!newFile.isDirectory() && !newFile.mkdirs()) { - throw new GitPackManager("Failed to create directory '%s'!", newFile); + throw new GitPackManagerException("Failed to create directory '%s'!", newFile); } try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GitPackManager("Failed to get next entry in zip file '%'!", e, fileToUnzip); + throw new GitPackManagerException("Failed to get next entry in zip file '%'!", e, fileToUnzip); } continue; @@ -124,7 +124,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPa final File parent = newFile.getParentFile(); if (!parent.isDirectory() && !parent.mkdirs()) { - throw new GitPackManager("Failed to create directory '%s'", newFile); + throw new GitPackManagerException("Failed to create directory '%s'", newFile); } // Write file content @@ -134,15 +134,15 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPa fileOutputStream.write(buffer, 0, length); } } catch (FileNotFoundException e) { - throw new GitPackManager("Failed to find file!", e); + throw new GitPackManagerException("Failed to find file!", e); } catch (IOException e) { - throw new GitPackManager("Failed to write file content!", e); + throw new GitPackManagerException("Failed to write file content!", e); } try { zipEntry = zipInputStream.getNextEntry(); } catch (IOException e) { - throw new GitPackManager("Failed to get next entry in zip file '%'!", e, fileToUnzip); + throw new GitPackManagerException("Failed to get next entry in zip file '%'!", e, fileToUnzip); } } @@ -150,7 +150,7 @@ public static void unzipFile(File fileToUnzip, File destinationDir) throws GitPa zipInputStream.closeEntry(); zipInputStream.close(); } catch (IOException e) { - throw new GitPackManager("Failed to close zip file '%s'!", e, fileToUnzip); + throw new GitPackManagerException("Failed to close zip file '%s'!", e, fileToUnzip); } } diff --git a/common/src/main/resources/assets/github-resourcepack-manager/icon.png b/common/src/main/resources/assets/git-pack-manager/icon.png similarity index 100% rename from common/src/main/resources/assets/github-resourcepack-manager/icon.png rename to common/src/main/resources/assets/git-pack-manager/icon.png diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java index 27a507f..8d275e2 100644 --- a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java +++ b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java @@ -2,13 +2,13 @@ import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; public class GitPackManagerInitializer implements DedicatedServerModInitializer { @Override public void onInitializeServer() { - GithubResourcepackManager.initialize(); + GitPackManager.initialize(); ServerLifecycleEvents.SERVER_STARTING.register(ModdedPlatformMain::setServer); } diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java index dcbe320..de2387d 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java +++ b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java @@ -6,7 +6,7 @@ import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.server.ServerStartingEvent; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; @Mod( @@ -15,7 +15,7 @@ ) public class GitPackManagerInitializer { public GitPackManagerInitializer(IEventBus modEventBus, ModContainer modContainer) { - GithubResourcepackManager.initialize(); + GitPackManager.initialize(); NeoForge.EVENT_BUS.addListener(ServerStartingEvent.class, serverStartingEvent -> ModdedPlatformMain.setServer(serverStartingEvent.getServer())); } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index b0034b0..8ec05ee 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -4,7 +4,7 @@ import org.bukkit.OfflinePlayer; import org.bukkit.plugin.java.JavaPlugin; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.GithubResourcepackManager; +import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; @@ -38,7 +38,7 @@ public static final class GitPackManagerInitializer extends JavaPlugin { @Override public void onEnable() { PaperPlatformMain.setPlugin(this); - GithubResourcepackManager.initialize(); + GitPackManager.initialize(); } } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java index 4b6cd6c..f657ea1 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java @@ -6,7 +6,7 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; import java.lang.reflect.Field; @@ -39,7 +39,7 @@ public void setProperties(Map properties) { } @Override - public void reload() throws GitPackManager { + public void reload() throws GitPackManagerException { final DedicatedServerSettings settings = ((DedicatedServer) MinecraftServer.getServer()).settings; try { @@ -54,7 +54,7 @@ public void reload() throws GitPackManager { DedicatedServerProperties.fromFile((Path) sourceField.get(settings), MinecraftServer.getServer().options) ); } catch (NoSuchFieldException | IllegalAccessException e) { - throw new GitPackManager("Failed to reload 'server.properties' file!", e); + throw new GitPackManagerException("Failed to reload 'server.properties' file!", e); } } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 17938a1..62622a1 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -5,7 +5,7 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManager; +import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; @@ -44,7 +44,7 @@ public void setProperties(Map properties) { } @Override - public void reload() throws GitPackManager { + public void reload() throws GitPackManagerException { final DedicatedServerSettings propertiesLoader = ((DedicatedServerAccessor) ModdedPlatformMain.getServer()).getSettings(); final DedicatedServerSettingsAccessor propertiesLoaderAccess = (DedicatedServerSettingsAccessor) propertiesLoader; From d5bfff524a2cae48c3d3c18bd1feba1fe8307ed9 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 17:38:27 +0200 Subject: [PATCH 66/89] fix github actions --- .github/workflows/build_artifacts.yml | 7 +++---- .github/workflows/publish.yml | 9 +++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_artifacts.yml b/.github/workflows/build_artifacts.yml index 7b2ec64..b175ccc 100644 --- a/.github/workflows/build_artifacts.yml +++ b/.github/workflows/build_artifacts.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: true - name: Set up JDK 21 uses: actions/setup-java@v5 @@ -34,11 +36,8 @@ jobs: DISABLE_PROPERTIES_UPDATE: true VERSION_SUFFIX: ${{ env.short_commit_hash }} - - name: Delete common libs - run: rm -r ./common/build/libs - - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: Build Artifacts - path: ./*/build/libs/ + path: ./loader/*/*/build/libs/ diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0df3b3c..90f1b85 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + submodules: true - name: Set up JDK 21 uses: actions/setup-java@v5 @@ -31,21 +33,20 @@ jobs: env: IS_RELEASE: true DISABLE_PROPERTIES_UPDATE: true + VERSION_SUFFIX: "" - name: Upload to Modrinth run: ./gradlew modrinth env: IS_RELEASE: true DISABLE_PROPERTIES_UPDATE: true + VERSION_SUFFIX: "" MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} VERSION_NAME: ${{ github.event.release.name }} VERSION_IS_PRERELEASE: ${{ github.event.release.prerelease }} VERSION_CHANGELOG: ${{ github.event.release.body }} - - name: Delete common libs - run: rm -r ./common/build/libs - - name: Upload to GitHub uses: softprops/action-gh-release@v2 with: - files: ./*/build/libs/*.jar + files: ./loader/*/*/build/libs/*.jar From 17ca54adfbe3744f76299efabee162dccc5cc8ff Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Thu, 29 Jan 2026 18:47:27 +0200 Subject: [PATCH 67/89] possibly better icon? --- .../assets/git-pack-manager/icon.png | Bin 1761 -> 1831 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/common/src/main/resources/assets/git-pack-manager/icon.png b/common/src/main/resources/assets/git-pack-manager/icon.png index a6544fae6f35cbb6b9f002277050d34f8bfaeba3..dc3d1e706b027440ea212db8c489ab76a3ed6052 100644 GIT binary patch delta 1803 zcmV+m2lV*i4W|x}F@NDnL_t(|ob8>zZxlxq$LFvu8A4-;#(_j>@`Ex3iWEwk{0Hd( zp_D0Ul1qt6lb%Q*1nDS{(vgNTNGL^06Uq?VU5>&sCmH)vn7Pc&&Cb60_2#{u_mNKW z-p#I8`~AK*GjD&5?mm7pQ$n+xs=Wh3UBm#5BL--k)s&ULdVg?z>AT;qKSnlrb_NGS*%UB1WvMDJ8Hh_76UBcU#MksmUDVvf5!Gl1E z_#y35uua+ZKkeTj*`gId2G9pAR8-x*^Z}=2N^Y>722wXA7kUj4d!RLPz-hxW1BfZ} z!O{RiKEwcxlYdkS9x5AK5Yde`vwB@Y@knUu75LysA=Hg@l1VqX4M%{o9ip; z?}N8F_6@u*N~yUieNmojN-c8NOu=UYa~(=%Nty-d)2!yF7Ja9KwNY}=C16*Eu)n9& zZLpjM`oJp& zs&oOA25Yf!7TpBh09?f%ir_Y=2H+_EP=(i^)d58OWhm4N&AKrvFwz8w7Gp|1FTz1+0y_Zxffh zba+r~4B#_|K!;=lyxc!r`tFmnYpI(Rkcc+G^myhJUm2zlBP{ag#&`3-KcDp|l-+lL#4sC>Wz$0abj(;h>z3elCy`D{~k%A0x`QFv}-!9?p-?R~? z8K2I<5toQxe)fg2^s95dXD^=jtoQ%AuC@?!M0Ei^@$GiIg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4!kXzdAHsj`MMe;$@{04z}hEbYB- z$p{kE5T6261X!AtTQY(Mb4U&T)av@hxbydysN<5FfK(&&Ms4v+!#_agNZ``=zJC@I zNDuwiU`_nvvkQQSxa$-R1#6t>kq-URiQnNR9bZz%mxqvY(E%T}=eysNAgns~m^#HAA z7~Z^m2Dcu59X-w$gk%z`{h?JkA%C#RBKCSEkQtz*Z`0&vENsXOslqRXe@qkzt_e(~ zr*GRHkVyVQ&A?jQk7)vYn>a(v*ZSoqeq&e+(DIfl((Er^!|~ZgRD4YB2Vjf^&#hC0rG~T#;En`K2GapNGdGr&NOP%+c=B0e_!11M?&O6f)X^H* Date: Thu, 29 Jan 2026 18:49:51 +0200 Subject: [PATCH 68/89] use indexed color much smaller file. Hopefully things support it too --- .../resources/assets/git-pack-manager/icon.png | Bin 1831 -> 951 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/common/src/main/resources/assets/git-pack-manager/icon.png b/common/src/main/resources/assets/git-pack-manager/icon.png index dc3d1e706b027440ea212db8c489ab76a3ed6052..34dd007e8c6bdcdbb43041a7b109cd2748235509 100644 GIT binary patch delta 940 zcmV;d15^B`4z~x88Gi!+008vhk@)}s00DDSM?wIu&K&6g001peOjJbx003q=F|0B& zk5)U@Nfq8p7UNA9@KG4|R2lqL8fv~Ud%sJW0Dleep6foqdn-Jsq|yh>haKj^#}_K~fGvI{fOvt@1{elU zK;{dSCP0u+3Pj3^0GZMRI31ce_}u`R@&VicXxp~U1&G!c0ce-H06^^2wswN@Oh_nO zJ3)Ibpp<5T_J3+fD~*ESe!%TlT1O55N|PW2xbI=#gQEcsDFcDbat15~0RvEa0%12y z0I*XopkK<-0_S?D+;fEsA`R$CfaCV559paLZMk&-Yy&C-ynMPzYj7!m`_{hIb2G3D ziU8cXdcFbvrAZ(FfFmtRzG&+bCHWX2&!+(V zKpLQ2fVOxH(Byjx-H@^XLy-XWDWE*ylKcp;{_MIP0Dqs>1-$0E5AfQm1YjITC16he z%r$Rh1AoS)!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I zxgto51QDW?SQK8}PJybIgqZ?JROW?TC9n_d7b!^epFr-S(2(vSW&6Sj#acal` Date: Thu, 29 Jan 2026 18:53:01 +0200 Subject: [PATCH 69/89] fix icon --- .../resources/assets/git-pack-manager/icon.png | Bin 951 -> 941 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/common/src/main/resources/assets/git-pack-manager/icon.png b/common/src/main/resources/assets/git-pack-manager/icon.png index 34dd007e8c6bdcdbb43041a7b109cd2748235509..ad3c45832bee69bf3bde4e1e821eb085aa5ea0bd 100644 GIT binary patch delta 821 zcmV-51Iqlj2dxK?g?|%CL_t(|obB7&a)Tfc2H>i(F*xn}KW@jU0farWNH5qcGY0=J z3sF<2U%!p(s{{TU;CriffbX;LL6*u8upRcb6@GlCQVuxd4+0X;Q0f4$S0DiM8A=r( z$_E83Wkmo_sRCRM4II2RfT!$$27qxK$5H@meF1=RuNwfsn}5bpPY|970p+MCNUsHu zQZ0~P4Pm8H5Zw>VpDXPQ4nUMDK@6CeclZnbR`1KeKmtArE+ z&iI31k^gg6@G5r1fafz16zBisYhBkoAj&Tlp!w^%wgapn;F4b`Xbqrd;06GYkE{Vp z0GVGM0OlhA!*2o7fa?rY0l+ITZ9tVXAp$t^CkSA2EucUD1OVczp*9~`fuDQ`uoE6d z@kj$!27lln=;Ij+fB+PhBTvFxehYweA;1fa0WPjEzX{+pytl%9FGvCM->V#ldHB0g!;x8lRTL3jn}Ei&>;aTP3GgFW_k`^HS^)kNv1)*So8Dm=K6U6e+}@S>psAHD?F&A(g)0k9p=Kv7b^9DEq*0{c!AOe7zR&3<_nZ2 zK#)%gM9PW)nbHI}9hx}!-2j>L0o(v++qTUGh}IVYXqUPGK!5DiwswN@Oh_nOJ3)Ib zpp<5T_G(Bgje_8Q!0lIBM-Bi=lOP1R?_uAAqX7;n1A)wP1}p^u15kPbVK+(gU0% zzZ&2;EmZtq-mB0N0zMy4ke&aVu4$UmfFM6t0Q0A5x(_gsfKz^^;BEjn z0~Y{@e6R*e0@(cO05Tr{3VsVf1I{y01wgOBxB*qpgaEMScNCz=wSfQp9RUchhSq$r z0{46huzwIBhlm=)8Fkb}#&s@+#C5R?aS1|#4YA-X3N=hp(rpNLfhBsGb*gaB`Z z0RZwDKojR10AKQ@Bkjb19$+J*MB&|@*=KZJHh|}002ov JPDHLkV1k~yWFr6o From f5864e001925b0bf4cf73f0a5abd9d7c9c9bcf33 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 12:24:35 +0200 Subject: [PATCH 70/89] Update Loom to v1.15 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 2606326..ec41eee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ devauth_version = 1.2.2 ## Gradle plugins neoforged_moddev = 2.0.+ -fabric_loom = 1.14-SNAPSHOT +fabric_loom = 1.15-SNAPSHOT papermc_paperweight_userdev = 2.0.0-beta.19 jpenilla_run_task = 3.0.2 gradleup_shadow = 9.3.1 From 8b5e596db8bdee7bdd8a87d37780bda87b09ad32 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 12:25:11 +0200 Subject: [PATCH 71/89] Update dependency of monkeylib and meshlib, depend on adventure api --- common/build.gradle | 10 ++++++++-- common/gradle.properties | 6 +++++- gradle.properties | 4 ++-- loader/fabric/1.21.1/gradle.properties | 7 ++++++- loader/fabric/build.gradle | 9 +++++++++ loader/fabric/gradle.properties | 4 ++++ loader/neoforge/1.21.1/gradle.properties | 7 ++++++- loader/neoforge/build.gradle | 13 +++++++++++-- loader/neoforge/gradle.properties | 14 +++++++++----- modded/1.21.1/gradle.properties | 13 +++++++++---- modded/build.gradle | 18 ++++++++++++++---- modded/gradle.properties | 4 ++++ 12 files changed, 87 insertions(+), 22 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 3826cec..cb4d46f 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -13,8 +13,14 @@ repositories { } dependencies { - compileOnlyApi "top.offsetmonkey538.monkeylib538:monkeylib538-common:${rootProject.monkeylib538_version}+common" - compileOnlyApi "top.offsetmonkey538.meshlib:meshlib-common:${rootProject.meshlib_version}+common" + compileOnlyApi("top.offsetmonkey538.monkeylib538:monkeylib538-common:${rootProject.monkeylib538_version}+common") { + exclude(group: "net.kyori") + } + compileOnlyApi("top.offsetmonkey538.meshlib:meshlib-common:${rootProject.meshlib_version}+common") { + exclude(group: "net.kyori") + } + + compileOnlyApi "net.kyori:adventure-api:${project.adventure_api_version}" api "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" diff --git a/common/gradle.properties b/common/gradle.properties index e99725d..6d3b82c 100644 --- a/common/gradle.properties +++ b/common/gradle.properties @@ -1 +1,5 @@ -project_name = common +project_name = common + +# Dependencies +## Adventure +adventure_api_version = 4.26.1 \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ec41eee..31713e0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs = -Xmx6G org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-beta.2.1769533505281+9e950f8 +monkeylib538_version = 3.0.0-beta.2.1769852890443+b71b2ea # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1769614581048+a8207ac +meshlib_version = 2.0.0-alpha.0.1769854509567+5dd5dd9 # JGit jgit_version = 6.9.0.202403050737-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify diff --git a/loader/fabric/1.21.1/gradle.properties b/loader/fabric/1.21.1/gradle.properties index 95ee20f..4290be3 100644 --- a/loader/fabric/1.21.1/gradle.properties +++ b/loader/fabric/1.21.1/gradle.properties @@ -1,8 +1,13 @@ project_name = fabric-1.21.1 commonModdedVersion = 1.21.1 -monkeylib538_suffix = 1.21 +# Dependencies +## MonkeyLib538 +monkeylib538_suffix = 1.21.1 +## MESH-Lib meshlib_suffix = 1.21.1 +## Adventure +adventure_version = 5.14.2 # Minecraft version minecraft_version = 1.21.1 diff --git a/loader/fabric/build.gradle b/loader/fabric/build.gradle index 48c1a77..36cab7b 100644 --- a/loader/fabric/build.gradle +++ b/loader/fabric/build.gradle @@ -17,6 +17,7 @@ allprojects { mixin("git-pack-manager.modded.mixins.json") depends("fabric-api", "*") + depends("adventure-platform-fabric", "*") depends("monkeylib538", ">=${rootProject.monkeylib538_version}") depends("meshlib", ">=${rootProject.meshlib_version}") } @@ -29,11 +30,16 @@ allprojects { modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-fabric:${rootProject.monkeylib538_version}+fabric") { exclude(group: "net.fabricmc.fabric-api") + exclude(group: "net.kyori") } modCompileOnly("top.offsetmonkey538.meshlib:meshlib-fabric:${rootProject.meshlib_version}+fabric") { exclude(group: "net.fabricmc.fabric-api") + exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } + modImplementation("net.kyori:adventure-platform-fabric:${project.adventure_version}") { + exclude(group: "net.fabricmc.fabric-api") + } } } @@ -41,9 +47,11 @@ subprojects { dependencies { modImplementation("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+fabric+${project.monkeylib538_suffix}") { exclude(group: "net.fabricmc.fabric-api") + exclude(group: "net.kyori") } modImplementation("top.offsetmonkey538.meshlib:meshlib-fabric-${project.meshlib_suffix}:${rootProject.meshlib_version}+fabric+${project.meshlib_suffix}") { exclude(group: "net.fabricmc.fabric-api") + exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } @@ -53,6 +61,7 @@ subprojects { modrinth { dependencies { required.project "fabric-api" + required.project "adventure-platform-mod" required.project "monkeylib538" required.project "mesh-lib" } diff --git a/loader/fabric/gradle.properties b/loader/fabric/gradle.properties index ed59ba3..6cc5e81 100644 --- a/loader/fabric/gradle.properties +++ b/loader/fabric/gradle.properties @@ -1,5 +1,9 @@ project_name = fabric +# Dependencies +## Adventure +adventure_version = 6.8.0 + # Minecraft version minecraft_version = 1.21.11 supported_minecraft_versions = * diff --git a/loader/neoforge/1.21.1/gradle.properties b/loader/neoforge/1.21.1/gradle.properties index e85cce2..03aa91d 100644 --- a/loader/neoforge/1.21.1/gradle.properties +++ b/loader/neoforge/1.21.1/gradle.properties @@ -1,8 +1,13 @@ project_name = neoforge-1.21.1 commonModdedVersion = 1.21.1 -monkeylib538_suffix = 1.21 +# Dependencies +## MonkeyLib538 +monkeylib538_suffix = 1.21.1 +## MESH-Lib meshlib_suffix = 1.21.1 +## Adventure +adventure_version = 6.0.1 # Minecraft version minecraft_version = 1.21.1 diff --git a/loader/neoforge/build.gradle b/loader/neoforge/build.gradle index f475807..a79d65e 100644 --- a/loader/neoforge/build.gradle +++ b/loader/neoforge/build.gradle @@ -10,6 +10,7 @@ allprojects { mod(rootProject.neo_mod_id) { authors = "OffsetMonkey538" dependencies { + required("adventure_platform_neoforge") required("monkeylib538", "[${rootProject.monkeylib538_version},)") required("meshlib", "[${rootProject.meshlib_version},)") } @@ -18,10 +19,14 @@ allprojects { } dependencies { - compileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}+neoforge" + compileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}+neoforge") { + exclude(group: "net.kyori") + } compileOnly("top.offsetmonkey538.meshlib:meshlib-neoforge:${rootProject.meshlib_version}+neoforge") { + exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } + implementation "net.kyori:adventure-platform-neoforge:${project.adventure_version}" } } @@ -30,8 +35,11 @@ subprojects { outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) dependencies { - implementation "top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+neoforge+${project.monkeylib538_suffix}" + implementation("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+neoforge+${project.monkeylib538_suffix}") { + exclude(group: "net.kyori") + } implementation ("top.offsetmonkey538.meshlib:meshlib-neoforge-${project.meshlib_suffix}:${rootProject.meshlib_version}+neoforge+${project.meshlib_suffix}") { + exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } @@ -40,6 +48,7 @@ subprojects { modrinth { dependencies { + required.project "adventure-platform-mod" required.project "monkeylib538" required.project "mesh-lib" } diff --git a/loader/neoforge/gradle.properties b/loader/neoforge/gradle.properties index 0881a7e..6a8b468 100644 --- a/loader/neoforge/gradle.properties +++ b/loader/neoforge/gradle.properties @@ -1,8 +1,12 @@ -project_name = neoforge +project_name = neoforge + +# Dependencies +## Adventure +adventure_version = 6.8.0 # Minecraft version -minecraft_version = 1.21.11 +minecraft_version = 1.21.11 -neoforge_version = 21.11.37-beta -parchment_minecraft_version = 1.21.11 -parchment_mappings_version = 2025.12.20 +neoforge_version = 21.11.37-beta +parchment_minecraft_version = 1.21.11 +parchment_mappings_version = 2025.12.20 diff --git a/modded/1.21.1/gradle.properties b/modded/1.21.1/gradle.properties index 2b5e007..e778756 100644 --- a/modded/1.21.1/gradle.properties +++ b/modded/1.21.1/gradle.properties @@ -1,7 +1,12 @@ -project_name = modded-1.21.1 +project_name = modded-1.21.1 -monkeylib538_suffix = 1.21 -meshlib_suffix = 1.21.1 +# Dependencies +## MonkeyLib538 +monkeylib538_suffix = 1.21.1 +## MESH-Lib +meshlib_suffix = 1.21.1 +## Adventure +adventure_version = 6.0.1 # Minecraft version -minecraft_version = 1.21.1 +minecraft_version = 1.21.1 diff --git a/modded/build.gradle b/modded/build.gradle index 5708434..14a9fc2 100644 --- a/modded/build.gradle +++ b/modded/build.gradle @@ -4,14 +4,24 @@ plugins { allprojects { dependencies { - modCompileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-modded:${rootProject.monkeylib538_version}+modded" - modCompileOnly "top.offsetmonkey538.meshlib:meshlib-modded:${rootProject.meshlib_version}+modded" + modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-modded:${rootProject.monkeylib538_version}+modded") { + exclude(group: "net.kyori") + } + modCompileOnly("top.offsetmonkey538.meshlib:meshlib-modded:${rootProject.meshlib_version}+modded") { + exclude(group: "net.kyori") + exclude(group: "top.offsetmonkey538.monkeylib538") + } } } subprojects { dependencies { - modCompileOnly "top.offsetmonkey538.monkeylib538:monkeylib538-modded-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+modded+${project.monkeylib538_suffix}" - modCompileOnly "top.offsetmonkey538.meshlib:meshlib-modded-${project.meshlib_suffix}:${rootProject.meshlib_version}+modded+${project.meshlib_suffix}" + modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-modded-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+modded+${project.monkeylib538_suffix}") { + exclude(group: "net.kyori") + } + modCompileOnly("top.offsetmonkey538.meshlib:meshlib-modded-${project.meshlib_suffix}:${rootProject.meshlib_version}+modded+${project.meshlib_suffix}") { + exclude(group: "net.kyori") + exclude(group: "top.offsetmonkey538.monkeylib538") + } } } diff --git a/modded/gradle.properties b/modded/gradle.properties index 1df7c91..e6ea150 100644 --- a/modded/gradle.properties +++ b/modded/gradle.properties @@ -1,4 +1,8 @@ project_name = modded +# Dependencies +## Adventure +adventure_version = 6.8.0 + # Minecraft version minecraft_version = 1.21.11 From 7acd283dafade9b77350dfc887a01f6cc75522f2 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 12:45:35 +0200 Subject: [PATCH 72/89] Replace usages of monkeylib text wrapper with adventure api --- .../gitpackmanager/GitPackManager.java | 42 ++++++++++--------- .../command/GitPackManagerCommand.java | 20 ++++----- .../gitpackmanager/platform/PlatformMain.java | 4 +- .../gitpackmanager/platform/PlatformText.java | 4 +- .../paper/platform/PaperPlatformMain.java | 23 +++------- .../paper/platform/PaperPlatformText.java | 23 +++------- .../modded/platform/ModdedPlatformMain.java | 8 ++-- .../modded/platform/ModdedPlatformText.java | 10 ++--- 8 files changed, 56 insertions(+), 78 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java index a3fd866..ca11a09 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java @@ -1,6 +1,10 @@ package top.offsetmonkey538.gitpackmanager; import com.google.common.util.concurrent.ThreadFactoryBuilder; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.format.TextColor; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.jspecify.annotations.Nullable; @@ -22,9 +26,6 @@ import top.offsetmonkey538.monkeylib538.common.api.lifecycle.ServerLifecycleApi; import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; import top.offsetmonkey538.monkeylib538.common.api.telemetry.TelemetryRegistry; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibStyle; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.common.api.text.TextFormattingApi; import top.offsetmonkey538.offsetutils538.api.config.ConfigHolder; import top.offsetmonkey538.offsetutils538.api.config.ConfigManager; import top.offsetmonkey538.offsetutils538.api.log.OffsetLogger; @@ -68,12 +69,13 @@ private GitPackManager() { private static final Executor EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(MOD_ID + "-%d").build()); - private static final List MESSAGE_QUEUE = new ArrayList<>(); + private static final List MESSAGE_QUEUE = new ArrayList<>(); - private static final MonkeyLibText MESSAGE_QUEUE_EMPTY_MESSAGE; + private static final Component MESSAGE_QUEUE_EMPTY_MESSAGE; static { try { - MESSAGE_QUEUE_EMPTY_MESSAGE = TextFormattingApi.styleText("Admin message queue can be emptied using the &{hoverText,'Click to run','&{runCommand,'/gh-rp-manager reset-admin-message-queue','[/gh-rp-manager reset-admin-message-queue]'}'} command."); + MESSAGE_QUEUE_EMPTY_MESSAGE = Component.text("TODO"); + // TODO: Use MiniMessage: MESSAGE_QUEUE_EMPTY_MESSAGE = TextFormattingApi.styleText("Admin message queue can be emptied using the &{hoverText,'Click to run','&{runCommand,'/gh-rp-manager reset-admin-message-queue','[/gh-rp-manager reset-admin-message-queue]'}'} command."); } catch (Exception e) { throw new RuntimeException(e); } @@ -92,9 +94,9 @@ public static void initialize() { ServerLifecycleApi.STARTED.listen(() -> { addLogToAdminListeners(); LoaderUtil.sendMessagesToAdminsOnJoin(() -> { - if (MESSAGE_QUEUE.isEmpty()) return new MonkeyLibText[]{}; + if (MESSAGE_QUEUE.isEmpty()) return new Component[]{}; - final MonkeyLibText[] result = new MonkeyLibText[MESSAGE_QUEUE.size() + 1]; + final Component[] result = new Component[MESSAGE_QUEUE.size() + 1]; MESSAGE_QUEUE.toArray(result); result[result.length - 1] = MESSAGE_QUEUE_EMPTY_MESSAGE; return result; @@ -130,17 +132,16 @@ MOD_ID, new HttpRouter( } private static void addLogToAdminListeners() { - LOGGER.addListener(OffsetLogger.LogLevel.ERROR, createLogToAdminListener(MonkeyLibStyle.Color.RED)); - LOGGER.addListener(OffsetLogger.LogLevel.WARN, createLogToAdminListener(MonkeyLibStyle.Color.YELLOW)); + LOGGER.addListener(OffsetLogger.LogLevel.ERROR, createLogToAdminListener(NamedTextColor.RED)); + LOGGER.addListener(OffsetLogger.LogLevel.WARN, createLogToAdminListener(NamedTextColor.YELLOW)); } - private static OffsetLogger.LogListener createLogToAdminListener(final int textColor) { + private static OffsetLogger.LogListener createLogToAdminListener(final TextColor textColor) { return (message, error) -> { - final MonkeyLibText text = MonkeyLibText - .of(replaceArgs("[%s] %s", MOD_ID, message)) - .applyStyle(style -> style.withColor(textColor)); - - if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); + final Component text = Component + .text(replaceArgs("[%s] %s", MOD_ID, message)) + .style(style -> style.color(textColor)) + .style(error == null ? style -> {} : style -> style.hoverEvent(HoverEvent.showText(Component.text(ExceptionUtils.getRootCauseMessage(error))))); PlatformMain.INSTANCE.sendMessageToAdmins(text); MESSAGE_QUEUE.addLast(text); @@ -336,18 +337,19 @@ private static void sendUpdateMessage(final String[] updateMessage, boolean wasU return; } - for (final MonkeyLibText line : createUpdateMessage(updateMessage, placeholders)) + for (final Component line : createUpdateMessage(updateMessage, placeholders)) PlatformText.INSTANCE.sendUpdateMessage(line, adminsOnly); } - public static MonkeyLibText[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GitPackManagerException { - final MonkeyLibText[] result = new MonkeyLibText[updateMessage.length]; + public static Component[] createUpdateMessage(final String[] updateMessage, final Map placeholders) throws GitPackManagerException { + final Component[] result = new Component[updateMessage.length]; for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { final String line = StringUtils.replacePlaceholders(updateMessage[lineIndex], placeholders, true, false).replace("\\n", "\n"); try { - result[lineIndex] = TextFormattingApi.styleText(line); + result[lineIndex] = Component.text("TODO (UNFORMATTED): " + line); + // TODO: use MiniMessage: result[lineIndex] = TextFormattingApi.styleText(line); } catch (Exception e) { throw new GitPackManagerException("Failed to style update message at line %s!", e, lineIndex); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index a3c1957..2545503 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -2,6 +2,9 @@ import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.event.HoverEvent; +import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang3.exception.ExceptionUtils; import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; @@ -9,8 +12,6 @@ import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi; import top.offsetmonkey538.monkeylib538.common.api.command.CommandRegistrationApi; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibStyle; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; import top.offsetmonkey538.offsetutils538.api.log.OffsetLogger; import java.util.Map; @@ -79,14 +80,13 @@ private static LiteralArgumentBuilder createCommand() { private static void runTriggerUpdate(CommandContext context, boolean force) { final OffsetLogger.LogListener infoListener = (message, error) -> { - sendText(context, MonkeyLibText.of(replaceArgs("[%s] %s", MOD_ID, message)).applyStyle(style -> style.withColor(MonkeyLibStyle.Color.GRAY))); + sendText(context, Component.text(replaceArgs("[%s] %s", MOD_ID, message)).style(style -> style.color(NamedTextColor.GRAY))); }; final OffsetLogger.LogListener warnListener = (message, error) -> { - final MonkeyLibText text = MonkeyLibText - .of(replaceArgs("[%s] %s", MOD_ID, message)) - .applyStyle(style -> style.withColor(MonkeyLibStyle.Color.YELLOW)); - - if (error != null) text.applyStyle(style -> style.withShowText(MonkeyLibText.of(ExceptionUtils.getRootCauseMessage(error)))); + final Component text = Component + .text(replaceArgs("[%s] %s", MOD_ID, message)) + .style(style -> style.color(NamedTextColor.YELLOW)) + .style(error == null ? style -> {} : style -> style.hoverEvent(HoverEvent.showText(Component.text(ExceptionUtils.getRootCauseMessage(error))))); sendText(context, text); }; @@ -110,7 +110,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean } final Map placeholders = generatePlaceholders(gitHandler, isResource ? resourcePackHandler : null, UpdateType.COMMAND, isResource ? "resource" : "data", true); - final MonkeyLibText[] text; + final Component[] text; try { text = createUpdateMessage(isResource ? config.get().resourcePackProvider.updateMessage : config.get().dataPackProvider.updateMessage, placeholders); } catch (GitPackManagerException e) { @@ -120,7 +120,7 @@ private static int runTestUpdateMessage(CommandContext context, boolean return 0; } - for (final MonkeyLibText line : text) CommandAbstractionApi.sendText(context, line); + for (final Component line : text) CommandAbstractionApi.sendText(context, line); return 1; } } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java index 1c493c8..d413405 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java @@ -1,6 +1,6 @@ package top.offsetmonkey538.gitpackmanager.platform; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import net.kyori.adventure.text.Component; import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; @@ -19,5 +19,5 @@ public interface PlatformMain { * * @param message the message to send */ - void sendMessageToAdmins(final MonkeyLibText message); + void sendMessageToAdmins(final Component message); } diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java index 16a1634..4f1f1be 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java @@ -1,11 +1,11 @@ package top.offsetmonkey538.gitpackmanager.platform; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; +import net.kyori.adventure.text.Component; import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; public interface PlatformText { PlatformText INSTANCE = load(PlatformText.class); - void sendUpdateMessage(final MonkeyLibText updateMessage, boolean adminsOnly); + void sendUpdateMessage(final Component updateMessage, boolean adminsOnly); } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index 8ec05ee..229bd3e 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -1,45 +1,32 @@ package top.offsetmonkey538.gitpackmanager.paper.platform; +import net.kyori.adventure.text.Component; import net.minecraft.server.MinecraftServer; +import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.plugin.java.JavaPlugin; -import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.GitPackManager; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; public class PaperPlatformMain implements PlatformMain { - private static @Nullable GitPackManagerInitializer plugin = null; - @Override public void refreshDatapacks() { MinecraftServer.getServer().getPackRepository().reload(); } @Override - public void sendMessageToAdmins(MonkeyLibText message) { - for (final OfflinePlayer operator : getPlugin().getServer().getOperators()) { + public void sendMessageToAdmins(Component message) { + for (final OfflinePlayer operator : Bukkit.getServer().getOperators()) { if (operator.getPlayer() == null) continue; - operator.getPlayer().sendMessage(PaperMonkeyLibText.of(message).getText()); + operator.getPlayer().sendMessage(message); } } - private static void setPlugin(GitPackManagerInitializer plugin) { - PaperPlatformMain.plugin = plugin; - } - - public static @Nullable GitPackManagerInitializer getPlugin() { - return plugin; - } - public static final class GitPackManagerInitializer extends JavaPlugin { @Override public void onEnable() { - PaperPlatformMain.setPlugin(this); GitPackManager.initialize(); } } - } diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java index 3112465..bc6d690 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java @@ -3,28 +3,17 @@ import net.kyori.adventure.text.Component; import org.bukkit.Bukkit; import org.bukkit.entity.Player; +import org.bukkit.permissions.ServerOperator; import top.offsetmonkey538.gitpackmanager.platform.PlatformText; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; -import top.offsetmonkey538.monkeylib538.paper.api.text.PaperMonkeyLibText; -import java.util.Collection; +import java.util.stream.Stream; public class PaperPlatformText implements PlatformText { @Override - public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { - final Collection players = Bukkit.getOnlinePlayers(); - if (!adminsOnly) { - sendToAll(players, PaperMonkeyLibText.of(updateMessage).getText()); - return; - } + public void sendUpdateMessage(Component updateMessage, boolean adminsOnly) { + Stream playerStream = Bukkit.getOnlinePlayers().stream(); + if (adminsOnly) playerStream = playerStream.filter(ServerOperator::isOp); - for (final Player player : players) { - if (!player.isOp()) continue; - player.sendMessage(PaperMonkeyLibText.of(updateMessage).getText()); - } - } - - private static void sendToAll(Collection players, Component component) { - for (Player player : players) player.sendMessage(component); + playerStream.forEach(player -> player.sendMessage(updateMessage)); } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java index 2badd92..42a0c1f 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java @@ -1,12 +1,12 @@ package top.offsetmonkey538.gitpackmanager.modded.platform; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.text.Component; import net.minecraft.server.MinecraftServer; import net.minecraft.world.entity.player.Player; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; -import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; public class ModdedPlatformMain implements PlatformMain { private static @Nullable MinecraftServer minecraftServer = null; @@ -20,11 +20,11 @@ public static void setServer(MinecraftServer server) { } @Override - public void sendMessageToAdmins(MonkeyLibText message) { + public void sendMessageToAdmins(Component message) { if (getServer() == null) return; for (final Player player : getServer().getPlayerList().getPlayers()) { if (!ModdedPlayerApi.isPlayerOp(getServer().getPlayerList(), player)) continue; - player.displayClientMessage(ModdedMonkeyLibText.of(message).getText(), false); + ((Audience) player).sendMessage(message); } } diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java index 6e5ad47..4931d60 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java @@ -1,26 +1,26 @@ package top.offsetmonkey538.gitpackmanager.modded.platform; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.text.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; import top.offsetmonkey538.gitpackmanager.platform.PlatformText; -import top.offsetmonkey538.monkeylib538.common.api.text.MonkeyLibText; import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; -import top.offsetmonkey538.monkeylib538.modded.api.text.ModdedMonkeyLibText; public class ModdedPlatformText implements PlatformText { @Override - public void sendUpdateMessage(MonkeyLibText updateMessage, boolean adminsOnly) { + public void sendUpdateMessage(Component updateMessage, boolean adminsOnly) { assert ModdedPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; final PlayerList playerList = ModdedPlatformMain.getServer().getPlayerList(); if (!adminsOnly) { - playerList.broadcastSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); + ((Audience) ModdedPlatformMain.getServer()).sendMessage(updateMessage); return; } for (final ServerPlayer player : playerList.getPlayers()) { if (!ModdedPlayerApi.isPlayerOp(playerList, player)) continue; - player.sendSystemMessage(ModdedMonkeyLibText.of(updateMessage).getText(), false); + ((Audience) player).sendMessage(updateMessage); } } } From 03320854f023d65765fc4f98c2f1d0b07b217edc Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 18:13:06 +0200 Subject: [PATCH 73/89] Use minimessage for formatting update message, add datafixer for update message --- common/build.gradle | 1 + .../gitpackmanager/GitPackManager.java | 21 ++------- .../gitpackmanager/config/ModConfig.java | 46 ++++++++++++++++--- gradle.properties | 2 +- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index cb4d46f..125c23e 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -21,6 +21,7 @@ dependencies { } compileOnlyApi "net.kyori:adventure-api:${project.adventure_api_version}" + compileOnlyApi "net.kyori:adventure-text-minimessage:${project.adventure_api_version}" api "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java index ca11a09..f1c34d9 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java @@ -5,6 +5,7 @@ import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; import net.kyori.adventure.text.format.TextColor; +import net.kyori.adventure.text.minimessage.MiniMessage; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.jspecify.annotations.Nullable; @@ -65,21 +66,11 @@ private GitPackManager() { public static final Pattern RESOURCEPACK_NAME_PATTERN = Pattern.compile("\\d+-"); public static final UUID RESOURCEPACK_UUID = UUID.fromString("60ab8dc7-08d1-4f5f-a9a8-9a01d048b7b9"); - public static final Map STATIC_PLACEHOLDERS = Map.of("{packUpdateCommand}", "/git-pack-manager request-pack"); - private static final Executor EXECUTOR = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(MOD_ID + "-%d").build()); private static final List MESSAGE_QUEUE = new ArrayList<>(); - private static final Component MESSAGE_QUEUE_EMPTY_MESSAGE; - static { - try { - MESSAGE_QUEUE_EMPTY_MESSAGE = Component.text("TODO"); - // TODO: Use MiniMessage: MESSAGE_QUEUE_EMPTY_MESSAGE = TextFormattingApi.styleText("Admin message queue can be emptied using the &{hoverText,'Click to run','&{runCommand,'/gh-rp-manager reset-admin-message-queue','[/gh-rp-manager reset-admin-message-queue]'}'} command."); - } catch (Exception e) { - throw new RuntimeException(e); - } - } + private static final Component MESSAGE_QUEUE_EMPTY_MESSAGE = MiniMessage.miniMessage().deserialize(replaceArgs("Admin message queue can be emptied using the [/%s reset-admin-message-queue] command.", MOD_ID, MOD_ID));; public static ConfigHolder config = ConfigHolder.create(ModConfig::new, LOGGER); @@ -347,12 +338,7 @@ public static Component[] createUpdateMessage(final String[] updateMessage, fina for (int lineIndex = 0; lineIndex < updateMessage.length; lineIndex++) { final String line = StringUtils.replacePlaceholders(updateMessage[lineIndex], placeholders, true, false).replace("\\n", "\n"); - try { - result[lineIndex] = Component.text("TODO (UNFORMATTED): " + line); - // TODO: use MiniMessage: result[lineIndex] = TextFormattingApi.styleText(line); - } catch (Exception e) { - throw new GitPackManagerException("Failed to style update message at line %s!", e, lineIndex); - } + result[lineIndex] = MiniMessage.miniMessage().deserialize(line); } return result; @@ -363,7 +349,6 @@ public static Map generatePlaceholders(final GitHandler gitHandl if (gitHandler.getCommitProperties() != null) placeholders.putAll(gitHandler.getCommitProperties().toPlaceholdersMap()); if (resourcePackHandler != null) placeholders.put("{downloadUrl}", config.get().getPackUrl(Objects.requireNonNull(resourcePackHandler.getOutputPackName()))); - placeholders.putAll(STATIC_PLACEHOLDERS); placeholders.put("{packType}", packType); placeholders.put("{updateType}", updateType.name()); placeholders.put("{wasUpdated}", String.valueOf(wasUpdated)); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java index 71856da..652897d 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java @@ -6,6 +6,7 @@ import blue.endless.jankson.JsonNull; import blue.endless.jankson.JsonObject; import blue.endless.jankson.api.Marshaller; +import net.kyori.adventure.text.minimessage.MiniMessage; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.utils.StringUtils; @@ -14,6 +15,7 @@ import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import top.offsetmonkey538.meshlib.common.api.rule.rules.PathHttpRule; import top.offsetmonkey538.monkeylib538.common.api.platform.LoaderUtil; +import top.offsetmonkey538.monkeylib538.common.api.text.TextFormattingApi; import top.offsetmonkey538.offsetutils538.api.config.Config; import top.offsetmonkey538.offsetutils538.api.config.Datafixer; @@ -30,7 +32,7 @@ import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; -public class ModConfig implements Config { +public final class ModConfig implements Config { @Comment("!!!! Please check the wiki for how to set up the mod. It should be available here: https://git-pack-manager.docs.offsetmonkey538.top and is also linked on the Modrinth page. !!!!") public ServerInfo serverInfo = new ServerInfo(); @@ -72,8 +74,8 @@ public static class ResourcePackProvider { @Comment("Messages sent in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") public @Nullable String[] updateMessage = new String[] { - "&{hoverText,'{longDescription}','Server resource pack has been updated!'}", - "&{hoverText,'{longDescription}','Please click &{hoverText,'Click to update pack','&{runCommand,'{packUpdateCommand}','[HERE]'}'} to get the most up to date pack.'}" + "Server resource pack has been updated!", + "Please click [HERE] to get the most up to date pack." }; @Comment("Webhook to be sent when pack updating succeeded") @@ -99,9 +101,9 @@ public static class DataPackProvider { public String rootLocation = "/datapacks"; @Comment("Messages sent TO ADMINS in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") public String[] updateMessage = new String[] { - "&{hoverText,'{longDescription}','Server datapacks have been updated!'}", - "&{hoverText,'{longDescription}','New packs (if any) will need to be enabled with the &{hoverText,'Click to suggest','&{suggestCommand,'/datapack enable','&n/datapack enable'}'} command.'}", - "&{hoverText,'{longDescription}','Please run &{hoverText,'Click to suggest','&{suggestCommand,'/reload','&n/reload'}'} or restart the server to reload datapacks.'}" + "Server datapacks have been updated!", + "New packs (if any) will need to be enabled with the /datapack enable command.", + "Please run /reload or restart the server to reload datapacks." }; @Comment("Webhook to be sent when pack updating succeeded") @@ -227,7 +229,14 @@ public Datafixer[] getDatafixers() { }, (original, jankson) -> { // 4 -> 5 - original.remove("proxyPort"); + final JsonObject serverInfo = original.getObject("serverInfo"); + serverInfo.remove("proxyPort"); + original.put("serverInfo", serverInfo); + + final Marshaller marsh = jankson.getMarshaller(); + + original.put("resourcePackProvider", datafix4to5UpdateMessage((JsonObject) original.get("resourcePackProvider"), marsh)); + original.put("dataPackProvider", datafix4to5UpdateMessage((JsonObject) original.get("dataPackProvider"), marsh)); } }; } @@ -277,6 +286,29 @@ private static JsonObject datafix3to4UpdateMessage(final JsonObject originalJson return originalJson; } + private static JsonObject datafix4to5UpdateMessage(final JsonObject originalJson, final Marshaller marsh) { + final JsonArray updateMessageJson = ((JsonArray) originalJson.get("updateMessage")); + if (updateMessageJson == null) { + originalJson.put("updateMessage", JsonNull.INSTANCE); + return originalJson; + } + + final String[] updateMessage = new String[updateMessageJson.size()]; + + for (int i = 0; i < updateMessage.length; i++) { + try { + //noinspection deprecation + updateMessage[i] = MiniMessage.miniMessage().serialize(TextFormattingApi.styleText(updateMessageJson.getString(i, "").replace("{packUpdateCommand}", "/git-pack-manager request-pack"))); + } catch (Exception e) { + LOGGER.error("Failed to migrate update message at line %s!", e, i); + } + } + + originalJson.put("updateMessage", new JsonArray(updateMessage, marsh)); + + return originalJson; + } + @Override public int getConfigVersion() { return 5; diff --git a/gradle.properties b/gradle.properties index 31713e0..5def10e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx6G org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-beta.2.1769852890443+b71b2ea +monkeylib538_version = 3.0.0-beta.2.1769866963916+local # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1769854509567+5dd5dd9 # JGit From 6c6102dc35515a807072d47475f49611eb031dd6 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 18:13:50 +0200 Subject: [PATCH 74/89] Fix update message only sent to console --- .../gitpackmanager/modded/platform/ModdedPlatformText.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java index 4931d60..9e1eb94 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java @@ -13,13 +13,8 @@ public void sendUpdateMessage(Component updateMessage, boolean adminsOnly) { assert ModdedPlatformMain.getServer() != null : "Literally HOW?? Why are we trying to send the update message when the server hasn't started yet!??!?!?"; final PlayerList playerList = ModdedPlatformMain.getServer().getPlayerList(); - if (!adminsOnly) { - ((Audience) ModdedPlatformMain.getServer()).sendMessage(updateMessage); - return; - } - for (final ServerPlayer player : playerList.getPlayers()) { - if (!ModdedPlayerApi.isPlayerOp(playerList, player)) continue; + if (adminsOnly && !ModdedPlayerApi.isPlayerOp(playerList, player)) continue; ((Audience) player).sendMessage(updateMessage); } } From c8617455ae49d7a5999d587e10a317952ac4105b Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 18:14:13 +0200 Subject: [PATCH 75/89] Fix commands not registered early enough, use correct name for commands --- .../gitpackmanager/GitPackManager.java | 14 +++++++------- .../command/GitPackManagerCommand.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java index f1c34d9..8299f28 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java @@ -81,6 +81,13 @@ private GitPackManager() { public static void initialize() { TelemetryRegistry.register(MOD_ID); + GitPackManagerCommand.register(); + ConfigCommandApi.registerConfigCommand( + config, + () -> disabled = ConfigHandler.handleConfig(), + MOD_ID, "config" + ); + // Have to run all this stuff (definitely initializing config at least) after other mods have initialized. Namely, after MESH-Lib has its rule serialization stuff to the jankson event ServerLifecycleApi.STARTED.listen(() -> { addLogToAdminListeners(); @@ -96,13 +103,6 @@ public static void initialize() { // config should be initialized after the error listeners ConfigManager.init(config); - GitPackManagerCommand.register(); - ConfigCommandApi.registerConfigCommand( - config, - () -> disabled = ConfigHandler.handleConfig(), - "gh-rp-manager", "config" - ); - disabled = ConfigHandler.handleConfig(); try { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java index 2545503..96133ed 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java @@ -38,7 +38,7 @@ public static void register() { } private static LiteralArgumentBuilder createCommand() { - return literal("gh-rp-manager") + return literal(MOD_ID) .then(literal("request-pack") .requires(CommandAbstractionApi::executedByPlayer) .executes(PlatformCommand.INSTANCE::executeRequestPackCommand) From 5927fa3ea760c00bd2c508f6a7d15e29a4b1f380 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 19:14:46 +0200 Subject: [PATCH 76/89] fix paper initializer --- loader/paper/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loader/paper/build.gradle b/loader/paper/build.gradle index 2a56145..08bb15b 100644 --- a/loader/paper/build.gradle +++ b/loader/paper/build.gradle @@ -10,7 +10,7 @@ allprojects { outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) paperPluginYaml { - main = "top.offsetmonkey538.gitpackmanager.paper.platform.PlatformUtilImpl\$GitPackManagerInitializer" + main = "top.offsetmonkey538.gitpackmanager.paper.platform.PaperPlatformMain\$GitPackManagerInitializer" authors.add("OffsetMonkey538") load = "STARTUP" dependencies { From 3e3ff615a221ed8939239b301663452b9511f2bd Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 19:14:53 +0200 Subject: [PATCH 77/89] update monkeylib --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5def10e..9d41124 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx6G org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-beta.2.1769866963916+local +monkeylib538_version = 3.0.0-beta.2.1769878629004+8fcac1b # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1769854509567+5dd5dd9 # JGit From 2b6b8f95e9e5df7c545bf3d6442d4a9ff7661134 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 19:34:09 +0200 Subject: [PATCH 78/89] Update buildSrc --- buildSrc | 2 +- loader/paper/build.gradle | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/buildSrc b/buildSrc index 97cb1b2..31a2373 160000 --- a/buildSrc +++ b/buildSrc @@ -1 +1 @@ -Subproject commit 97cb1b28a0265d9fe6f90497a46bf86b01119687 +Subproject commit 31a2373f007a4ef7aaaabdcf4d28fd283ef42175 diff --git a/loader/paper/build.gradle b/loader/paper/build.gradle index 08bb15b..fcfd37d 100644 --- a/loader/paper/build.gradle +++ b/loader/paper/build.gradle @@ -29,7 +29,9 @@ allprojects { subprojects { dependencies { - implementation "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" // TODO: does jgit need trasitive = false? + include implementation("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}") { + transitive = false + } } tasks.runServer { From 268d31b0674fb7d1f9e4c16e325a954c1abe6264 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 19:34:35 +0200 Subject: [PATCH 79/89] Update monkeylib, meshlib --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9d41124..38e6f1f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs = -Xmx6G org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-beta.2.1769878629004+8fcac1b +monkeylib538_version = 3.0.0-beta.2.1769880528759+b61667d # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1769854509567+5dd5dd9 +meshlib_version = 2.0.0-alpha.0.1769880665236+1a435fc # JGit jgit_version = 6.9.0.202403050737-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify From 1021752c442a2dab4588a3c0326feb05f562260a Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 19:36:04 +0200 Subject: [PATCH 80/89] Move common code into common package --- .../{ => common}/GitPackManager.java | 26 +++++++++---------- .../command/GitPackManagerCommand.java | 26 +++++++++---------- .../common/command/package-info.java | 4 +++ .../{ => common}/config/ConfigHandler.java | 18 ++++++------- .../{ => common}/config/ModConfig.java | 18 ++++++------- .../common/config/package-info.java | 4 +++ .../config/webhook/BasicWebhook.java | 2 +- .../config/webhook/DefaultWebhookBody.java | 5 ++++ .../discord/basic/BasicFailMessage.java | 4 +-- .../discord/basic/BasicSuccessMessage.java | 4 +-- .../webhook/discord/basic/package-info.java | 4 +++ .../discord/embed/EmbedFailMessage.java | 4 +-- .../discord/embed/EmbedSuccessMessage.java | 4 +-- .../webhook/discord/embed/package-info.java | 4 +++ .../common/config/webhook/package-info.java | 4 +++ .../exception/GitPackManagerException.java | 2 +- .../common/exception/package-info.java | 4 +++ .../{ => common}/git/CommitProperties.java | 2 +- .../{command => common/git}/package-info.java | 2 +- .../{ => common}/handler/DataPackHandler.java | 12 ++++----- .../{ => common}/handler/GitHandler.java | 12 ++++----- .../handler/ResourcePackHandler.java | 18 ++++++------- .../common/handler/package-info.java | 4 +++ .../networking/MainHttpHandler.java | 6 ++--- .../common/networking/package-info.java | 4 +++ .../{ => common}/package-info.java | 2 +- .../platform/PlatformCommand.java | 4 +-- .../{ => common}/platform/PlatformMain.java | 4 +-- .../platform/PlatformServerProperties.java | 14 +++++----- .../{ => common}/platform/PlatformText.java | 4 +-- .../{ => common}/platform/ServiceLoader.java | 4 +-- .../common/platform/package-info.java | 4 +++ .../{ => common}/utils/MyFileUtils.java | 4 +-- .../{ => common}/utils/StringUtils.java | 8 +++--- .../{ => common}/utils/WebhookSender.java | 6 ++--- .../{ => common}/utils/ZipUtils.java | 4 +-- .../common/utils/package-info.java | 4 +++ .../gitpackmanager/config/package-info.java | 4 --- .../config/webhook/DefaultWebhookBody.java | 5 ---- .../webhook/discord/basic/package-info.java | 4 --- .../webhook/discord/embed/package-info.java | 4 --- .../config/webhook/package-info.java | 4 --- .../exception/package-info.java | 4 --- .../gitpackmanager/git/package-info.java | 4 --- .../gitpackmanager/handler/package-info.java | 4 --- .../networking/package-info.java | 4 --- .../gitpackmanager/platform/package-info.java | 4 --- .../gitpackmanager/utils/package-info.java | 4 --- .../fabric/GitPackManagerInitializer.java | 2 +- .../neoforge/GitPackManagerInitializer.java | 2 +- .../paper/platform/PaperPlatformCommand.java | 2 +- .../paper/platform/PaperPlatformMain.java | 4 +-- .../PaperPlatformServerProperties.java | 4 +-- .../paper/platform/PaperPlatformText.java | 2 +- ...ckmanager.common.platform.PlatformCommand} | 0 ...ackmanager.common.platform.PlatformLogging | 1 + ...tpackmanager.common.platform.PlatformMain} | 0 ....common.platform.PlatformServerProperties} | 0 ...tpackmanager.common.platform.PlatformText} | 0 ...38.gitpackmanager.platform.PlatformLogging | 1 - .../platform/ModdedPlatformCommand.java | 2 +- .../modded/platform/ModdedPlatformMain.java | 2 +- .../ModdedPlatformServerProperties.java | 4 +-- .../modded/platform/ModdedPlatformText.java | 2 +- ...ckmanager.common.platform.PlatformCommand} | 0 ...tpackmanager.common.platform.PlatformMain} | 0 ....common.platform.PlatformServerProperties} | 0 ...tpackmanager.common.platform.PlatformText} | 0 68 files changed, 166 insertions(+), 166 deletions(-) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/GitPackManager.java (94%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/command/GitPackManagerCommand.java (84%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/ConfigHandler.java (85%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/ModConfig.java (96%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/webhook/BasicWebhook.java (91%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/DefaultWebhookBody.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/webhook/discord/basic/BasicFailMessage.java (73%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/webhook/discord/basic/BasicSuccessMessage.java (76%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/webhook/discord/embed/EmbedFailMessage.java (78%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/config/webhook/discord/embed/EmbedSuccessMessage.java (85%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/package-info.java create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/exception/GitPackManagerException.java (94%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/git/CommitProperties.java (94%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{command => common/git}/package-info.java (50%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/handler/DataPackHandler.java (93%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/handler/GitHandler.java (94%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/handler/ResourcePackHandler.java (92%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/networking/MainHttpHandler.java (89%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/package-info.java (52%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/platform/PlatformCommand.java (68%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/platform/PlatformMain.java (78%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/platform/PlatformServerProperties.java (77%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/platform/PlatformText.java (59%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/platform/ServiceLoader.java (74%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/package-info.java rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/utils/MyFileUtils.java (84%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/utils/StringUtils.java (88%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/utils/WebhookSender.java (87%) rename common/src/main/java/top/offsetmonkey538/gitpackmanager/{ => common}/utils/ZipUtils.java (97%) create mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java delete mode 100644 common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java rename loader/paper/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformCommand => top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand} (100%) create mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformLogging rename loader/paper/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformMain => top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain} (100%) rename loader/paper/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties => top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties} (100%) rename loader/paper/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformText => top.offsetmonkey538.gitpackmanager.common.platform.PlatformText} (100%) delete mode 100644 loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging rename modded/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformCommand => top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand} (100%) rename modded/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformMain => top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain} (100%) rename modded/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties => top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties} (100%) rename modded/src/main/resources/META-INF/services/{top.offsetmonkey538.gitpackmanager.platform.PlatformText => top.offsetmonkey538.gitpackmanager.common.platform.PlatformText} (100%) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java index 8299f28..c262af9 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager; +package top.offsetmonkey538.gitpackmanager.common; import com.google.common.util.concurrent.ThreadFactoryBuilder; import net.kyori.adventure.text.Component; @@ -9,18 +9,18 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.command.GitPackManagerCommand; -import top.offsetmonkey538.gitpackmanager.config.ConfigHandler; -import top.offsetmonkey538.gitpackmanager.config.ModConfig; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.handler.DataPackHandler; -import top.offsetmonkey538.gitpackmanager.handler.GitHandler; -import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; -import top.offsetmonkey538.gitpackmanager.networking.MainHttpHandler; -import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; -import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; -import top.offsetmonkey538.gitpackmanager.platform.PlatformText; -import top.offsetmonkey538.gitpackmanager.utils.StringUtils; +import top.offsetmonkey538.gitpackmanager.common.command.GitPackManagerCommand; +import top.offsetmonkey538.gitpackmanager.common.config.ConfigHandler; +import top.offsetmonkey538.gitpackmanager.common.config.ModConfig; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.handler.DataPackHandler; +import top.offsetmonkey538.gitpackmanager.common.handler.GitHandler; +import top.offsetmonkey538.gitpackmanager.common.handler.ResourcePackHandler; +import top.offsetmonkey538.gitpackmanager.common.networking.MainHttpHandler; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformText; +import top.offsetmonkey538.gitpackmanager.common.utils.StringUtils; import top.offsetmonkey538.meshlib.common.api.router.HttpRouter; import top.offsetmonkey538.meshlib.common.api.router.HttpRouterRegistry; import top.offsetmonkey538.monkeylib538.common.api.command.ConfigCommandApi; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/GitPackManagerCommand.java similarity index 84% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/GitPackManagerCommand.java index 96133ed..1608e4d 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/GitPackManagerCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/GitPackManagerCommand.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.command; +package top.offsetmonkey538.gitpackmanager.common.command; import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.context.CommandContext; @@ -6,10 +6,10 @@ import net.kyori.adventure.text.event.HoverEvent; import net.kyori.adventure.text.format.NamedTextColor; import org.apache.commons.lang3.exception.ExceptionUtils; -import top.offsetmonkey538.gitpackmanager.GitPackManager; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.handler.GitHandler; -import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.handler.GitHandler; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi; import top.offsetmonkey538.monkeylib538.common.api.command.CommandRegistrationApi; import top.offsetmonkey538.offsetutils538.api.log.OffsetLogger; @@ -19,14 +19,14 @@ import static com.mojang.brigadier.arguments.BoolArgumentType.bool; import static com.mojang.brigadier.arguments.BoolArgumentType.getBool; import static com.mojang.brigadier.builder.RequiredArgumentBuilder.argument; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.MOD_ID; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.UpdateType; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.clearAdminMessageQueue; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.createUpdateMessage; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.generatePlaceholders; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.resourcePackHandler; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.clearAdminMessageQueue; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.createUpdateMessage; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.generatePlaceholders; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.resourcePackHandler; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.literal; import static top.offsetmonkey538.monkeylib538.common.api.command.CommandAbstractionApi.sendText; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/package-info.java new file mode 100644 index 0000000..8f9d289 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/command/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.command; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ConfigHandler.java similarity index 85% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ConfigHandler.java index 55dd2af..acc40c5 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ConfigHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ConfigHandler.java @@ -1,13 +1,13 @@ -package top.offsetmonkey538.gitpackmanager.config; +package top.offsetmonkey538.gitpackmanager.common.config; import blue.endless.jankson.Jankson; import blue.endless.jankson.JsonGrammar; -import top.offsetmonkey538.gitpackmanager.config.webhook.BasicWebhook; -import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; -import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicFailMessage; -import top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic.BasicSuccessMessage; -import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedFailMessage; -import top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed.EmbedSuccessMessage; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.BasicWebhook; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.basic.BasicFailMessage; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.basic.BasicSuccessMessage; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.embed.EmbedFailMessage; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.embed.EmbedSuccessMessage; import top.offsetmonkey538.meshlib.common.api.MESHLibApi; import java.io.IOException; @@ -16,8 +16,8 @@ import java.util.ArrayList; import java.util.List; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public final class ConfigHandler { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java similarity index 96% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java index 652897d..80a7621 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.config; +package top.offsetmonkey538.gitpackmanager.common.config; import blue.endless.jankson.Comment; import blue.endless.jankson.JsonArray; @@ -8,9 +8,9 @@ import blue.endless.jankson.api.Marshaller; import net.kyori.adventure.text.minimessage.MiniMessage; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.utils.StringUtils; -import top.offsetmonkey538.gitpackmanager.utils.WebhookSender; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.utils.StringUtils; +import top.offsetmonkey538.gitpackmanager.common.utils.WebhookSender; import top.offsetmonkey538.meshlib.common.api.MESHLibApi; import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import top.offsetmonkey538.meshlib.common.api.rule.rules.PathHttpRule; @@ -25,11 +25,11 @@ import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.GIT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.MOD_ID; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.UpdateType; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.MOD_ID; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.UpdateType; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public final class ModConfig implements Config { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/package-info.java new file mode 100644 index 0000000..5a5adef --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.config; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/BasicWebhook.java similarity index 91% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/BasicWebhook.java index f5f0bd3..7e7ec94 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/BasicWebhook.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/BasicWebhook.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook; +package top.offsetmonkey538.gitpackmanager.common.config.webhook; public final class BasicWebhook implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/DefaultWebhookBody.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/DefaultWebhookBody.java new file mode 100644 index 0000000..6c7d270 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/DefaultWebhookBody.java @@ -0,0 +1,5 @@ +package top.offsetmonkey538.gitpackmanager.common.config.webhook; + +public interface DefaultWebhookBody { + String getName(); +} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicFailMessage.java similarity index 73% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicFailMessage.java index 292fd7f..4888d0d 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicFailMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.basic; -import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.DefaultWebhookBody; public final class BasicFailMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicSuccessMessage.java similarity index 76% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicSuccessMessage.java index 0471431..3874e95 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/BasicSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/BasicSuccessMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.basic; -import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.DefaultWebhookBody; public final class BasicSuccessMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/package-info.java new file mode 100644 index 0000000..22548e1 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/basic/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.basic; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedFailMessage.java similarity index 78% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedFailMessage.java index f599363..01d76b8 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedFailMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedFailMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.embed; -import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.DefaultWebhookBody; public final class EmbedFailMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedSuccessMessage.java similarity index 85% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedSuccessMessage.java index 2661256..513150e 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/EmbedSuccessMessage.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/EmbedSuccessMessage.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.embed; -import top.offsetmonkey538.gitpackmanager.config.webhook.DefaultWebhookBody; +import top.offsetmonkey538.gitpackmanager.common.config.webhook.DefaultWebhookBody; public final class EmbedSuccessMessage implements DefaultWebhookBody { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/package-info.java new file mode 100644 index 0000000..31e32f8 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/discord/embed/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.config.webhook.discord.embed; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/package-info.java new file mode 100644 index 0000000..a10350d --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/webhook/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.config.webhook; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/GitPackManagerException.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/GitPackManagerException.java index 6994dc5..9739a47 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/GitPackManagerException.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/GitPackManagerException.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.exception; +package top.offsetmonkey538.gitpackmanager.common.exception; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/package-info.java new file mode 100644 index 0000000..77ccfac --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/exception/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.exception; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/CommitProperties.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/CommitProperties.java index e609967..a5ba93b 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/CommitProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/CommitProperties.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.git; +package top.offsetmonkey538.gitpackmanager.common.git; import java.util.Map; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/package-info.java similarity index 50% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/package-info.java index b59d12c..c432f81 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/command/package-info.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/git/package-info.java @@ -1,4 +1,4 @@ @NullMarked -package top.offsetmonkey538.gitpackmanager.command; +package top.offsetmonkey538.gitpackmanager.common.git; import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/DataPackHandler.java similarity index 93% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/DataPackHandler.java index 45038b1..0673803 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/DataPackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/DataPackHandler.java @@ -1,10 +1,10 @@ -package top.offsetmonkey538.gitpackmanager.handler; +package top.offsetmonkey538.gitpackmanager.common.handler; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import org.apache.commons.io.file.PathUtils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; import java.io.IOException; import java.nio.file.Files; @@ -13,9 +13,9 @@ import java.util.List; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.DATAPACK_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.DATAPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class DataPackHandler { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/GitHandler.java similarity index 94% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/GitHandler.java index 6a4be61..476d2a6 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/GitHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/GitHandler.java @@ -1,4 +1,4 @@ -package top.offsetmonkey538.gitpackmanager.handler; +package top.offsetmonkey538.gitpackmanager.common.handler; import org.apache.commons.io.file.PathUtils; import org.eclipse.jgit.api.Git; @@ -17,16 +17,16 @@ import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider; import org.eclipse.jgit.treewalk.CanonicalTreeParser; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.git.CommitProperties; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.git.CommitProperties; import java.io.IOException; import java.util.List; import java.util.Optional; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.GIT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.GIT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; import static top.offsetmonkey538.offsetutils538.api.text.ArgReplacer.replaceArgs; public class GitHandler { diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/ResourcePackHandler.java similarity index 92% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/ResourcePackHandler.java index a01fa27..f55ca27 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/ResourcePackHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/ResourcePackHandler.java @@ -1,12 +1,12 @@ -package top.offsetmonkey538.gitpackmanager.handler; +package top.offsetmonkey538.gitpackmanager.common.handler; import org.apache.commons.io.FileUtils; import org.apache.commons.io.filefilter.HiddenFileFilter; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.utils.MyFileUtils; -import top.offsetmonkey538.gitpackmanager.utils.StringUtils; -import top.offsetmonkey538.gitpackmanager.utils.ZipUtils; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.utils.MyFileUtils; +import top.offsetmonkey538.gitpackmanager.common.utils.StringUtils; +import top.offsetmonkey538.gitpackmanager.common.utils.ZipUtils; import java.io.File; import java.io.IOException; @@ -18,10 +18,10 @@ import java.util.Random; import java.util.stream.Stream; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_OUTPUT_FOLDER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.RESOURCEPACK_FOLDER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.RESOURCEPACK_OUTPUT_FOLDER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; public class ResourcePackHandler { private @Nullable Path outputPackPath = null; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/package-info.java new file mode 100644 index 0000000..e72aaaf --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/handler/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.handler; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/MainHttpHandler.java similarity index 89% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/MainHttpHandler.java index 0c5b213..48507d1 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/MainHttpHandler.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/MainHttpHandler.java @@ -1,10 +1,10 @@ -package top.offsetmonkey538.gitpackmanager.networking; +package top.offsetmonkey538.gitpackmanager.common.networking; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; -import top.offsetmonkey538.gitpackmanager.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; import top.offsetmonkey538.meshlib.common.api.handler.HttpHandler; import top.offsetmonkey538.meshlib.common.api.rule.HttpRule; import top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil; @@ -13,7 +13,7 @@ import static io.netty.handler.codec.http.HttpResponseStatus.NOT_FOUND; import static io.netty.handler.codec.http.HttpResponseStatus.OK; import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.resourcePackHandler; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.resourcePackHandler; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendError; import static top.offsetmonkey538.meshlib.common.api.util.HttpResponseUtil.sendFile; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/package-info.java new file mode 100644 index 0000000..4ee40e5 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/networking/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.networking; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/package-info.java similarity index 52% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/package-info.java index ac869ae..e27cbc4 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/package-info.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/package-info.java @@ -1,4 +1,4 @@ @NullMarked -package top.offsetmonkey538.gitpackmanager; +package top.offsetmonkey538.gitpackmanager.common; import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformCommand.java similarity index 68% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformCommand.java index ccb2669..95288ae 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformCommand.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformCommand.java @@ -1,9 +1,9 @@ -package top.offsetmonkey538.gitpackmanager.platform; +package top.offsetmonkey538.gitpackmanager.common.platform; import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; -import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.common.platform.ServiceLoader.load; public interface PlatformCommand { PlatformCommand INSTANCE = load(PlatformCommand.class); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java similarity index 78% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java index d413405..bb0f263 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java @@ -1,8 +1,8 @@ -package top.offsetmonkey538.gitpackmanager.platform; +package top.offsetmonkey538.gitpackmanager.common.platform; import net.kyori.adventure.text.Component; -import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.common.platform.ServiceLoader.load; public interface PlatformMain { PlatformMain INSTANCE = load(PlatformMain.class); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformServerProperties.java similarity index 77% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformServerProperties.java index 52d8b8d..beb0e15 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformServerProperties.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformServerProperties.java @@ -1,18 +1,18 @@ -package top.offsetmonkey538.gitpackmanager.platform; +package top.offsetmonkey538.gitpackmanager.common.platform; import com.google.common.hash.Hashing; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.handler.ResourcePackHandler; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.handler.ResourcePackHandler; import java.io.IOException; import java.nio.file.Path; import java.util.Map; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_UUID; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.config; -import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.RESOURCEPACK_UUID; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.config; +import static top.offsetmonkey538.gitpackmanager.common.platform.ServiceLoader.load; public interface PlatformServerProperties { PlatformServerProperties INSTANCE = load(PlatformServerProperties.class); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformText.java similarity index 59% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformText.java index 4f1f1be..f737359 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/PlatformText.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformText.java @@ -1,8 +1,8 @@ -package top.offsetmonkey538.gitpackmanager.platform; +package top.offsetmonkey538.gitpackmanager.common.platform; import net.kyori.adventure.text.Component; -import static top.offsetmonkey538.gitpackmanager.platform.ServiceLoader.load; +import static top.offsetmonkey538.gitpackmanager.common.platform.ServiceLoader.load; public interface PlatformText { PlatformText INSTANCE = load(PlatformText.class); diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/ServiceLoader.java similarity index 74% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/ServiceLoader.java index 1fe939a..3e74404 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/ServiceLoader.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/ServiceLoader.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.platform; +package top.offsetmonkey538.gitpackmanager.common.platform; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; public final class ServiceLoader { private ServiceLoader() {} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/package-info.java new file mode 100644 index 0000000..4a65497 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.platform; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/MyFileUtils.java similarity index 84% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/MyFileUtils.java index 37429c5..0dfa809 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/MyFileUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/MyFileUtils.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.utils; +package top.offsetmonkey538.gitpackmanager.common.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; import java.io.File; import java.io.IOException; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/StringUtils.java similarity index 88% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/StringUtils.java index 5d5fbec..fbf4ba4 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/StringUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/StringUtils.java @@ -1,13 +1,13 @@ -package top.offsetmonkey538.gitpackmanager.utils; +package top.offsetmonkey538.gitpackmanager.common.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; import java.io.File; import java.util.Map; import java.util.regex.Matcher; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.LOGGER; -import static top.offsetmonkey538.gitpackmanager.GitPackManager.RESOURCEPACK_NAME_PATTERN; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.RESOURCEPACK_NAME_PATTERN; public final class StringUtils { private StringUtils() {} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/WebhookSender.java similarity index 87% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/WebhookSender.java index 88abab7..39f9916 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/WebhookSender.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/WebhookSender.java @@ -1,7 +1,7 @@ -package top.offsetmonkey538.gitpackmanager.utils; +package top.offsetmonkey538.gitpackmanager.common.utils; -import top.offsetmonkey538.gitpackmanager.GitPackManager; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; import java.io.IOException; import java.net.URI; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/ZipUtils.java similarity index 97% rename from common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java rename to common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/ZipUtils.java index 94f6423..775c622 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/ZipUtils.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/ZipUtils.java @@ -1,6 +1,6 @@ -package top.offsetmonkey538.gitpackmanager.utils; +package top.offsetmonkey538.gitpackmanager.common.utils; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; import java.io.File; import java.io.FileInputStream; diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/package-info.java new file mode 100644 index 0000000..29a1246 --- /dev/null +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/utils/package-info.java @@ -0,0 +1,4 @@ +@NullMarked +package top.offsetmonkey538.gitpackmanager.common.utils; + +import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java deleted file mode 100644 index 865e9b3..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.config; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java deleted file mode 100644 index 75b35b3..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/DefaultWebhookBody.java +++ /dev/null @@ -1,5 +0,0 @@ -package top.offsetmonkey538.gitpackmanager.config.webhook; - -public interface DefaultWebhookBody { - String getName(); -} diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java deleted file mode 100644 index 3d56a65..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/basic/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.basic; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java deleted file mode 100644 index 0598cf2..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/discord/embed/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.config.webhook.discord.embed; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java deleted file mode 100644 index fdaf6b6..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/config/webhook/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.config.webhook; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java deleted file mode 100644 index c22642b..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/exception/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.exception; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java deleted file mode 100644 index b37f066..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/git/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.git; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java deleted file mode 100644 index fbd0862..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/handler/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.handler; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java deleted file mode 100644 index e3ae1f4..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/networking/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.networking; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java deleted file mode 100644 index 79d27b0..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/platform/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.platform; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java deleted file mode 100644 index 02f6101..0000000 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/utils/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -@NullMarked -package top.offsetmonkey538.gitpackmanager.utils; - -import org.jspecify.annotations.NullMarked; \ No newline at end of file diff --git a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java index 8d275e2..b059d46 100644 --- a/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java +++ b/loader/fabric/src/main/java/top/offsetmonkey538/gitpackmanager/fabric/GitPackManagerInitializer.java @@ -2,7 +2,7 @@ import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; -import top.offsetmonkey538.gitpackmanager.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; public class GitPackManagerInitializer implements DedicatedServerModInitializer { diff --git a/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java index de2387d..6160655 100644 --- a/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java +++ b/loader/neoforge/src/main/java/top/offsetmonkey538/gitpackmanager/neoforge/GitPackManagerInitializer.java @@ -6,7 +6,7 @@ import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.server.ServerStartingEvent; -import top.offsetmonkey538.gitpackmanager.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; import top.offsetmonkey538.gitpackmanager.modded.platform.ModdedPlatformMain; @Mod( diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java index 86b6942..18fec2c 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformCommand.java @@ -8,7 +8,7 @@ import net.kyori.adventure.resource.ResourcePackRequest; import net.minecraft.server.MinecraftServer; import org.bukkit.entity.Player; -import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.paper.api.command.PaperCommandAbstractionApi; import java.net.URI; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index 229bd3e..b88c5fb 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -5,8 +5,8 @@ import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.plugin.java.JavaPlugin; -import top.offsetmonkey538.gitpackmanager.GitPackManager; -import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; +import top.offsetmonkey538.gitpackmanager.common.GitPackManager; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain; public class PaperPlatformMain implements PlatformMain { @Override diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java index f657ea1..a50fe7a 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformServerProperties.java @@ -6,8 +6,8 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; -import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; import java.lang.reflect.Field; import java.nio.file.Path; diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java index bc6d690..96aaa42 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformText.java @@ -4,7 +4,7 @@ import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.permissions.ServerOperator; -import top.offsetmonkey538.gitpackmanager.platform.PlatformText; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformText; import java.util.stream.Stream; diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand similarity index 100% rename from loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformLogging b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformLogging new file mode 100644 index 0000000..70a1690 --- /dev/null +++ b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformLogging @@ -0,0 +1 @@ +top.offsetmonkey538.gitpackmanager.common.platform.paper.PaperPlatformLogging \ No newline at end of file diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain similarity index 100% rename from loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties similarity index 100% rename from loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformText similarity index 100% rename from loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText rename to loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformText diff --git a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging b/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging deleted file mode 100644 index b465428..0000000 --- a/loader/paper/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformLogging +++ /dev/null @@ -1 +0,0 @@ -top.offsetmonkey538.gitpackmanager.platform.paper.PaperPlatformLogging \ No newline at end of file diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java index 497a1a5..16e8cea 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java @@ -7,7 +7,7 @@ import net.minecraft.network.protocol.common.ClientboundResourcePackPushPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; -import top.offsetmonkey538.gitpackmanager.platform.PlatformCommand; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand; import top.offsetmonkey538.monkeylib538.modded.api.command.ModdedCommandAbstractionApi; import java.util.Optional; diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java index 42a0c1f..8dd12da 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java @@ -5,7 +5,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.entity.player.Player; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.platform.PlatformMain; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; public class ModdedPlatformMain implements PlatformMain { diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index 62622a1..d813248 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -5,11 +5,11 @@ import net.minecraft.server.dedicated.DedicatedServerSettings; import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; -import top.offsetmonkey538.gitpackmanager.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; -import top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; import java.nio.file.Path; import java.util.Map; diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java index 9e1eb94..254ddb9 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformText.java @@ -4,7 +4,7 @@ import net.kyori.adventure.text.Component; import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.players.PlayerList; -import top.offsetmonkey538.gitpackmanager.platform.PlatformText; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformText; import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; public class ModdedPlatformText implements PlatformText { diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand similarity index 100% rename from modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformCommand rename to modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformCommand diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain similarity index 100% rename from modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformMain rename to modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties similarity index 100% rename from modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformServerProperties rename to modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties diff --git a/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText b/modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformText similarity index 100% rename from modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.platform.PlatformText rename to modded/src/main/resources/META-INF/services/top.offsetmonkey538.gitpackmanager.common.platform.PlatformText From 587cdef027aa93cfdc872bcd33288b3a8c6c99bd Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 31 Jan 2026 20:02:16 +0200 Subject: [PATCH 81/89] Update jgit --- common/build.gradle | 4 +++- gradle.properties | 2 +- loader/neoforge/build.gradle | 4 +++- .../modded/platform/ModdedPlatformServerProperties.java | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 125c23e..390915c 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -23,7 +23,9 @@ dependencies { compileOnlyApi "net.kyori:adventure-api:${project.adventure_api_version}" compileOnlyApi "net.kyori:adventure-text-minimessage:${project.adventure_api_version}" - api "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" + api("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}") { + transitive = false + } // should be bundled with minecraft compileOnly "com.mojang:brigadier:${rootProject.brigadier_version}" diff --git a/gradle.properties b/gradle.properties index 38e6f1f..5aad5a1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ monkeylib538_version = 3.0.0-beta.2.1769880528759+b61667d # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib meshlib_version = 2.0.0-alpha.0.1769880665236+1a435fc # JGit -jgit_version = 6.9.0.202403050737-r +jgit_version = 7.5.0.202512021534-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify jspecify_version = 1.0.0 ## Bundeled with Minecraft, common needs to use diff --git a/loader/neoforge/build.gradle b/loader/neoforge/build.gradle index a79d65e..6530555 100644 --- a/loader/neoforge/build.gradle +++ b/loader/neoforge/build.gradle @@ -43,7 +43,9 @@ subprojects { exclude(group: "top.offsetmonkey538.monkeylib538") } - includeRuntime "org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}" + includeRuntime("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}") { + transitive = false + } } modrinth { diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java index d813248..7d3f62d 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformServerProperties.java @@ -6,10 +6,10 @@ import net.minecraft.world.level.storage.LevelResource; import org.jspecify.annotations.Nullable; import top.offsetmonkey538.gitpackmanager.common.exception.GitPackManagerException; +import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.DedicatedServerSettingsAccessor; import top.offsetmonkey538.gitpackmanager.modded.mixin.SettingsAccessor; -import top.offsetmonkey538.gitpackmanager.common.platform.PlatformServerProperties; import java.nio.file.Path; import java.util.Map; From f096a0d09869060e702998b7da66dc4ace8a17dd Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Mon, 2 Feb 2026 13:05:39 +0200 Subject: [PATCH 82/89] Update ModConfig.java --- .../offsetmonkey538/gitpackmanager/common/config/ModConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java index 80a7621..dfd59dc 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java @@ -42,7 +42,7 @@ public final class ModConfig implements Config { public static class ServerInfo { - @Comment("The MESH Lib rule to use for routing to the Git Pack Manager http handler. See MESH Lib docs: https://mesh-lib.docs.offsetmonkey538.top/WHATEVER/PAGE/WILL/TELL/YOU/HOW/TO/USE/RULES") // TODO: real link once meshlib has docs + @Comment("The MESH Lib rule to use for routing to the Git Pack Manager http handler. See MESH Lib docs: https://mesh-lib.docs.offsetmonkey538.top/reference/rules/") public HttpRule routingRule = new PathHttpRule(MOD_ID); @Comment("The public ip of your server. (\"123.45.67.89\" or \"play.coolserver.net\")") public @Nullable String publicIp = null; From de5064b6d5ca55521953ee464d25f79a9f3a9be0 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Wed, 4 Feb 2026 16:47:24 +0200 Subject: [PATCH 83/89] Automatically reload datapacks after update --- .../gitpackmanager/common/GitPackManager.java | 3 ++- .../gitpackmanager/common/config/ModConfig.java | 4 +++- .../gitpackmanager/common/platform/PlatformMain.java | 5 +++++ .../paper/platform/PaperPlatformMain.java | 10 ++++++++++ .../modded/platform/ModdedPlatformMain.java | 10 ++++++++++ 5 files changed, 30 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java index c262af9..9442377 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/GitPackManager.java @@ -70,7 +70,7 @@ private GitPackManager() { private static final List MESSAGE_QUEUE = new ArrayList<>(); - private static final Component MESSAGE_QUEUE_EMPTY_MESSAGE = MiniMessage.miniMessage().deserialize(replaceArgs("Admin message queue can be emptied using the [/%s reset-admin-message-queue] command.", MOD_ID, MOD_ID));; + private static final Component MESSAGE_QUEUE_EMPTY_MESSAGE = MiniMessage.miniMessage().deserialize(replaceArgs("Admin message queue can be emptied using the [/%s reset-admin-message-queue] command.", MOD_ID, MOD_ID)); public static ConfigHolder config = ConfigHolder.create(ModConfig::new, LOGGER); @@ -293,6 +293,7 @@ private static void updateDataPack(final GitHandler gitHandler, final UpdateType // Refresh datapack list PlatformMain.INSTANCE.refreshDatapacks(); + if (config.get().dataPackProvider.autoReload) PlatformMain.INSTANCE.reloadEnabledDatapacks(); // Generate placeholder map diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java index dfd59dc..33ef00c 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java @@ -97,13 +97,15 @@ public Path getPackPacksDir() { public static class DataPackProvider { @Comment("Whether or not the data pack provider is enabled. Default: false") public boolean enabled = false; + @Comment("Automatically reloads enabled datapacks after an update. May be desirable to disable with mods that break reload functionality. Default: true") + public boolean autoReload = true; @Comment("Where the mod will search for data packs in the cloned repository. MUST NOT be same as or child of the 'rootLocation' of the resourcepack provider") public String rootLocation = "/datapacks"; @Comment("Messages sent TO ADMINS in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") public String[] updateMessage = new String[] { "Server datapacks have been updated!", "New packs (if any) will need to be enabled with the /datapack enable command.", - "Please run /reload or restart the server to reload datapacks." + "If 'autoReload' isn't enabled in the config and datapacks weren't automatically reloaded, please run /reload or restart the server to reload datapacks." }; @Comment("Webhook to be sent when pack updating succeeded") diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java index bb0f263..ac35c93 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/platform/PlatformMain.java @@ -14,6 +14,11 @@ public interface PlatformMain { */ void refreshDatapacks(); + /** + * Reload all enabled datapacks + */ + void reloadEnabledDatapacks(); + /** * Sends provided message to currently online admins * diff --git a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java index b88c5fb..62d7f82 100644 --- a/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java +++ b/loader/paper/src/main/java/top/offsetmonkey538/gitpackmanager/paper/platform/PaperPlatformMain.java @@ -8,12 +8,22 @@ import top.offsetmonkey538.gitpackmanager.common.GitPackManager; import top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; + public class PaperPlatformMain implements PlatformMain { @Override public void refreshDatapacks() { MinecraftServer.getServer().getPackRepository().reload(); } + @Override + public void reloadEnabledDatapacks() { + MinecraftServer.getServer().reloadResources(MinecraftServer.getServer().getPackRepository().getSelectedIds()).exceptionally(throwable -> { + LOGGER.warn("Failed to execute reload! Keeping old data.", throwable); + return null; + }); + } + @Override public void sendMessageToAdmins(Component message) { for (final OfflinePlayer operator : Bukkit.getServer().getOperators()) { diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java index 8dd12da..cc9ba73 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformMain.java @@ -8,6 +8,8 @@ import top.offsetmonkey538.gitpackmanager.common.platform.PlatformMain; import top.offsetmonkey538.monkeylib538.modded.api.player.ModdedPlayerApi; +import static top.offsetmonkey538.gitpackmanager.common.GitPackManager.LOGGER; + public class ModdedPlatformMain implements PlatformMain { private static @Nullable MinecraftServer minecraftServer = null; @@ -32,4 +34,12 @@ public void sendMessageToAdmins(Component message) { public void refreshDatapacks() { getServer().getPackRepository().reload(); } + + @Override + public void reloadEnabledDatapacks() { + getServer().reloadResources(getServer().getPackRepository().getSelectedIds()).exceptionally(throwable -> { + LOGGER.warn("Failed to execute reload! Keeping old data.", throwable); + return null; + }); + } } From f589d67650c80560c823fec9280345e4b661e74c Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 7 Feb 2026 19:08:42 +0200 Subject: [PATCH 84/89] Update comment in config --- .../gitpackmanager/common/config/ModConfig.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java index 33ef00c..1b98d71 100644 --- a/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java +++ b/common/src/main/java/top/offsetmonkey538/gitpackmanager/common/config/ModConfig.java @@ -73,7 +73,7 @@ public static class ResourcePackProvider { public String rootLocation = "/resourcepacks"; @Comment("Messages sent in chat when pack has been updated. Each entry will be on a new line. May be 'null' or empty to disable.") - public @Nullable String[] updateMessage = new String[] { + public String[] updateMessage = new String[] { "Server resource pack has been updated!", "Please click [HERE] to get the most up to date pack." }; @@ -134,7 +134,7 @@ public WebhookInfo() { @Comment("The URL to send the webhook to. For example \"https://discord.com/api/webhooks/1234567890123456789/eW91J3JlIG5vdCBzdGVhbGluZyBhIHRva2Vu_bm9wZQ==_eWVyJyBub3Q=\" or something custom like \"https://api.example.com/NDI6IHRoZSBtZWFuaW5nIG9mIGxpZmUsIHRoZSB1bml2ZXJzZSwgYW5kIGV2ZXJ5dGhpbmc=\"") public @Nullable String url = null; - @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic_message.json\" or \"discord/embed_message.json\"") + @Comment("The relative path from the config directory to a webhook body file. For example \"discord/basic/success.json\" or \"discord/embed/success.json\"") public @Nullable String body = null; public void trigger(final boolean updateSucceeded, final Map placeholders, final UpdateType updateType) throws GitPackManagerException { From 613ff8afbad28691dd96937945cb45f84f062dcf Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sat, 7 Feb 2026 21:34:10 +0200 Subject: [PATCH 85/89] fix crash --- loader/fabric/gradle.properties | 2 +- .../gitpackmanager/modded/platform/ModdedPlatformCommand.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/loader/fabric/gradle.properties b/loader/fabric/gradle.properties index 6cc5e81..0c88634 100644 --- a/loader/fabric/gradle.properties +++ b/loader/fabric/gradle.properties @@ -11,4 +11,4 @@ supported_minecraft_versions = * # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. loader_version = 0.18.4 -fapi_version = 0.141.2+1.21.11 +fapi_version = 0.141.3+1.21.11 diff --git a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java index 16e8cea..5a9d2bb 100644 --- a/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java +++ b/modded/src/main/java/top/offsetmonkey538/gitpackmanager/modded/platform/ModdedPlatformCommand.java @@ -32,8 +32,7 @@ public int executeRequestPackCommand(CommandContext ctx) throws CommandS resourcePackProperties.hash(), resourcePackProperties.isRequired(), Optional.ofNullable(resourcePackProperties.prompt()) - ), - null + ) ); return SINGLE_SUCCESS; From d3ba640a06bcf1dd6cfbfb2b528f416ec7a4881a Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sun, 8 Feb 2026 12:33:58 +0200 Subject: [PATCH 86/89] Update monkeylib, meshlib --- common/build.gradle | 2 +- gradle.properties | 4 ++-- loader/fabric/build.gradle | 6 +++--- loader/neoforge/build.gradle | 6 +++--- loader/paper/build.gradle | 4 ++-- modded/build.gradle | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 390915c..919b20b 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -16,7 +16,7 @@ dependencies { compileOnlyApi("top.offsetmonkey538.monkeylib538:monkeylib538-common:${rootProject.monkeylib538_version}+common") { exclude(group: "net.kyori") } - compileOnlyApi("top.offsetmonkey538.meshlib:meshlib-common:${rootProject.meshlib_version}+common") { + compileOnlyApi("top.offsetmonkey538.meshlib:mesh-lib-common:${rootProject.meshlib_version}+common") { exclude(group: "net.kyori") } diff --git a/gradle.properties b/gradle.properties index 5aad5a1..13e3fd2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs = -Xmx6G org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.0-beta.2.1769880528759+b61667d +monkeylib538_version = 3.0.1 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0-alpha.0.1769880665236+1a435fc +meshlib_version = 2.0.0 # JGit jgit_version = 7.5.0.202512021534-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify diff --git a/loader/fabric/build.gradle b/loader/fabric/build.gradle index 36cab7b..0a21b10 100644 --- a/loader/fabric/build.gradle +++ b/loader/fabric/build.gradle @@ -19,7 +19,7 @@ allprojects { depends("fabric-api", "*") depends("adventure-platform-fabric", "*") depends("monkeylib538", ">=${rootProject.monkeylib538_version}") - depends("meshlib", ">=${rootProject.meshlib_version}") + depends("mesh-lib", ">=${rootProject.meshlib_version}") } // Gotta have this here cause I can't import it in buildSrc @@ -32,7 +32,7 @@ allprojects { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.kyori") } - modCompileOnly("top.offsetmonkey538.meshlib:meshlib-fabric:${rootProject.meshlib_version}+fabric") { + modCompileOnly("top.offsetmonkey538.meshlib:mesh-lib-fabric:${rootProject.meshlib_version}+fabric") { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") @@ -49,7 +49,7 @@ subprojects { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.kyori") } - modImplementation("top.offsetmonkey538.meshlib:meshlib-fabric-${project.meshlib_suffix}:${rootProject.meshlib_version}+fabric+${project.meshlib_suffix}") { + modImplementation("top.offsetmonkey538.meshlib:mesh-lib-fabric-${project.meshlib_suffix}:${rootProject.meshlib_version}+fabric+${project.meshlib_suffix}") { exclude(group: "net.fabricmc.fabric-api") exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") diff --git a/loader/neoforge/build.gradle b/loader/neoforge/build.gradle index 6530555..6e94e02 100644 --- a/loader/neoforge/build.gradle +++ b/loader/neoforge/build.gradle @@ -12,7 +12,7 @@ allprojects { dependencies { required("adventure_platform_neoforge") required("monkeylib538", "[${rootProject.monkeylib538_version},)") - required("meshlib", "[${rootProject.meshlib_version},)") + required("mesh_lib", "[${rootProject.meshlib_version},)") } } mixin("git-pack-manager.modded.mixins.json") @@ -22,7 +22,7 @@ allprojects { compileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}+neoforge") { exclude(group: "net.kyori") } - compileOnly("top.offsetmonkey538.meshlib:meshlib-neoforge:${rootProject.meshlib_version}+neoforge") { + compileOnly("top.offsetmonkey538.meshlib:mesh-lib-neoforge:${rootProject.meshlib_version}+neoforge") { exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } @@ -38,7 +38,7 @@ subprojects { implementation("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+neoforge+${project.monkeylib538_suffix}") { exclude(group: "net.kyori") } - implementation ("top.offsetmonkey538.meshlib:meshlib-neoforge-${project.meshlib_suffix}:${rootProject.meshlib_version}+neoforge+${project.meshlib_suffix}") { + implementation ("top.offsetmonkey538.meshlib:mesh-lib-neoforge-${project.meshlib_suffix}:${rootProject.meshlib_version}+neoforge+${project.meshlib_suffix}") { exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } diff --git a/loader/paper/build.gradle b/loader/paper/build.gradle index fcfd37d..d68be61 100644 --- a/loader/paper/build.gradle +++ b/loader/paper/build.gradle @@ -21,7 +21,7 @@ allprojects { dependencies { compileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-paper:${rootProject.monkeylib538_version}+paper") - compileOnly("top.offsetmonkey538.meshlib:meshlib-paper:${rootProject.meshlib_version}+paper") { + compileOnly("top.offsetmonkey538.meshlib:mesh-lib-paper:${rootProject.meshlib_version}+paper") { exclude(group: "top.offsetmonkey538.monkeylib538") } } @@ -37,7 +37,7 @@ subprojects { tasks.runServer { downloadPlugins { url("https://maven.offsetmonkey538.top/releases/top/offsetmonkey538/monkeylib538/monkeylib538-paper-${project.monkeylib538_suffix}/${rootProject.monkeylib538_version}+paper+${project.monkeylib538_suffix}/monkeylib538-paper-${project.monkeylib538_suffix}-${rootProject.monkeylib538_version}+paper+${project.monkeylib538_suffix}-all.jar") - url("https://maven.offsetmonkey538.top/releases/top/offsetmonkey538/meshlib/meshlib-paper-${project.meshlib_suffix}/${rootProject.meshlib_version}+paper+${project.meshlib_suffix}/meshlib-paper-${project.meshlib_suffix}-${rootProject.meshlib_version}+paper+${project.meshlib_suffix}-all.jar") + url("https://maven.offsetmonkey538.top/releases/top/offsetmonkey538/meshlib/mesh-lib-paper-${project.meshlib_suffix}/${rootProject.meshlib_version}+paper+${project.meshlib_suffix}/mesh-lib-paper-${project.meshlib_suffix}-${rootProject.meshlib_version}+paper+${project.meshlib_suffix}-all.jar") } } diff --git a/modded/build.gradle b/modded/build.gradle index 14a9fc2..cea2d63 100644 --- a/modded/build.gradle +++ b/modded/build.gradle @@ -7,7 +7,7 @@ allprojects { modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-modded:${rootProject.monkeylib538_version}+modded") { exclude(group: "net.kyori") } - modCompileOnly("top.offsetmonkey538.meshlib:meshlib-modded:${rootProject.meshlib_version}+modded") { + modCompileOnly("top.offsetmonkey538.meshlib:mesh-lib-modded:${rootProject.meshlib_version}+modded") { exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } @@ -19,7 +19,7 @@ subprojects { modCompileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-modded-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+modded+${project.monkeylib538_suffix}") { exclude(group: "net.kyori") } - modCompileOnly("top.offsetmonkey538.meshlib:meshlib-modded-${project.meshlib_suffix}:${rootProject.meshlib_version}+modded+${project.meshlib_suffix}") { + modCompileOnly("top.offsetmonkey538.meshlib:mesh-lib-modded-${project.meshlib_suffix}:${rootProject.meshlib_version}+modded+${project.meshlib_suffix}") { exclude(group: "net.kyori") exclude(group: "top.offsetmonkey538.monkeylib538") } From e5d93dd31d32278f9492a91c0febe14423d1bf34 Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sun, 8 Feb 2026 13:04:51 +0200 Subject: [PATCH 87/89] Update monkeylib, nmesghlib --- gradle.properties | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/gradle.properties b/gradle.properties index 13e3fd2..cf39a72 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,43 +1,43 @@ # Increase memory and *parallel* -org.gradle.jvmargs = -Xmx6G -org.gradle.parallel = true +org.gradle.jvmargs = -Xmx6G +org.gradle.parallel = true # MonkeyLib538, check at https://github.com/OffsetMods538/MonkeyLib538 -monkeylib538_version = 3.0.1 +monkeylib538_version = 3.0.2 # MESH Lib, check at https://github.com/OffsetMods538/MESH-Lib -meshlib_version = 2.0.0 +meshlib_version = 2.0.1 # JGit -jgit_version = 7.5.0.202512021534-r +jgit_version = 7.5.0.202512021534-r ## JSpecify, check at https://mvnrepository.com/artifact/org.jspecify/jspecify -jspecify_version = 1.0.0 +jspecify_version = 1.0.0 ## Bundeled with Minecraft, common needs to use -guava_version = 33.4.0-jre +guava_version = 33.4.0-jre ## Bundeled with Minecraft, common needs to use -brigadier_version = 1.3.10 +brigadier_version = 1.3.10 ## Bundeled with Minecraft, common needs to use -commonsio_version = 2.18.0 +commonsio_version = 2.18.0 ## Bundeled with Minecraft, common needs to use -commonslang_version = 3.18.0 +commonslang_version = 3.18.0 ## Bundeled with Minecraft, common needs to use -gson_version = 2.11.0 +gson_version = 2.11.0 ## DevAuth, check at https://github.com/DJtheRedstoner/DevAuth -devauth_version = 1.2.2 +devauth_version = 1.2.2 ## Gradle plugins -neoforged_moddev = 2.0.+ -fabric_loom = 1.15-SNAPSHOT -papermc_paperweight_userdev = 2.0.0-beta.19 -jpenilla_run_task = 3.0.2 -gradleup_shadow = 9.3.1 -jpenilla_resource_factory = 1.3.1 -dexman_outlet = 1.6.1 -modrinth_minotaur = 2.+ +neoforged_moddev = 2.0.+ +fabric_loom = 1.15-SNAPSHOT +papermc_paperweight_userdev = 2.0.0-beta.19 +jpenilla_run_task = 3.0.2 +gradleup_shadow = 9.3.1 +jpenilla_resource_factory = 1.3.1 +dexman_outlet = 1.6.1 +modrinth_minotaur = 2.+ # Mod Properties -mod_version = 5.0.0-alpha.0 -mod_name = Git Pack Manager -mod_id = git-pack-manager -mod_description = Allows for auto-updating resource and data packs at runtime from a git repository. -mod_website = https://modrinth.com/mod/git-pack-manager -mod_issues = https://github.com/OffsetMods538/Git-Pack-Manager/issues -mod_sources = https://github.com/OffsetMods538/Git-Pack-Manager +mod_version = 5.0.0-alpha.0 +mod_name = Git Pack Manager +mod_id = git-pack-manager +mod_description = Allows for auto-updating resource and data packs at runtime from a git repository. +mod_website = https://modrinth.com/mod/git-pack-manager +mod_issues = https://github.com/OffsetMods538/Git-Pack-Manager/issues +mod_sources = https://github.com/OffsetMods538/Git-Pack-Manager From 3bc191171be760d0ad7758b96164b9a5fb99aeba Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sun, 8 Feb 2026 13:05:22 +0200 Subject: [PATCH 88/89] Update buildSrc, fix modrtinth bublishing --- buildSrc | 2 +- loader/fabric/1.21.1/gradle.properties | 3 +-- loader/fabric/build.gradle | 6 ++++++ loader/neoforge/1.21.1/gradle.properties | 6 ++---- loader/neoforge/build.gradle | 10 ++++++++-- loader/paper/1.21.1/gradle.properties | 3 +-- loader/paper/build.gradle | 6 ++++++ loader/paper/gradle.properties | 10 ++++------ 8 files changed, 29 insertions(+), 17 deletions(-) diff --git a/buildSrc b/buildSrc index 31a2373..c0d7dd2 160000 --- a/buildSrc +++ b/buildSrc @@ -1 +1 @@ -Subproject commit 31a2373f007a4ef7aaaabdcf4d28fd283ef42175 +Subproject commit c0d7dd2fa6ad3280692c8921eaed4ce4c5b48f17 diff --git a/loader/fabric/1.21.1/gradle.properties b/loader/fabric/1.21.1/gradle.properties index 4290be3..63c4806 100644 --- a/loader/fabric/1.21.1/gradle.properties +++ b/loader/fabric/1.21.1/gradle.properties @@ -11,8 +11,7 @@ adventure_version = 5.14.2 # Minecraft version minecraft_version = 1.21.1 -# TODO: max version? -supported_minecraft_versions = >=1.21.1 +supported_minecraft_versions = >=1.21.1 <=1.21.11 # These should be automatically updated, unless the environment # variable "DISABLE_PROPERTIES_UPDATE" is set. diff --git a/loader/fabric/build.gradle b/loader/fabric/build.gradle index 0a21b10..dacc6e1 100644 --- a/loader/fabric/build.gradle +++ b/loader/fabric/build.gradle @@ -3,6 +3,7 @@ import xyz.jpenilla.resourcefactory.fabric.Environment plugins { id 'multiloader-fabric' + id 'multiloader-modrinth-publish' apply false } allprojects { @@ -44,6 +45,8 @@ allprojects { } subprojects { + apply plugin: "multiloader-modrinth-publish" + dependencies { modImplementation("top.offsetmonkey538.monkeylib538:monkeylib538-fabric-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+fabric+${project.monkeylib538_suffix}") { exclude(group: "net.fabricmc.fabric-api") @@ -59,6 +62,9 @@ subprojects { } modrinth { + loaders = ["fabric"] + uploadFile = remapJar + dependencies { required.project "fabric-api" required.project "adventure-platform-mod" diff --git a/loader/neoforge/1.21.1/gradle.properties b/loader/neoforge/1.21.1/gradle.properties index 03aa91d..3b41175 100644 --- a/loader/neoforge/1.21.1/gradle.properties +++ b/loader/neoforge/1.21.1/gradle.properties @@ -11,10 +11,8 @@ adventure_version = 6.0.1 # Minecraft version minecraft_version = 1.21.1 -# TODO: max version? -supported_minecraft_versions = >=1.21.1 -# TODO: max version? -minecraft_version_range = [1.21.1,) +supported_minecraft_versions = >=1.21.1 <=1.21.11 +minecraft_version_range = [1.21.1,1.21.11] neoforge_version = 21.1.218 parchment_minecraft_version = 1.21.1 diff --git a/loader/neoforge/build.gradle b/loader/neoforge/build.gradle index 6e94e02..f714a92 100644 --- a/loader/neoforge/build.gradle +++ b/loader/neoforge/build.gradle @@ -2,6 +2,7 @@ import dex.plugins.outlet.v2.util.ReleaseType plugins { id 'multiloader-neoforge' + id 'multiloader-modrinth-publish' apply false } allprojects { @@ -18,6 +19,9 @@ allprojects { mixin("git-pack-manager.modded.mixins.json") } + // Gotta have this here cause I can't import it in buildSrc + outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) + dependencies { compileOnly("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge:${rootProject.monkeylib538_version}+neoforge") { exclude(group: "net.kyori") @@ -31,8 +35,7 @@ allprojects { } subprojects { - // Gotta have this here cause I can't import it in buildSrc - outlet.allowedReleaseTypes = Set.of(ReleaseType.RELEASE) + apply plugin: "multiloader-modrinth-publish" dependencies { implementation("top.offsetmonkey538.monkeylib538:monkeylib538-neoforge-${project.monkeylib538_suffix}:${rootProject.monkeylib538_version}+neoforge+${project.monkeylib538_suffix}") { @@ -49,6 +52,9 @@ subprojects { } modrinth { + loaders = ["neoforge"] + uploadFile = jar + dependencies { required.project "adventure-platform-mod" required.project "monkeylib538" diff --git a/loader/paper/1.21.1/gradle.properties b/loader/paper/1.21.1/gradle.properties index d55ad0a2..dc50f6a 100644 --- a/loader/paper/1.21.1/gradle.properties +++ b/loader/paper/1.21.1/gradle.properties @@ -5,7 +5,6 @@ meshlib_suffix = 1.21.1 # Minecraft version minecraft_version = 1.21.1 -# TODO: max version? -supported_minecraft_versions = >=1.21.1 +supported_minecraft_versions = >=1.21.1 <=1.21.11 paper_version = 1.21.1-R0.1-SNAPSHOT diff --git a/loader/paper/build.gradle b/loader/paper/build.gradle index d68be61..e91208a 100644 --- a/loader/paper/build.gradle +++ b/loader/paper/build.gradle @@ -3,6 +3,7 @@ import xyz.jpenilla.resourcefactory.paper.PaperPluginYaml plugins { id 'multiloader-paper' + id 'multiloader-modrinth-publish' apply false } allprojects { @@ -28,6 +29,8 @@ allprojects { } subprojects { + apply plugin: "multiloader-modrinth-publish" + dependencies { include implementation("org.eclipse.jgit:org.eclipse.jgit:${rootProject.jgit_version}") { transitive = false @@ -42,6 +45,9 @@ subprojects { } modrinth { + loaders = ["paper"] + uploadFile = shadowJar + dependencies { required.project "monkeylib538" required.project "mesh-lib" diff --git a/loader/paper/gradle.properties b/loader/paper/gradle.properties index 2f5d4ca..03c2982 100644 --- a/loader/paper/gradle.properties +++ b/loader/paper/gradle.properties @@ -1,7 +1,5 @@ -project_name = paper +project_name = paper -# Minecraft version -minecraft_version = 1.21.11 -supported_minecraft_versions = * - -paper_version = 1.21.11-R0.1-SNAPSHOT +# Paper +minecraft_version = 1.21.11 +paper_version = 1.21.11-R0.1-SNAPSHOT From 99b7413992d263f8e7a7cd222680e7a41b8d0acc Mon Sep 17 00:00:00 2001 From: OffsetMonkey538 Date: Sun, 8 Feb 2026 14:23:09 +0200 Subject: [PATCH 89/89] README.md --- README.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 08e0c63..2fcdb9c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,19 @@ # Git Pack Manager -[![discord-singular](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/social/discord-singular_vector.svg)](https://discord.offsetmonkey538.top/) -[![modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/mod/git-pack-manager) -[![requires-monkeylib538](https://raw.githubusercontent.com/OffsetMods538/MonkeyLib538/master/images/requires_monkeylib538.png)](https://modrinth.com/mod/monkeylib538) -[![Requires Fabric API](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/requires/fabric-api_vector.svg)](https://modrinth.com/mod/fabric-api) -TODO: badge for mesh-lib I guess? +[![Chat with me on Discord](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/social/discord-singular_vector.svg)](https://discord.offsetmonkey538.top/) +[![Available on Modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/mod/git-pack-manager) +[![Available on GitHub](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/github_vector.svg)](https://github.com/OffsetMods538/Git-Pack-Manager) +[![Requires MonkeyLib538](https://raw.githubusercontent.com/OffsetMods538/MonkeyLib538/master/images/requires_badge.svg)](https://modrinth.com/mod/monkeylib538) +[![Requires MESH Lib](https://raw.githubusercontent.com/OffsetMods538/MESH-Lib/refs/heads/master/images/requires_badge.svg)](https://modrinth.com/mod/mesh-lib) +[![Read the Documentation](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/ghpages_vector.svg)](https://git-pack-manager.docs.offsetmonkey538.top/) -Please read the documentation located [here](https://git-pack-manager.docs.offsetmonkey538.top) and if you have any questions, feel free to contact me on [discord](https://discord.offsetmonkey538.top/) +## What's this? +Git Pack Manager is a mod/plugin for dedicated servers that allows for handling resource and data packs with git. +Using git allows for easier management and collaboration. +The mod also supports automatically updating the packs as soon as modifications are made with git. +Resource packs are automatically combined based on their priorities. + +See the [boring showcase for Git Pack Manager](https://www.youtube.com/watch?v=S-ei-7u6yCI) video for an example of what it can do. +This allows for easier management of the packs and makes collaboration easier. + +## Using +Please read the documentation located [here](https://git-pack-manager.docs.offsetmonkey538.top) and if you have any questions, feel free to contact me on [Discord](https://discord.offsetmonkey538.top/)