A lightweight GitHub commit fetcher for Minecraft plugins (Spigot/Paper/Bukkit).
This utility lets you fetch and display recent Git commits directly in-game, with author, date, and summary info. Perfect for showing recent updates, patch notes, or changelogs.
- 🔗 Fetches commit history from any public GitHub repository
- 📝 Displays commits with author, date, and summary
- 🎨 Supports Minecraft color codes
- ⚡ Runs asynchronously (non-blocking)
- 🛑 Clean shutdown with executor cleanup
Update the following in CommitFetcher:
privatefinalStringREPOSITORY_OWNER = "YourGitHubUsername"; privatefinalStringREPOSITORY_NAME = "YourRepositoryName"; packageme.emmy.command;
importme.emmy.api.CommitFetcher;
importorg.bukkit.ChatColor;
importorg.bukkit.command.Command;
importorg.bukkit.command.CommandExecutor;
importorg.bukkit.command.CommandSender;
importjava.util.List;
importjava.util.concurrent.ExecutionException;
importjava.util.concurrent.Future;
publicclassUpdatesCommandimplementsCommandExecutor {
privatefinalCommitFetchercommitFetcher = newCommitFetcher();
@OverridepublicbooleanonCommand(CommandSendersender, Commandcommand, Stringlabel, String[] args) {
if (args.length < 1) {
sender.sendMessage(ChatColor.RED + "Usage: /updates <amount>");
returntrue;
}
intrequestedAmount;
try {
requestedAmount = Integer.parseInt(args[0]);
if (requestedAmount < 1 || requestedAmount > commitFetcher.getMAX_FETCH_LIMIT()) {
sender.sendMessage(ChatColor.RED + "Please specify a number between 1 and " + commitFetcher.getMAX_FETCH_LIMIT() + ".");
returntrue;
}
} catch (NumberFormatExceptionexception) {
sender.sendMessage(ChatColor.RED + "Invalid number format. Please enter a valid integer.");
returntrue;
}
sender.sendMessage(ChatColor.YELLOW + "Fetching recent updates for " + commitFetcher.getREPOSITORY_NAME() + "...");
Future<List<String>> futureCommits = commitFetcher.fetchAndFormatCommitsAsync(requestedAmount);
try {
List<String> formattedCommitMessages = futureCommits.get();
if (formattedCommitMessages.isEmpty()) {
sender.sendMessage(ChatColor.RED + "No recent updates found.");
returntrue;
}
for (Stringmessage : formattedCommitMessages) {
sender.sendMessage(ChatColor.translateAlternateColorCodes('&', message));
}
} catch (InterruptedException | ExecutionExceptionexception) {
sender.sendMessage(ChatColor.RED + "An error occurred while fetching updates. Please try again later.");
}
returntrue;
}
}Developed by Emmy 💜
Since 22/07/2025