Skip to content

Commit 5807e7b

Browse files
authored
feat: 1.21 support (#43)
1 parent 24cf7be commit 5807e7b

29 files changed

+674
-288
lines changed

.github/workflows/blob-build.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,28 @@ jobs:
1010
if: startsWith(github.event.head_commit.message, '[CI skip]') == false
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v4
14-
- name: Set up JDK 17
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up JDK 21
1517
uses: actions/setup-java@v4
1618
with:
17-
java-version: 17
19+
java-version: 21
1820
distribution: temurin
19-
- name: Build with Maven
20-
run: mvn package --file pom.xml
21+
22+
- name: Setup Gradle
23+
uses: gradle/actions/setup-gradle@v4
24+
25+
- name: Build with Gradle
26+
run: ./gradlew clean shadowJar
27+
28+
- name: Rename jar file
29+
run: mv build/libs/MobCapturer-*.jar build/libs/MobCapturer.jar
30+
2131
- name: Upload to Blob Builds
2232
uses: WalshyDev/blob-builds/gh-action@main
2333
with:
2434
project: MobCapturer
35+
file: ./build/libs/MobCapturer.jar
2536
apiToken: ${{ secrets.BLOB_BUILDS_API_TOKEN }}
2637
releaseNotes: ${{ github.event.head_commit.message }}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ jobs:
1313
if: startsWith(github.event.head_commit.message, '[CI skip]') == false
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v4
17-
- name: Set up JDK 17
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 21
1820
uses: actions/setup-java@v4
1921
with:
20-
java-version: 17
22+
java-version: 21
2123
distribution: temurin
22-
- name: Build with Maven
23-
run: mvn package --file pom.xml
24+
25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
28+
- name: Build with Gradle
29+
run: ./gradlew clean shadowJar

.gitignore

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
1-
/bin/
2-
/.settings/
3-
/target/
4-
/.idea/
5-
*.iml
1+
.gradle
2+
**/build/
3+
!src/**/build/
4+
5+
# Ignore Gradle GUI config
6+
gradle-app.setting
7+
8+
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
9+
!gradle-wrapper.jar
10+
11+
# Avoid ignore Gradle wrappper properties
12+
!gradle-wrapper.properties
13+
14+
# Cache of project
15+
.gradletasknamecache
16+
17+
# Eclipse Gradle plugin generated files
18+
# Eclipse Core
619
.project
20+
# JDT-specific (Eclipse Java Development Tools)
721
.classpath
8-
dependency-reduced-pom.xml
22+
23+
.idea/
24+
vscode/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ The captured mobs will retain attributes, potion effects, fire ticks, custom nam
1515
## :floppy_disk: Download MobCapturer
1616
You can download MobCapturer right here: [Dev Builds](https://blob.build/project/MobCapturer)
1717

18+
### Requirements
19+
20+
- Java 21+
21+
- Minecraft 1.18+
1822

1923
## :gear: config
2024
You can change the following settings in `config.yml`:

build.gradle.kts

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
plugins {
2+
id("java")
3+
id("maven-publish")
4+
id("io.freefair.lombok") version "8.7.1"
5+
id("com.gradleup.shadow") version "8.3.0"
6+
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
7+
}
8+
9+
repositories {
10+
mavenLocal()
11+
mavenCentral()
12+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
13+
maven("https://repo.papermc.io/repository/maven-public/")
14+
maven("https://jitpack.io")
15+
}
16+
17+
dependencies {
18+
compileOnly("io.papermc.paper:paper-api:1.21-R0.1-SNAPSHOT")
19+
compileOnly("com.github.Slimefun:Slimefun4:RC-37")
20+
implementation("org.bstats:bstats-bukkit:3.0.3")
21+
implementation("com.google.code.findbugs:jsr305:3.0.2")
22+
implementation("net.guizhanss:guizhanlib-all:2.0.0-SNAPSHOT")
23+
}
24+
25+
group = "io.github.thebusybiscuit"
26+
version = "UNOFFICIAL"
27+
description = "MobCapturer"
28+
29+
java {
30+
sourceCompatibility = JavaVersion.VERSION_21
31+
}
32+
33+
publishing {
34+
publications.create<MavenPublication>("maven") {
35+
from(components["java"])
36+
}
37+
}
38+
39+
tasks.compileJava {
40+
options.encoding = "UTF-8"
41+
}
42+
43+
tasks.javadoc {
44+
options.encoding = "UTF-8"
45+
}
46+
47+
tasks.shadowJar {
48+
fun doRelocate(from: String) {
49+
val last = from.split(".").last()
50+
relocate(from, "io.github.thebusybiscuit.mobcapturer.libs.$last")
51+
}
52+
doRelocate("org.bstats")
53+
doRelocate("javax.annotation")
54+
doRelocate("io.papermc.paperlib")
55+
minimize()
56+
archiveClassifier = ""
57+
}
58+
59+
bukkit {
60+
main = "io.github.thebusybiscuit.mobcapturer.MobCapturer"
61+
apiVersion = "1.18"
62+
authors = listOf("TheBusyBiscuit", "ybw0014")
63+
description = "A Slimefun Addon that adds a tool that allows you to capture mobs"
64+
website = "https://github.com/Slimefun-Addon-Community/MobCapturer"
65+
depend = listOf("Slimefun")
66+
}

gradle/wrapper/gradle-wrapper.jar

42.4 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)