TastyLoader is a GitHub-based plugin loader for Bukkit/Spigot servers. It streamlines the process of managing and updating plugins by automatically downloading, loading, and unloading plugin JARs from a specified GitHub repository. This plugin loader will get updates and improvements in the future. Please note there may be bugs and issues.
- Key Features
- Getting Started
- Configuration
- How It Works
- Usage in Loadable Maven Plugin Project
- License
- Automatic plugin download from GitHub repositories
- Priority-based loading order
- Dynamic plugin management (load/unload at runtime)
- Support for private repositories with GitHub token authentication
- Configurable through YAML file
- Bukkit/Spigot server (Tested on 1.20.4)
- Java Development Kit (JDK) 8 or higher
- Kotlin runtime (included in the plugin JAR)
- Download the latest TastyLoader JAR from the releases page.
- Place the TastyLoader JAR in your server's
pluginsfolder. - Start your server to generate the default configuration file.
- Configure the
config.ymlfile in theplugins/TastyLoaderdirectory.
TastyLoader uses a config.yml file for its configuration. Here's an example:
repo: "https://raw.githubusercontent.com/yourusername/yourrepository/main"
github_token: "your_github_token_here"
loadables:
example:
jarName: "example"
priority: 1
enabled: truerepo: The GitHub repository URL that stores your plugin JARs. Use the raw content URL and provide the correct branch.github_token: Your GitHub Personal Access Token for authentication when downloading plugins from private repositories.loadables: A list of all the plugins to be managed by TastyLoader.jarName: The name of the plugin JAR file without the .jar extension.priority: Sets the loading order (lower numbers load first).enabled: Determines if TastyLoader should load this plugin.
-
Plugin Download:
- TastyLoader downloads plugin JARs from the specified GitHub repository.
- If a GitHub token is provided in the config, it's used for authentication, allowing access to private repositories.
-
Loading Process:
- Plugins are loaded in order of their specified priority.
- Downloaded JARs are stored in temporary files.
- The plugin uses Bukkit's plugin manager to load and enable each JAR.
-
Unloading Process:
- On server shutdown, TastyLoader unloads all plugins it has loaded.
- Temporary files are cleaned up.
-
Error Handling:
- TastyLoader logs errors for failed downloads or loading attempts.
- It continues to load other plugins even if one fails.
-
Dynamic Management:
- The
deactivateSpecificPluginfunction allows for runtime unloading of specific plugins if needed.
- The
For plugin developers who want their plugins to be compatible with TastyLoader, ensure your plugin follows standard Bukkit plugin structure and is compiled as a JAR file.
Add the following plugin configuration to your pom.xml file. This will automatically update your plugin JAR in the specified GitHub repository when you run mvn install.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Change loader releases repository if needed -->
<property name="GITHUB_REPO" value="git@github.com:Tc554/loader-releases"/>
<delete dir="repo-dir"/>
<exec executable="cmd">
<arg value="/c"/>
<arg value="if not exist repo-dir ( git clone ${GITHUB_REPO} repo-dir ) else ( cd repo-dir && git pull ${GITHUB_REPO} && cd .. )"/>
</exec>
<delete file="repo-dir/${project.build.finalName}.jar"/>
<copy file="target/${project.build.finalName}.jar" tofile="repo-dir/${project.build.finalName}.jar"/>
<exec executable="cmd">
<arg value="/c"/>
<arg value="cd repo-dir && git add ${project.build.finalName}.jar"/>
</exec>
<exec executable="cmd">
<arg value="/c"/>
<arg value="cd repo-dir && git commit -m "Updated jar" && git push ${GITHUB_REPO}"/>
</exec>
<delete dir="repo-dir"/>
</target>
</configuration>
</execution>
</executions>
</plugin>Note: This will only run when you execute mvn install. You can change this to your preferred command by modifying the <phase> tag.
If you haven't set up SSH for GitHub already, follow these steps:
-
Enable OpenSSH if it's disabled:
- Search for "Services" in your Windows search and run as admin.
- Find "OpenSSH Authentication Agent".
- Right-click > Properties > Startup type - set to "Automatic".
- Click "Apply" and "OK", then open this menu again and click "Start".
- Apply and close.
-
Create an
.sshfolder in your user directory (e.g.,C:\Users\user\.ssh). -
Ensure the OpenSSH folder is in your environment path (typically
C:\Windows\System32\OpenSSH). -
Create the SSH agent:
ssh-agent ssh-add C:/User/user/.ssh/gitssh -
Generate an SSH key:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com" -
Copy your public key:
powershell Get-Content C:\Users\user\.ssh\gitssh.pub -
Add the key to your GitHub account:
- Go to GitHub SSH Settings
- Click "New SSH Key"
- Give it a name and paste the key, then save
-
Add GitHub to known hosts:
ssh-keyscan github.com >> C:/Users/user/.ssh/known_hosts -
Test the connection:
ssh -T git@github.comIf you see "Hi username! You've successfully authenticated...", you're good to go.
-
If it still doesn't work, create a
configfile in your.sshfolder with the following content:Host github.com HostName github.com User git IdentityFile ~/.ssh/gitssh IdentitiesOnly yes
This project is licensed under the MIT License. See the LICENSE file for more details.