Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit fc1d17b

Browse files
author
Shynixn
committed
#112 Implemented 1.20.0 support.
1 parent 81c324a commit fc1d17b

File tree

15 files changed

+1120
-26
lines changed

15 files changed

+1120
-26
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ RUN java -jar BuildTools.jar --rev 1.18.2 --remapped
2929
RUN java -jar BuildTools.jar --rev 1.19 --remapped
3030
RUN java -jar BuildTools.jar --rev 1.19.3 --remapped
3131
RUN java -jar BuildTools.jar --rev 1.19.4 --remapped
32+
RUN java -jar BuildTools.jar --rev 1.20 --remapped
3233

3334
# 3. Build plugin for 1.8 - 1.17 with jdk17
3435
FROM amazoncorretto:17 AS plugin-jdk17
@@ -46,7 +47,7 @@ RUN ./gradlew build pluginJar --no-daemon
4647
# 4. Launch a minecraft server with jdk17 and plugin
4748
FROM amazoncorretto:17
4849
# Change to the current plugin version present in build.gradle
49-
ENV PLUGIN_VERSION=2.10.0
50+
ENV PLUGIN_VERSION=2.11.0
5051
# Change to the server version you want to test.
5152
ENV SERVER_VERSION=spigot-1.19.4.jar
5253
# Port of the Minecraft Server.

README.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ StructureBlockLib is a bukkit API and implementation for handling structures on
1717
* API to save or load structures without an actual structure block.
1818
* Asynchronous implementation and API.
1919
* Fluent API.
20-
* Version support 1.9.R1 - 1.19.R3
20+
* Version support 1.9.R1 - 1.20.R1
2121
* Java support 8 - Latest
2222

23-
## Donation
24-
25-
Support development with a small tip :heart: :coffee:.
26-
27-
* Dogecoin Address: ``DAzt6RGAapkhbKD9uFKJgSR5vpfT9nSvKi``
28-
2923
## Installation
3024

3125
1. Include the dependency to StructureBlockLib
@@ -35,15 +29,15 @@ Support development with a small tip :heart: :coffee:.
3529
<dependency>
3630
<groupId>com.github.shynixn.structureblocklib</groupId>
3731
<artifactId>structureblocklib-bukkit-api</artifactId>
38-
<version>2.10.0</version>
32+
<version>2.11.0</version>
3933
<scope>provided</scope>
4034
</dependency>
4135
```
4236
**Gradle**
4337

4438
```xml
4539
dependencies {
46-
compileOnly("com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.10.0")
40+
compileOnly("com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.11.0")
4741
}
4842
```
4943

@@ -277,8 +271,8 @@ structureBlock.update();
277271
**plugin.yml**
278272
```yaml
279273
libraries:
280-
- com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.10.0
281-
- com.github.shynixn.structureblocklib:structureblocklib-bukkit-core:2.10.0
274+
- com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.11.0
275+
- com.github.shynixn.structureblocklib:structureblocklib-bukkit-core:2.11.0
282276
```
283277
284278
### For version < 1.17
@@ -297,22 +291,22 @@ go with the option above instead. There are several tutorials on spigotmc.org.
297291
<dependency>
298292
<groupId>com.github.shynixn.structureblocklib</groupId>
299293
<artifactId>structureblocklib-bukkit-api</artifactId>
300-
<version>2.10.0</version>
294+
<version>2.11.0</version>
301295
<scope>compile</scope>
302296
</dependency>
303297
<dependency>
304298
<groupId>com.github.shynixn.structureblocklib</groupId>
305299
<artifactId>structureblocklib-bukkit-core</artifactId>
306-
<version>2.10.0</version>
300+
<version>2.11.0</version>
307301
<scope>compile</scope>
308302
</dependency>
309303
```
310304
**Gradle**
311305

312306
```xml
313307
dependencies {
314-
implementation("com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.10.0")
315-
implementation("com.github.shynixn.structureblocklib:structureblocklib-bukkit-core:2.10.0")
308+
implementation("com.github.shynixn.structureblocklib:structureblocklib-bukkit-api:2.11.0")
309+
implementation("com.github.shynixn.structureblocklib:structureblocklib-bukkit-core:2.11.0")
316310
}
317311
```
318312

@@ -322,7 +316,7 @@ dependencies {
322316

323317
* Install Java 17 or higher
324318
* Fork the StructureBlockLib project on github and clone it to your local environment.
325-
* StructureBlockLib requires spigot server implementations from 1.9.4 to 1.18.2 to be correctly installed in your local Maven cache.
319+
* StructureBlockLib requires spigot server implementations from 1.9.4 to 1.20 to be correctly installed in your local Maven cache.
326320
As this requires multiple java version to build different versions, a Dockerfile is provided to build these dependencies in a docker container
327321
and then copy it to your local Maven cache.
328322

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tasks.register("printVersion") {
4444

4545
subprojects {
4646
group 'com.github.shynixn.structureblocklib'
47-
version '2.10.0'
47+
version '2.11.0'
4848

4949
apply plugin: 'kotlin-platform-jvm'
5050
apply plugin: 'signing'

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ include("structureblocklib-bukkit-core:bukkit-nms-118R2")
1919
include("structureblocklib-bukkit-core:bukkit-nms-119R1")
2020
include("structureblocklib-bukkit-core:bukkit-nms-119R2")
2121
include("structureblocklib-bukkit-core:bukkit-nms-119R3")
22+
include("structureblocklib-bukkit-core:bukkit-nms-120R1")

structureblocklib-api/src/main/java/com/github/shynixn/structureblocklib/api/enumeration/Version.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ public enum Version {
8484
/**
8585
* Version 1.19.4 - 1.19.4.
8686
*/
87-
VERSION_1_19_R3("v1_19_R3", "1.19.4", 1.194);
87+
VERSION_1_19_R3("v1_19_R3", "1.19.4", 1.194),
88+
89+
/**
90+
* Version 1.20 - 1.20.
91+
*/
92+
VERSION_1_20_R1("v1_20_R1", "1.20.0", 1.20);
8893

8994
private final String bukkitId;
9095
private final String id;

structureblocklib-bukkit-core/build.gradle.kts

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ tasks.withType<ShadowJar> {
1414
relocate("org.jetbrains", "com.github.shynixn.structureblocklib.lib.org.jetbrains")
1515
}
1616

17-
tasks.register("pluginJar", Exec::class.java) {
17+
tasks.register("pluginJarOperation1", Exec::class.java) {
18+
// Change the output folder of the plugin.
19+
// val destinationDir = File("C:/temp/plugins")
20+
val destinationDir = File(buildDir, "libs")
21+
1822
dependsOn("shadowJar")
1923
workingDir = buildDir
2024

@@ -40,7 +44,7 @@ tasks.register("pluginJar", Exec::class.java) {
4044
val shadowJar = tasks.findByName("shadowJar")!! as ShadowJar
4145
val sourceJarFile = File(buildDir, "libs/" + shadowJar.archiveName)
4246
val archiveName = "${shadowJar.baseName}-${shadowJar.version}.${shadowJar.extension}"
43-
val targetJarFile = File(buildDir, "libs/$archiveName")
47+
val targetJarFile = File(destinationDir, archiveName)
4448

4549
var obsMapping = createCommand(
4650
"1.17.1-R0.1-SNAPSHOT",
@@ -90,6 +94,60 @@ tasks.register("pluginJar", Exec::class.java) {
9094
targetJarFile,
9195
targetJarFile
9296
)
97+
obsMapping = "$obsMapping && " + createCommand(
98+
"1.20-R0.1-SNAPSHOT",
99+
"com/github/shynixn/structureblocklib/bukkit/v1_20_R1",
100+
file,
101+
shadowJar,
102+
targetJarFile,
103+
targetJarFile
104+
)
105+
106+
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")) {
107+
commandLine = listOf("cmd", "/c", obsMapping.replace("\$HOME", "%userprofile%"))
108+
} else {
109+
commandLine = listOf("sh", "-c", obsMapping)
110+
}
111+
}
112+
113+
tasks.register("pluginJar", Exec::class.java, ) {
114+
dependsOn("shadowJar","pluginJarOperation1")
115+
// Change the output folder of the plugin.
116+
//val destinationDir = File("C:/temp/plugins")
117+
val destinationDir = File(buildDir, "libs")
118+
workingDir = buildDir
119+
120+
if (!workingDir.exists()) {
121+
workingDir.mkdir();
122+
}
123+
124+
val folder = File(workingDir, "mapping")
125+
126+
if (!folder.exists()) {
127+
folder.mkdir()
128+
}
129+
130+
val file = File(folder, "SpecialSources.jar")
131+
132+
if (!file.exists()) {
133+
URL("https://repo.maven.apache.org/maven2/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0-shaded.jar").openStream()
134+
.use {
135+
Files.copy(it, file.toPath())
136+
}
137+
}
138+
139+
val shadowJar = tasks.findByName("shadowJar")!! as ShadowJar
140+
val archiveName = "${shadowJar.baseName}-${shadowJar.version}.${shadowJar.extension}"
141+
val targetJarFile = File(destinationDir, archiveName)
142+
143+
var obsMapping = createCommand(
144+
"1.20-R0.1-SNAPSHOT",
145+
"com/github/shynixn/structureblocklib/bukkit/v1_20_R1",
146+
file,
147+
shadowJar,
148+
targetJarFile,
149+
targetJarFile
150+
)
93151

94152
if (System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("windows")) {
95153
commandLine = listOf("cmd", "/c", obsMapping.replace("\$HOME", "%userprofile%"))
@@ -131,6 +189,7 @@ dependencies {
131189
implementation(project(":structureblocklib-bukkit-core:bukkit-nms-119R1"))
132190
implementation(project(":structureblocklib-bukkit-core:bukkit-nms-119R2"))
133191
implementation(project(":structureblocklib-bukkit-core:bukkit-nms-119R3"))
192+
implementation(project(":structureblocklib-bukkit-core:bukkit-nms-120R1"))
134193

135194
compileOnly("org.spigotmc:spigot:1.14.4-R0.1-SNAPSHOT")
136195
testCompile("org.spigotmc:spigot:1.12-R0.1-SNAPSHOT")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repositories {
2+
maven(url = "https://libraries.minecraft.net")
3+
}
4+
5+
dependencies {
6+
// Dependencies of spigot mojang want to restrict usage to only Java 17. However, we do not care
7+
// what they want because the general compatibility of this plugin is Java 8. The plugin
8+
// guarantees that everything works during runtime. This error is a false positive.
9+
components {
10+
all {
11+
allVariants {
12+
attributes {
13+
attribute(TargetJvmVersion.TARGET_JVM_VERSION_ATTRIBUTE, 8)
14+
}
15+
}
16+
}
17+
}
18+
19+
implementation(project(":structureblocklib-api"))
20+
implementation(project(":structureblocklib-core"))
21+
implementation(project(":structureblocklib-bukkit-api"))
22+
compileOnly("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT:remapped-mojang")
23+
testCompile("org.spigotmc:spigot:1.20-R0.1-SNAPSHOT:remapped-mojang")
24+
}

0 commit comments

Comments
 (0)