Skip to content
This repository was archived by the owner on Jun 19, 2021. It is now read-only.

Commit c2fd399

Browse files
ishlandSimon GardlingduplexsystemHookWoods
authored
Merge staging/1.16.5 (#371)
* add config for sand duping (#352) * Lithium: cache chunk gen sea level (#349) based off: CaffeineMC/lithium@a55cfd1 * PaperPR: Inline shift fields in EnumDirection (#350) * Introducing: Yatoclip (#360) * New async nbt cache (#347) * update pom * whoops * Try to address path issue and improve Jenkins build speed * Detailed lag and crash reports (#369) Added "Suspected Plugins" to Watchdog and crash reports * Drop sand duping * Add branch specific versions * Remove copyright * Revert mysql-connector-java version bump * Small fixes * More detailed lag and crash reports * Don't use branch information when generating metadata * Fix Jenkins Builds version command * Fixup patches * Fix patch notes * Pull Request compatibility for branch detection * Fix Pull Request compatibility for branch detection * Set context classloader before launch * Inject server jar to SystemClassLoader before launch * Try fix compile in java8 * Run tests on CodeMC and Github Actions Co-authored-by: Simon Gardling <[email protected]> Co-authored-by: Zoe <[email protected]> Co-authored-by: Hugo Planque <[email protected]>
1 parent 2e12bc7 commit c2fd399

33 files changed

+2206
-130
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
fail-fast: false
3030

3131
steps:
32-
- name: Cancel Previous Runs
33-
uses: styfle/[email protected]
34-
with:
35-
access_token: ${{ github.token }}
36-
3732
- uses: actions/checkout@v2
3833
- name: Set up JDK ${{ matrix.java }}
3934
uses: actions/setup-java@v1
@@ -80,12 +75,12 @@ jobs:
8075

8176
- name: Build Yatopia
8277
run: |
83-
./gradlew paperclip
78+
./gradlew clean build yatoclip
8479
8580
- name: Upload Artifact
8681
if: github.ref != 'refs/heads/ver/1.16.4'
8782
uses: actions/upload-artifact@v2
8883
with:
8984
name: Yatopia-${{ matrix.java }}
90-
path: yatopia-1.16.5-paperclip.jar
85+
path: yatopia-1.16.5-yatoclip.jar
9186

Jenkinsfile

Lines changed: 74 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,74 @@
1-
pipeline {
2-
agent { label 'slave' }
3-
options { timestamps() }
4-
stages {
5-
stage('Cleanup') {
6-
steps {
7-
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
8-
sh 'rm -rf ./target'
9-
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
10-
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
11-
sh 'chmod +x ./gradlew'
12-
}
13-
}
14-
stage('Init project & submodules') {
15-
steps {
16-
withMaven(
17-
maven: '3',
18-
mavenLocalRepo: '.repository',
19-
publisherStrategy: 'EXPLICIT',
20-
) {
21-
sh './gradlew initGitSubmodules'
22-
}
23-
}
24-
}
25-
stage('Decompile & apply patches') {
26-
tools {
27-
jdk "OpenJDK 8"
28-
}
29-
steps {
30-
withMaven(
31-
maven: '3',
32-
mavenLocalRepo: '.repository',
33-
publisherStrategy: 'EXPLICIT',
34-
) {
35-
sh '''
36-
./gradlew setupUpstream
37-
./gradlew applyPatches
38-
'''
39-
}
40-
}
41-
}
42-
stage('Build') {
43-
tools {
44-
jdk "OpenJDK 8"
45-
}
46-
steps {
47-
withMaven(
48-
maven: '3',
49-
mavenLocalRepo: '.repository',
50-
publisherStrategy: 'EXPLICIT'
51-
) {
52-
withCredentials([usernamePassword(credentialsId: 'jenkins-deploy', usernameVariable: 'ORG_GRADLE_PROJECT_mavenUsername', passwordVariable: 'ORG_GRADLE_PROJECT_mavenPassword')]) {
53-
sh '''
54-
./gradlew build
55-
./gradlew publish
56-
'''
57-
}
58-
}
59-
}
60-
}
61-
stage('Build Launcher') {
62-
tools {
63-
jdk "OpenJDK 8"
64-
}
65-
steps {
66-
withMaven(
67-
maven: '3',
68-
mavenLocalRepo: '.repository',
69-
publisherStrategy: 'EXPLICIT'
70-
) {
71-
sh '''
72-
mkdir -p "./target"
73-
./gradlew paperclip
74-
basedir=$(pwd)
75-
paperworkdir="$basedir/Paper/work"
76-
mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
77-
cp "yatopia-$mcver-paperclip.jar" "./target/yatopia-$mcver-paperclip-b$BUILD_NUMBER.jar"
78-
'''
79-
}
80-
}
81-
post {
82-
success {
83-
archiveArtifacts "target/*.jar"
84-
}
85-
failure {
86-
cleanWs()
87-
}
88-
}
89-
}
90-
}
91-
}
1+
pipeline {
2+
agent { label 'slave' }
3+
options { timestamps() }
4+
stages {
5+
stage('Cleanup') {
6+
steps {
7+
scmSkip(deleteBuild: true, skipPattern:'.*\\[CI-SKIP\\].*')
8+
sh 'rm -rf ./target'
9+
sh 'rm -rf ./Paper/Paper-API ./Paper/Paper-Server ./Paper/work/Spigot/Spigot-API ./Paper/work/Spigot/Spigot-Server'
10+
sh 'rm -rf ./Yatopia-API ./Yatopia-Server'
11+
sh 'chmod +x ./gradlew'
12+
}
13+
}
14+
stage('Init project & submodules') {
15+
steps {
16+
withMaven(
17+
maven: '3',
18+
mavenLocalRepo: '.repository',
19+
publisherStrategy: 'EXPLICIT',
20+
) {
21+
sh './gradlew initGitSubmodules'
22+
}
23+
}
24+
}
25+
stage('Decompile & apply patches') {
26+
tools {
27+
jdk "OpenJDK 8"
28+
}
29+
steps {
30+
withMaven(
31+
maven: '3',
32+
mavenLocalRepo: '.repository',
33+
publisherStrategy: 'EXPLICIT',
34+
) {
35+
sh '''
36+
./gradlew setupUpstream
37+
./gradlew applyPatches
38+
'''
39+
}
40+
}
41+
}
42+
stage('Build') {
43+
tools {
44+
jdk "OpenJDK 8"
45+
}
46+
steps {
47+
withMaven(
48+
maven: '3',
49+
mavenLocalRepo: '.repository',
50+
publisherStrategy: 'EXPLICIT'
51+
) {
52+
withCredentials([usernamePassword(credentialsId: 'jenkins-deploy', usernameVariable: 'ORG_GRADLE_PROJECT_mavenUsername', passwordVariable: 'ORG_GRADLE_PROJECT_mavenPassword')]) {
53+
sh '''
54+
./gradlew clean build yatoclip publish
55+
mkdir -p "./target"
56+
basedir=$(pwd)
57+
paperworkdir="$basedir/Paper/work"
58+
mcver=$(cat "$paperworkdir/BuildData/info.json" | grep minecraftVersion | cut -d '"' -f 4)
59+
cp "yatopia-$mcver-yatoclip.jar" "./target/yatopia-$mcver-yatoclip-b$BUILD_NUMBER.jar"
60+
'''
61+
}
62+
}
63+
}
64+
post {
65+
success {
66+
archiveArtifacts "target/*.jar"
67+
}
68+
failure {
69+
cleanWs()
70+
}
71+
}
72+
}
73+
}
74+
}

PATCHES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This is an overview over all patches that are currently used.
88

99
| Side | Patch | Author | CoAuthors |
1010
| ----- | ------------- |:-------------:| -----:|
11+
| server | (PaperPR) Inline shift direction fields | Andrew Steinborn | |
1112
| server | AFK API | William Blake Galbreath | |
1213
| api | AFK API | William Blake Galbreath | |
1314
| server | Ability to re-add farmland mechanics from Alpha | Yive | |
@@ -240,6 +241,7 @@ This is an overview over all patches that are currently used.
240241
| server | Multi-Threaded Server Ticking Vanilla | Spottedleaf | |
241242
| server | Multi-Threaded ticking CraftBukkit | Spottedleaf | |
242243
| server | Name craft scheduler threads according to the plugin using | Spottedleaf | |
244+
| server | New nbt cache | Hugo Planque | ishland |
243245
| server | Nuke streams off BlockPosition | Ivan Pekov | |
244246
| server | Nuke streams off SectionPosition | Ivan Pekov | |
245247
| server | Optimise EntityInsentient#checkDespawn | Spottedleaf | |
@@ -339,6 +341,8 @@ This is an overview over all patches that are currently used.
339341
| server | Stop wasting resources on JsonList#get | Ivan Pekov | |
340342
| server | Striders give saddle back | Ben Kerllenevich | |
341343
| server | Strip raytracing for EntityLiving#hasLineOfSight | Paul Sauve | |
344+
| server | Suspected plugins report | ishland | |
345+
| api | Suspected plugins report | ishland | |
342346
| server | Swap priority of checks in chunk ticking | Paul Sauve | |
343347
| server | Time scoreboard search | Spottedleaf | |
344348
| server | Timings stuff | William Blake Galbreath | |
@@ -374,3 +378,4 @@ This is an overview over all patches that are currently used.
374378
| server | lithium VoronoiBiomeAccessTypeMixin | JellySquid | |
375379
| server | lithium enum_values | JellySquid | |
376380
| server | lithium reduce allocations | JellySquid | Mykyta Komarnytskyy |
381+
| server | lithium: cache chunk gen sea level | SuperCoder7979 | |

Yatoclip/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repositories {
2+
mavenCentral()
3+
maven("https://jitpack.io/")
4+
}
5+
6+
dependencies {
7+
implementation("com.github.ishlandbukkit:jbsdiff:deff66b794")
8+
implementation("com.google.code.gson:gson:2.8.6")
9+
implementation("commons-io:commons-io:2.8.0")
10+
}
11+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package org.yatopiamc.yatoclip;
2+
3+
import java.lang.instrument.Instrumentation;
4+
import java.nio.file.Path;
5+
import java.util.jar.JarFile;
6+
7+
public class YatoclipLaunch {
8+
9+
private static Instrumentation inst = null;
10+
11+
public static void premain(String args, Instrumentation inst) {
12+
YatoclipLaunch.inst = inst;
13+
}
14+
15+
public static void agentmain(final String agentArgs, final Instrumentation inst) {
16+
YatoclipLaunch.inst = inst;
17+
}
18+
19+
@SuppressWarnings("unused")
20+
static void injectClasspath(Path setup) throws Throwable {
21+
if(inst == null) {
22+
throw new RuntimeException("Instrumentation API handle not found");
23+
}
24+
inst.appendToSystemClassLoaderSearch(new JarFile(setup.toFile()));
25+
inst = null;
26+
}
27+
28+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package org.yatopiamc.yatoclip;
2+
3+
import java.io.Serializable;
4+
import java.util.Collections;
5+
import java.util.Objects;
6+
import java.util.Set;
7+
8+
public class PatchesMetadata {
9+
10+
public final Set<PatchMetadata> patches;
11+
public final Set<Relocation> relocations;
12+
public final Set<String> copyExcludes;
13+
14+
public PatchesMetadata(Set<PatchMetadata> patches, Set<Relocation> relocations, Set<String> copyExcludes) {
15+
Objects.requireNonNull(copyExcludes);
16+
this.copyExcludes = Collections.unmodifiableSet(copyExcludes);
17+
Objects.requireNonNull(relocations);
18+
this.relocations = Collections.unmodifiableSet(relocations);
19+
Objects.requireNonNull(patches);
20+
this.patches = Collections.unmodifiableSet(patches);
21+
}
22+
23+
public static class PatchMetadata {
24+
public final String name;
25+
public final String originalHash;
26+
public final String targetHash;
27+
public final String patchHash;
28+
29+
public PatchMetadata(String name, String originalHash, String targetHash, String patchHash) {
30+
this.name = name;
31+
this.originalHash = originalHash;
32+
this.targetHash = targetHash;
33+
this.patchHash = patchHash;
34+
}
35+
}
36+
37+
public static class Relocation implements Serializable {
38+
39+
public final String from;
40+
public final String to;
41+
public final boolean includeSubPackages;
42+
43+
public Relocation(String from, String to, boolean includeSubPackages) {
44+
Objects.requireNonNull(from);
45+
Objects.requireNonNull(to);
46+
this.from = from.replaceAll("\\.", "/");
47+
this.to = to.replaceAll("\\.", "/");
48+
this.includeSubPackages = includeSubPackages;
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)