Skip to content

Commit

Permalink
Init ArcadePaper
Browse files Browse the repository at this point in the history
  • Loading branch information
Speedy11CZ committed Aug 9, 2021
1 parent b3a5b4a commit 00f078f
Show file tree
Hide file tree
Showing 14 changed files with 541 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.idea/
/base/mc-dev/
/ArcadePaper-API/
/ArcadePaper-Server/
*.iml
*.DS_Store
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "Paper"]
path = base/Paper
url = https://github.com/PaperMC/Paper.git
branch = ver/1.8.8
71 changes: 71 additions & 0 deletions arcadepaper
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

# get base dir regardless of execution location
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
SOURCE=$([[ "$SOURCE" = /* ]] && echo "$SOURCE" || echo "$PWD/${SOURCE#./}")
basedir=$(dirname "$SOURCE")

. $basedir/scripts/init.sh

paperstash() {
STASHED=$(git stash)
}

paperunstash() {
if [[ "$STASHED" != "No local changes to save" ]] ; then
git stash pop
fi
}

case "$1" in
"setup")
cd "$basedir"
scripts/upstream.sh
;;
"build")
log_info "Preparing to build ArcadePaper"
cd "$basedir"
scripts/upstream.sh
scripts/apply.sh "$basedir"
mvn clean install
;;
"rb" | "rbp" | "rebuild")
(
set -e
cd "$basedir"
scripts/rebuildpatches.sh "$basedir"
)
;;
"p" | "patch" | "apply")
(
set -e
cd "$basedir"
scripts/apply.sh "$basedir"
log_info " Run './arcadepaper jar' to create a runnable JAR."
)
;;
"j" | "jar")
(
set -e
mvn clean install
)
;;
*)
echo "ArcadePaper build tool."
echo ""
echo " Commands:"
echo " * setup | Setup the build environment"
echo " * build | Setup the build environment, apply patches, and create a runnable JAR"
echo " * p, patch | Apply patches"
echo " * rb, rebuild | Rebuild patches"
echo " * j, jar | Create a runnable JAR"
;;
esac

unset -f paperstash
unset -f paperunstash
1 change: 1 addition & 0 deletions base/.upstream-state
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.8--2882919d66fc3bf050fe2a1474393750d281fa07
1 change: 1 addition & 0 deletions base/Paper
Submodule Paper added at 4c7641
59 changes: 59 additions & 0 deletions patches/api/0001-This-is-ArcadePaper.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From 8fa1a710312e7ab404096dee541146300b9c5775 Mon Sep 17 00:00:00 2001
From: Speedy11CZ <[email protected]>
Date: Mon, 09 Aug 2021 20:50:25 +0200
Subject: [PATCH] This is ArcadePaper

---
pom.xml | 25 ++++---------------------
1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/pom.xml b/pom.xml
index fe9d6d2..b5ccba3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,20 +4,15 @@
<modelVersion>4.0.0</modelVersion>

<parent>
- <groupId>org.github.paperspigot</groupId>
- <artifactId>paperspigot-parent</artifactId>
- <version>dev-SNAPSHOT</version>
+ <groupId>cz.arcadiamc</groupId>
+ <artifactId>arcadepaper-parent</artifactId>
+ <version>1.8-SNAPSHOT</version>
</parent>

- <groupId>org.github.paperspigot</groupId>
- <artifactId>paperspigot-api</artifactId>
+ <artifactId>arcadepaper-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<packaging>jar</packaging>

- <name>PaperSpigot-API</name>
- <url>https://hub.spigotmc.org/stash/projects/PAPER/</url>
- <description>An enhanced plugin API for Minecraft servers.</description>
-
<properties>
<!--PaperSpigot - Bump to 1.8 - This will haunt me -->
<additionalparam>-Xdoclint:none</additionalparam>
@@ -26,18 +21,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

- <!-- just until we get deployment to central approved -->
- <distributionManagement>
- <repository>
- <id>destroystokyo-releases</id>
- <url>https://repo.destroystokyo.com/content/repositories/releases/</url>
- </repository>
- <snapshotRepository>
- <id>destroystokyo-snapshots</id>
- <url>https://repo.destroystokyo.com/content/repositories/snapshots/</url>
- </snapshotRepository>
- </distributionManagement>
-
<!-- required until fixed plexus-compiler-eclipse is deployed -->
<pluginRepositories>
<pluginRepository>
--
2.10.2
88 changes: 88 additions & 0 deletions patches/server/0001-This-is-ArcadePaper.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
From d0cdeb68293d98ee7fa92ab10e0850bb9d67a107 Mon Sep 17 00:00:00 2001
From: Speedy11CZ <[email protected]>
Date: Mon, 09 Aug 2021 20:50:25 +0200
Subject: [PATCH] This is ArcadePaper

Also includes some legacy mc-dev imports
---

diff --git a/pom.xml b/pom.xml
index 6aaba50..f5aa732 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,12 +1,10 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.github.paperspigot</groupId>
- <artifactId>paperspigot</artifactId>
+
+ <artifactId>arcadepaper</artifactId>
<packaging>jar</packaging>
<version>1.8.8-R0.1-SNAPSHOT</version>
- <name>PaperSpigot</name>
- <url>https://hub.spigotmc.org/stash/projects/PAPER/</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -22,9 +20,9 @@
</properties>

<parent>
- <groupId>org.github.paperspigot</groupId>
- <artifactId>paperspigot-parent</artifactId>
- <version>dev-SNAPSHOT</version>
+ <groupId>cz.arcadiamc</groupId>
+ <artifactId>arcadepaper-parent</artifactId>
+ <version>1.8-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@@ -35,8 +33,8 @@
<version>3.0.3</version>
</dependency>
<dependency>
- <groupId>org.github.paperspigot</groupId>
- <artifactId>paperspigot-api</artifactId>
+ <groupId>cz.arcadiamc</groupId>
+ <artifactId>arcadepaper-api</artifactId>
<version>${project.version}</version>
<type>jar</type>
<scope>compile</scope>
@@ -113,7 +111,7 @@
<artifactId>gitdescribe-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
- <outputPrefix>git-PaperSpigot-</outputPrefix>
+ <outputPrefix>git-ArcadePaper-</outputPrefix>
<scmDirectory>..</scmDirectory>
</configuration>
<executions>
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b400ce0..a7c8cba 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1084,7 +1084,7 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
}

public String getServerModName() {
- return "PaperSpigot"; // PaperSpigot - PaperSpigot > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "ArcadePaper"; // ArcadePaper - ArcadePaper > // PaperSpigot - PaperSpigot > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}

public CrashReport b(CrashReport crashreport) {
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 3a4b142..b820598 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ public final class Versioning {
public static String getBukkitVersion() {
String result = "Unknown-Version";

- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.github.paperspigot/paperspigot-api/pom.properties");
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/cz.arcadiamc/arcadepaper-api/pom.properties");
Properties properties = new Properties();

if (stream != null) {
--
2.6.4
25 changes: 25 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>cz.arcademc</groupId>
<artifactId>arcadepaper-parent</artifactId>
<version>1.8-SNAPSHOT</version>
<packaging>pom</packaging>

<repositories>
<repository>
<id>sonatype-repo</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>spigotmc-public</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>

<modules>
<module>ArcadePaper-API</module>
<module>ArcadePaper-Server</module>
</modules>
</project>
57 changes: 57 additions & 0 deletions scripts/apply.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# get base dir regardless of execution location
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
. $(dirname $SOURCE)/init.sh
PS1="$"

paperVer=$(cat base/.upstream-state)
log_info "Applying ArcadePaper patches"
function applyPatch {
what=$1
what_name=$(basename $what)
target=$2
branch=$3
patch_folder=$4

cd "$basedir/$what"
git fetch --all
git branch -f upstream "$branch" >/dev/null 2>&1

cd "$basedir"
if [ ! -d "$basedir/$target" ]; then
mkdir "$basedir/$target"
cd "$basedir/$target"
git init
cd "$basedir"
fi
cd "$basedir/$target"
echo "Resetting $target to $what_name..."
git remote rm upstream > /dev/null 2>&1
git remote add upstream $basedir/$what >/dev/null 2>&1
git checkout master 2>/dev/null || git checkout -b master
git fetch upstream >/dev/null 2>&1
git reset --hard upstream/upstream
echo " Applying patches to $target..."
git am --abort >/dev/null 2>&1
git am --3way --ignore-whitespace "$basedir/patches/$patch_folder/"*.patch
if [ "$?" != "0" ]; then
echo " Something did not apply cleanly to $target."
echo " Please review above details and finish the apply then"
echo " save the changes with rebuildPatches.sh"
exit 1
else
echo " Patches applied cleanly to $target"
fi
}

log_info "Applying ArcadePaper API patches"
applyPatch base/Paper/PaperSpigot-API ArcadePaper-API HEAD api
log_info "Applying ArcadePaper server patches"
applyPatch base/Paper/PaperSpigot-Server ArcadePaper-Server HEAD server

log_info "Patches successfully applied."
38 changes: 38 additions & 0 deletions scripts/generatesources.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
. $(dirname $SOURCE)/init.sh


cd $basedir
paperVer=$(cat base/.upstream-state)

minecraftversion=$(cat $basedir/base/Paper/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
decompile="base/Paper/work/$minecraftversion/"

mkdir -p base/mc-dev/src/net/minecraft/server

cd base/mc-dev
if [ ! -d ".git" ]; then
git init
fi

cp $basedir/$decompile/net/minecraft/server/*.java src/net/minecraft/server

base="$basedir/base/Paper/PaperSpigot-Server/src/main/java/net/minecraft/server"
cd $basedir/base/mc-dev/src/net/minecraft/server/
for file in $(/bin/ls $base)
do
if [ -f "$file" ]; then
rm -f "$file"
fi
done
cd $basedir/base/mc-dev
git add . -A
git commit . -m "mc-dev"
git tag -a "$paperVer" -m "$paperVer" 2>/dev/null
Loading

0 comments on commit 00f078f

Please sign in to comment.