Skip to content

Commit be73186

Browse files
Merge pull request #26 from TeamKun/develop
feat: Support 1.17.x and other changes
2 parents f563e0a + feacbec commit be73186

File tree

155 files changed

+5490
-383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+5490
-383
lines changed

.github/workflows/build-nms.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,28 @@ jobs:
2929
strategy:
3030
matrix:
3131
nms-version:
32-
- 1.16.5
33-
- 1.16.3
34-
- 1.15.2
35-
- 1.14.4
36-
- 1.13.2
37-
- "1.13"
32+
- 1.17.1 # v1_17_R1
33+
- 1.16.5 # v1_16_R3
34+
- 1.16.3 # v1_16_R2
35+
- 1.16.1 # v1_16_R1
36+
- 1.15.2 # v1_15_R1
37+
- 1.14.4 # v1_14_R1
38+
- 1.13.2 # v1_13_R2
39+
- "1.13" # v1_13_R1
3840
runs-on: ubuntu-latest
3941
steps:
40-
- name: Build NMS if cache miss
41-
uses: PeyaPeyaPeyang/nmsaction@v9
42-
with:
43-
rev: ${{ matrix.nms-version }}
4442
- name: Cache NMS
43+
id: cache-nms-per-version
4544
uses: actions/cache@v4
4645
with:
4746
path: nms-build/.m2
4847
key: nms-maven-${{ matrix.nms-version }}
48+
lookup-only: true
49+
- name: Build NMS if cache miss
50+
if: steps.cache-nms-per-version.outputs.cache-hit != 'true'
51+
uses: PeyaPeyaPeyang/nmsaction@v9
52+
with:
53+
rev: ${{ matrix.nms-version }}
4954
collect-to-one-artifact:
5055
name: Collect to one artifact
5156
runs-on: ubuntu-latest
@@ -63,8 +68,10 @@ jobs:
6368
const gh = require('@actions/github');
6469
const path = require('path');
6570
const nmsVersions = [
71+
'1.17.1',
6672
'1.16.5',
6773
'1.16.3',
74+
'1.16.1',
6875
'1.15.2',
6976
'1.14.4',
7077
'1.13.2',

.github/workflows/build-scenamatica.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- name: Change directory to scenamatica
1515
run: cd Scenamatica
16-
- name: Set up JDK 8
16+
- name: Set up JDK 17
1717
uses: actions/setup-java@v4
1818
id: maven-cache
1919
with:
20-
java-version: 8
20+
java-version: 17
2121
distribution: zulu
2222
cache: maven
2323
- name: Set up Maven
@@ -33,7 +33,7 @@ jobs:
3333
- name: Deploy NMS cache
3434
if: steps.maven-cache.outputs.cache-hit != 'true'
3535
run: |
36-
mv -f nms-build/.m2/repository $HOME/.m2/ -v
36+
mv -f nms-build/.m2/repository/repository $HOME/.m2/ -v
3737
- name: Build with Maven
3838
run: |
3939
cd Scenamatica

.github/workflows/codeql-analysis.yml

Lines changed: 12 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,10 @@ on:
2727

2828
jobs:
2929
setup-nms:
30-
name: Build NMS with NMSAction
31-
strategy:
32-
matrix:
33-
nms-version:
34-
- 1.16.5
35-
- 1.16.3
36-
- 1.15.2
37-
- 1.14.4
38-
- 1.13.2
39-
- "1.13"
40-
runs-on: ubuntu-latest
41-
steps:
42-
- name: Try to restore caches
43-
uses: actions/cache@v4
44-
id: restore-cache
45-
with:
46-
path: nms-build/.m2
47-
key: nms-maven-${{ matrix.nms-version }}
48-
restore-keys: |
49-
nms-maven-${{ matrix.nms-version }}
50-
lookup-only: true
51-
- name: Build NMS if cache miss
52-
if: steps.restore-cache.outputs.cache-hit != 'true'
53-
uses: PeyaPeyaPeyang/nmsaction@v9
54-
with:
55-
rev: ${{ matrix.nms-version }}
56-
- name: Save caches
57-
if: steps.restore-cache.outputs.cache-hit != 'true'
58-
uses: actions/cache@v4
59-
with:
60-
path: nms-build/.m2
61-
key: nms-maven-${{ matrix.nms-version }}
30+
name: Setup NMS
31+
uses: "./.github/workflows/build-nms.yml"
32+
secrets:
33+
token: ${{ secrets.GITHUB_TOKEN }}
6234
build-and-analyze:
6335
name: Build with Maven
6436
runs-on: ubuntu-latest
@@ -78,52 +50,25 @@ jobs:
7850
uses: stCarolas/setup-maven@v5
7951
with:
8052
maven-version: 3.8.2
81-
- uses: actions/setup-node@v4
82-
if: steps.maven-cache.outputs.cache-hit != 'true'
83-
with:
84-
node-version: '20.x'
85-
- run: npm install @actions/cache
86-
if: steps.maven-cache.outputs.cache-hit != 'true'
8753
- name: Restore NMS cache
88-
uses: actions/github-script@v7
89-
if: steps.maven-cache.outputs.cache-hit != 'true'
54+
uses: actions/cache@v4
9055
with:
91-
script: |
92-
const cache = require('@actions/cache');
93-
const path = require('path');
94-
const nmsVersions = [
95-
'1.16.5',
96-
'1.16.3',
97-
'1.15.2',
98-
'1.14.4',
99-
'1.13.2',
100-
'1.13'
101-
];
102-
for (const nmsVersion of nmsVersions) {
103-
const key = `nms-maven-${nmsVersion}`;
104-
const cacheKey = await cache.restoreCache(
105-
['nms-build/.m2'],
106-
key,
107-
nmsVersions
108-
);
109-
if (cacheKey) {
110-
console.log(`Cache restored from key: ${cacheKey}`);
111-
} else {
112-
console.error(`Cache not found for key: ${key}`);
113-
process.exit(1);
114-
}
115-
}
56+
path: nms-build/.m2
57+
key: nms-maven
58+
restore-keys: nms-maven
11659
- name: Deploy NMS cache
11760
if: steps.maven-cache.outputs.cache-hit != 'true'
11861
run: |
119-
mv -f nms-build/.m2/repository/repository $HOME/.m2/ -v
62+
mv -f nms-build/.m2/repository $HOME/.m2/ -v
12063
# Initializes the CodeQL tools for scanning.
12164
- name: Initialize CodeQL
12265
uses: github/codeql-action/init@v3
12366
with:
12467
languages: java
12568
- name: Build with Maven
12669
run: |
127-
mvn -B package --file Scenamatica/pom.xml -D"jar.finalName=Scenamatica" -P debug
70+
cd Scenamatica
71+
chmod +x build.sh
72+
./build.sh -D"jar.finalName=Scenamatica" -P debug
12873
- name: Perform CodeQL Analysis
12974
uses: github/codeql-action/analyze@v3

.github/workflows/scenamatica-build-and-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
include:
37+
- minecraft: 1.17.1
38+
java: 16
3739
- minecraft: 1.16.5
3840
java: 16
3941
- minecraft: 1.15.2

Scenamatica/.idea/compiler.xml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scenamatica/.idea/encodings.xml

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scenamatica/.idea/misc.xml

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Scenamatica/NMSBridge/NMSCore/pom.xml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.kunlab.scenamatica</groupId>
88
<artifactId>NMSBridge</artifactId>
9-
<version>1.4.1</version>
9+
<version>1.5.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

@@ -23,44 +23,56 @@
2323
<dependency>
2424
<groupId>org.kunlab.scenamatica.nms</groupId>
2525
<artifactId>NMSTypes</artifactId>
26-
<version>1.4.1</version>
26+
<version>1.5.0</version>
2727
</dependency>
2828

2929
<!-- NMS Implementions -->
3030
<dependency>
3131
<groupId>org.kunlab.scenamatica.nms</groupId>
3232
<artifactId>v1_13_R1</artifactId>
33-
<version>1.4.1</version>
33+
<version>1.5.0</version>
3434
<scope>compile</scope>
3535
</dependency>
3636
<dependency>
3737
<groupId>org.kunlab.scenamatica.nms</groupId>
3838
<artifactId>v1_13_R2</artifactId>
39-
<version>1.4.1</version>
39+
<version>1.5.0</version>
4040
<scope>compile</scope>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.kunlab.scenamatica.nms</groupId>
4444
<artifactId>v1_14_R1</artifactId>
45-
<version>1.4.1</version>
45+
<version>1.5.0</version>
4646
<scope>compile</scope>
4747
</dependency>
4848
<dependency>
4949
<groupId>org.kunlab.scenamatica.nms</groupId>
5050
<artifactId>v1_15_R1</artifactId>
51-
<version>1.4.1</version>
51+
<version>1.5.0</version>
5252
<scope>compile</scope>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.kunlab.scenamatica.nms</groupId>
56-
<artifactId>v1_16_R3</artifactId>
57-
<version>1.4.1</version>
56+
<artifactId>v1_16_R1</artifactId>
57+
<version>1.5.0</version>
5858
<scope>compile</scope>
5959
</dependency>
6060
<dependency>
6161
<groupId>org.kunlab.scenamatica.nms</groupId>
6262
<artifactId>v1_16_R2</artifactId>
63-
<version>1.4.1</version>
63+
<version>1.5.0</version>
64+
<scope>compile</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.kunlab.scenamatica.nms</groupId>
68+
<artifactId>v1_16_R3</artifactId>
69+
<version>1.5.0</version>
70+
<scope>compile</scope>
71+
</dependency>
72+
<dependency>
73+
<groupId>org.kunlab.scenamatica.nms</groupId>
74+
<artifactId>v1_17_R1</artifactId>
75+
<version>1.5.0</version>
6476
<scope>compile</scope>
6577
</dependency>
6678
</dependencies>

Scenamatica/NMSBridge/NMSCore/src/main/java/org/kunlab/scenamatica/nms/NMSProvider.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,26 @@ private static void initAll()
6161
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_15_R1.TypeSupportImpl();
6262
provider = new org.kunlab.scenamatica.nms.impl.v1_15_R1.WrapperProviderImpl();
6363
break;
64-
case "v1_16_R3":
65-
registry = new org.kunlab.scenamatica.nms.impl.v1_16_R3.NMSRegistryImpl();
66-
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_16_R3.TypeSupportImpl();
67-
provider = new org.kunlab.scenamatica.nms.impl.v1_16_R3.WrapperProviderImpl();
64+
case "v1_16_R1":
65+
registry = new org.kunlab.scenamatica.nms.impl.v1_16_R1.NMSRegistryImpl();
66+
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_16_R1.TypeSupportImpl();
67+
provider = new org.kunlab.scenamatica.nms.impl.v1_16_R1.WrapperProviderImpl();
6868
break;
6969
case "v1_16_R2":
7070
registry = new org.kunlab.scenamatica.nms.impl.v1_16_R2.NMSRegistryImpl();
7171
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_16_R2.TypeSupportImpl();
7272
provider = new org.kunlab.scenamatica.nms.impl.v1_16_R2.WrapperProviderImpl();
7373
break;
74+
case "v1_16_R3":
75+
registry = new org.kunlab.scenamatica.nms.impl.v1_16_R3.NMSRegistryImpl();
76+
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_16_R3.TypeSupportImpl();
77+
provider = new org.kunlab.scenamatica.nms.impl.v1_16_R3.WrapperProviderImpl();
78+
break;
79+
case "v1_17_R1":
80+
registry = new org.kunlab.scenamatica.nms.impl.v1_17_R1.NMSRegistryImpl();
81+
typeSupport = new org.kunlab.scenamatica.nms.impl.v1_17_R1.TypeSupportImpl();
82+
provider = new org.kunlab.scenamatica.nms.impl.v1_17_R1.WrapperProviderImpl();
83+
break;
7484
default:
7585
throw new IllegalStateException("Unsupported server version: " + version);
7686
}

Scenamatica/NMSBridge/NMSTypes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.kunlab.scenamatica</groupId>
88
<artifactId>NMSBridge</artifactId>
9-
<version>1.4.1</version>
9+
<version>1.5.0</version>
1010
<relativePath>../pom.xml</relativePath>
1111
</parent>
1212

0 commit comments

Comments
 (0)