From 43d8729001a3a92b55dd74f073f2c2fca97e518d Mon Sep 17 00:00:00 2001 From: David J Pfeiffer Date: Fri, 21 Dec 2018 14:55:48 -0600 Subject: [PATCH] Initial commit --- .gitignore | 7 +++++++ README.md | 25 +++++++++++++++++++++++++ build.sh | 26 ++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3b68d35 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Ignore all generated files +* + +# Source control git ignore file, Git bash script, README, and Build Tools +!.gitignore +!build.sh +!README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..694aee0 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Spigot + +The fastest and easiest way to download any version of Spigot. + +This repository uses the [Spigot](https://www.spigotmc.org/) [Build Tools](https://www.spigotmc.org/wiki/buildtools/) and a [Git](https://git-scm.com/) bash script to run a Spigot build for a specific [Minecraft](https://minecraft.net) version. + +This is accomplished by running the script and passing in the version of Minecraft you want to use as a parameter. When running this command, a new directory will be created for the version you pass in, and the `BuildTools.jar` file will be used to generate the desired files in that directory. If the directory already exists, it will be overwritten for this version. You can keep mutliple versions, all of which will be usable on your computer. This repository should always contain the latest version of the Build Tools, and will automatically update before you run the script, which guarentees that you are always using the latest version of the Build Tools. This makes it easy to obtain and manage multiple different versions of Spigot on your local machine. + +### Usage + +Run `build.sh ` from the command line. + +For example, `build.sh 1.12.2` will output the Spigot files for Minecraft version 1.12.2 in a newly created directory. + +### But Why? + +Why is this necessary? Why should I use this repository to obtain a Spigot build? Why can't I just download the files I want online? + +This is a good question. The answer is that distributing copyrighted intillectual property over the internet is illegal. Because Spigot is built ontop of Minecraft, it is illegal to distribute the files from a Spigot build online because those files include Minecraft source files, which are the coprighted intillectual property of Mojang. + +To get around this, you must generate the files yourself using the Build Tools provided by Spigot. You can then legally use these files to run a server and develop plugins for Minecraft servers. + +### Legal + +This project is in no way affiliated with [Minecraft](https://minecraft.net), [Mojang](https://mojang.com), [Microsoft](https://www.microsoft.com/en-us/), [Spigot](https://www.spigotmc.org/), [Bukkit](https://bukkit.org/), or any other organization. diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..f98fc95 --- /dev/null +++ b/build.sh @@ -0,0 +1,26 @@ +git fetch +curl https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar --output BuildTools.jar + +if [ -z "$(git status --porcelain)" ]; then + if [ -z "$(git log HEAD..origin/master --oneline)" ]; then + if [ -z "$1" ]; then + echo "Usage: build.sh " + else + if [ -d "$1" ]; then + rm -fr "$1" + fi + + mkdir "$1" + cd "$1" + Java -jar ../BuildTools.jar --rev "$1" + fi + else + echo "It looks like there are incomming updates to this repository. Pulling those changes now." + git pull + echo "This repositry has been updated. That means that this script might also have been updated. This script will now exit to ensure that the newest version is used." + echo "IMPORTANT: Please re-run this script." + fi +else + echo "It looks like you have made changes to this repository." + echo "Please remove those changes and re-run this script." +fi