Skip to content

Commit 21f5bee

Browse files
authored
Initial commit
0 parents  commit 21f5bee

File tree

11 files changed

+570
-0
lines changed

11 files changed

+570
-0
lines changed

.github/workflows/gradle.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Build with Gradle
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
paths:
7+
- .github/workflows/gradle.yml
8+
- src/**
9+
pull_request:
10+
paths:
11+
- .github/workflows/gradle.yml
12+
- src/**
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: chmod +x gradlew
20+
- uses: actions/setup-java@v4
21+
with:
22+
java-version: '21'
23+
distribution: 'zulu'
24+
- name: Setup gradle
25+
uses: gradle/actions/setup-gradle@v4
26+
with:
27+
gradle-version: wrapper
28+
cache-overwrite-existing: true
29+
cache-read-only: false
30+
build-scan-publish: true
31+
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
32+
build-scan-terms-of-use-agree: "yes"
33+
- name: Build
34+
run: ./gradlew shadowJar
35+
- name: Upload Artifact
36+
uses: actions/upload-artifact@v4
37+
if: success() && contains(github.ref_name, 'master')
38+
with:
39+
path: build/libs/*.jar

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea
9+
*.iws
10+
*.iml
11+
*.ipr
12+
out/
13+
!**/src/main/**/out/
14+
!**/src/test/**/out/
15+
16+
### Eclipse ###
17+
.apt_generated
18+
.classpath
19+
.factorypath
20+
.project
21+
.settings
22+
.springBeans
23+
.sts4-cache
24+
bin/
25+
!**/src/main/**/bin/
26+
!**/src/test/**/bin/
27+
28+
### NetBeans ###
29+
/nbproject/private/
30+
/nbbuild/
31+
/dist/
32+
/nbdist/
33+
/.nb-gradle/
34+
35+
### VS Code ###
36+
.vscode/
37+
38+
### Mac OS ###
39+
.DS_Store

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 AllayMC
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Allay Java Plugin Template
2+
3+
Welcome to the java plugin template for allay.
4+
5+
## Prerequisites
6+
7+
- Java21 or higher.
8+
- Allay installed.
9+
10+
## Getting Started
11+
12+
1. **Clone this Repository**
13+
14+
```bash
15+
git clone https://github.com/AllayMC/JavaPluginTemplate.git
16+
```
17+
18+
2. **Navigate to the Cloned Directory**
19+
20+
```bash
21+
cd JavaPluginTemplate
22+
```
23+
24+
3. **Change Plugin Information**
25+
26+
- Rename package name from `org.allaymc.javaplugintemplate` to `your.group.name.and.pluginname`
27+
- Update [build.gradle.kts](build.gradle.kts) and [settings.gradle.kts](settings.gradle.kts)
28+
- Reload gradle
29+
30+
4. **Build and Run Your Plugin**
31+
32+
```bash
33+
gradlew shadowJar
34+
```
35+
36+
This command will produce a `.jar` file in the `build/libs` directory.
37+
Copy the `.jar` file to the `plugins` directory of your allay server.
38+
Start the allay server and check the logs to ensure your plugin loads and operates
39+
as expected.
40+
41+
5. **Test Your Plugin in Gradle**
42+
43+
```bash
44+
gradlew runServer
45+
```
46+
47+
This command will start an allay server with your plugin loaded.
48+
Then close allay server by clicking `X` in the dashboard window.
49+
50+
## Documentation
51+
52+
For a deeper dive into the Allay API and its functionalities, please refer to our [documentation](https://docs.allaymc.org) (WIP).
53+
54+
## License
55+
56+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

build.gradle.kts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
plugins {
2+
id("java-library")
3+
id("org.allaymc.gradle.plugin") version "0.1.2"
4+
}
5+
6+
// TODO: Update the group to yours (should be same to the package of the plugin main class)
7+
group = "org.allaymc.javaplugintemplate"
8+
// TODO: Update the description to yours
9+
description = "Java plugin template for allay server"
10+
version = "0.1.0"
11+
12+
java {
13+
toolchain {
14+
languageVersion = JavaLanguageVersion.of(21)
15+
}
16+
}
17+
18+
// See also https://github.com/AllayMC/AllayGradle
19+
allay {
20+
// TODO: Update the api version to the latest
21+
// You can find the latest version here: https://central.sonatype.com/artifact/org.allaymc.allay/api
22+
api = "0.17.0"
23+
24+
plugin {
25+
// TODO: Update the entrance when you change your plugin main class
26+
// Same to `org.allaymc.javaplugintemplate.JavaPluginTemplate`
27+
entrance = ".JavaPluginTemplate"
28+
// TODO: Use your handsome name here
29+
authors += "YourNameHere"
30+
// TODO: Update the website to yours
31+
website = "https://github.com/AllayMC/JavaPluginTemplate"
32+
}
33+
}
34+
35+
dependencies {
36+
compileOnly(group = "org.projectlombok", name = "lombok", version = "1.18.34")
37+
annotationProcessor(group = "org.projectlombok", name = "lombok", version = "1.18.34")
38+
}

gradle/wrapper/gradle-wrapper.jar

42.6 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-9.1.0-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)