Skip to content

Commit 77409c1

Browse files
Update template to 1.20.5/.6 and few improvements (#47)
1 parent b6dc374 commit 77409c1

14 files changed

Lines changed: 379 additions & 42 deletions

File tree

.github/workflows/dev_build.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ jobs:
55
build:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
9-
- uses: actions/setup-java@v2
8+
- name: Checkout Repository
9+
uses: actions/checkout@v4
10+
- name: Wrapper Validation
11+
uses: gradle/actions/wrapper-validation@v3
12+
- name: Set up Java
13+
uses: actions/setup-java@v4
1014
with:
11-
java-version: 17
15+
java-version: 21
1216
distribution: adopt
13-
- name: Build
17+
- name: Build with Gradle
1418
run: ./gradlew build
1519
- name: Release
1620
uses: marvinpinto/action-automatic-releases@latest

.github/workflows/pull_request.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
name: Build Pull Request
1+
name: Build Pull Request Artifacts
22
on: pull_request
33

44
jobs:
55
build:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
9-
- uses: actions/setup-java@v2
8+
- name: Checkout Repository
9+
uses: actions/checkout@v4
10+
- name: Wrapper Validation
11+
uses: gradle/actions/wrapper-validation@v3
12+
- name: Set up Java
13+
uses: actions/setup-java@v4
1014
with:
11-
java-version: 17
15+
java-version: 21
1216
distribution: adopt
13-
- name: Build
17+
- name: Build with Gradle
1418
run: ./gradlew build
15-
- name: Upload artifacts
16-
uses: actions/upload-artifact@v2.2.4
19+
- name: Release
20+
uses: actions/upload-artifact@v4
1721
with:
18-
name: build-artifacts
19-
path: build/libs
22+
name: Artifacts
23+
path: build/libs/

LICENSE

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Creative Commons Legal Code
2+
3+
CC0 1.0 Universal
4+
5+
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6+
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7+
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8+
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9+
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10+
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11+
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12+
HEREUNDER.
13+
14+
Statement of Purpose
15+
16+
The laws of most jurisdictions throughout the world automatically confer
17+
exclusive Copyright and Related Rights (defined below) upon the creator
18+
and subsequent owner(s) (each and all, an "owner") of an original work of
19+
authorship and/or a database (each, a "Work").
20+
21+
Certain owners wish to permanently relinquish those rights to a Work for
22+
the purpose of contributing to a commons of creative, cultural and
23+
scientific works ("Commons") that the public can reliably and without fear
24+
of later claims of infringement build upon, modify, incorporate in other
25+
works, reuse and redistribute as freely as possible in any form whatsoever
26+
and for any purposes, including without limitation commercial purposes.
27+
These owners may contribute to the Commons to promote the ideal of a free
28+
culture and the further production of creative, cultural and scientific
29+
works, or to gain reputation or greater distribution for their Work in
30+
part through the use and efforts of others.
31+
32+
For these and/or other purposes and motivations, and without any
33+
expectation of additional consideration or compensation, the person
34+
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35+
is an owner of Copyright and Related Rights in the Work, voluntarily
36+
elects to apply CC0 to the Work and publicly distribute the Work under its
37+
terms, with knowledge of his or her Copyright and Related Rights in the
38+
Work and the meaning and intended legal effect of CC0 on those rights.
39+
40+
1. Copyright and Related Rights. A Work made available under CC0 may be
41+
protected by copyright and related or neighboring rights ("Copyright and
42+
Related Rights"). Copyright and Related Rights include, but are not
43+
limited to, the following:
44+
45+
i. the right to reproduce, adapt, distribute, perform, display,
46+
communicate, and translate a Work;
47+
ii. moral rights retained by the original author(s) and/or performer(s);
48+
iii. publicity and privacy rights pertaining to a person's image or
49+
likeness depicted in a Work;
50+
iv. rights protecting against unfair competition in regards to a Work,
51+
subject to the limitations in paragraph 4(a), below;
52+
v. rights protecting the extraction, dissemination, use and reuse of data
53+
in a Work;
54+
vi. database rights (such as those arising under Directive 96/9/EC of the
55+
European Parliament and of the Council of 11 March 1996 on the legal
56+
protection of databases, and under any national implementation
57+
thereof, including any amended or successor version of such
58+
directive); and
59+
vii. other similar, equivalent or corresponding rights throughout the
60+
world based on applicable law or treaty, and any national
61+
implementations thereof.
62+
63+
2. Waiver. To the greatest extent permitted by, but not in contravention
64+
of, applicable law, Affirmer hereby overtly, fully, permanently,
65+
irrevocably and unconditionally waives, abandons, and surrenders all of
66+
Affirmer's Copyright and Related Rights and associated claims and causes
67+
of action, whether now known or unknown (including existing as well as
68+
future claims and causes of action), in the Work (i) in all territories
69+
worldwide, (ii) for the maximum duration provided by applicable law or
70+
treaty (including future time extensions), (iii) in any current or future
71+
medium and for any number of copies, and (iv) for any purpose whatsoever,
72+
including without limitation commercial, advertising or promotional
73+
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74+
member of the public at large and to the detriment of Affirmer's heirs and
75+
successors, fully intending that such Waiver shall not be subject to
76+
revocation, rescission, cancellation, termination, or any other legal or
77+
equitable action to disrupt the quiet enjoyment of the Work by the public
78+
as contemplated by Affirmer's express Statement of Purpose.
79+
80+
3. Public License Fallback. Should any part of the Waiver for any reason
81+
be judged legally invalid or ineffective under applicable law, then the
82+
Waiver shall be preserved to the maximum extent permitted taking into
83+
account Affirmer's express Statement of Purpose. In addition, to the
84+
extent the Waiver is so judged Affirmer hereby grants to each affected
85+
person a royalty-free, non transferable, non sublicensable, non exclusive,
86+
irrevocable and unconditional license to exercise Affirmer's Copyright and
87+
Related Rights in the Work (i) in all territories worldwide, (ii) for the
88+
maximum duration provided by applicable law or treaty (including future
89+
time extensions), (iii) in any current or future medium and for any number
90+
of copies, and (iv) for any purpose whatsoever, including without
91+
limitation commercial, advertising or promotional purposes (the
92+
"License"). The License shall be deemed effective as of the date CC0 was
93+
applied by Affirmer to the Work. Should any part of the License for any
94+
reason be judged legally invalid or ineffective under applicable law, such
95+
partial invalidity or ineffectiveness shall not invalidate the remainder
96+
of the License, and in such case Affirmer hereby affirms that he or she
97+
will not (i) exercise any of his or her remaining Copyright and Related
98+
Rights in the Work or (ii) assert any associated claims and causes of
99+
action with respect to the Work, in either case contrary to Affirmer's
100+
express Statement of Purpose.
101+
102+
4. Limitations and Disclaimers.
103+
104+
a. No trademark or patent rights held by Affirmer are waived, abandoned,
105+
surrendered, licensed or otherwise affected by this document.
106+
b. Affirmer offers the Work as-is and makes no representations or
107+
warranties of any kind concerning the Work, express, implied,
108+
statutory or otherwise, including without limitation warranties of
109+
title, merchantability, fitness for a particular purpose, non
110+
infringement, or the absence of latent or other defects, accuracy, or
111+
the present or absence of errors, whether or not discoverable, all to
112+
the greatest extent permissible under applicable law.
113+
c. Affirmer disclaims responsibility for clearing rights of other persons
114+
that may apply to the Work or any use thereof, including without
115+
limitation any person's Copyright and Related Rights in the Work.
116+
Further, Affirmer disclaims responsibility for obtaining any necessary
117+
consents, permissions or other rights required for any use of the
118+
Work.
119+
d. Affirmer understands and acknowledges that Creative Commons is not a
120+
party to this document and has no duty or obligation with respect to
121+
this CC0 or use of the Work.

README.md

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,80 @@
22

33
A template to allow easy usage of the Meteor Addon API.
44

5-
### How to use:
5+
### How to use
6+
67
- Clone this project
78
- Use this template to create new modules/commands
8-
- Run the mod with Meteor.
9+
- Build the executable using the gradle `build` task.
10+
- Run the mod with Meteor.
11+
12+
### Project structure
13+
14+
```text
15+
.
16+
│── .github
17+
│ ╰── workflows
18+
│ │── dev_build.yml
19+
│ ╰── pull_request.yml
20+
│── gradle
21+
│ ╰── wrapper
22+
│ │── gradle-wrapper.jar
23+
│ ╰── gradle-wrapper.properties
24+
│── src
25+
│ ╰── main
26+
│ │── java
27+
│ │ ╰── com
28+
│ │ ╰── example
29+
│ │ ╰── addon
30+
│ │ │── commands
31+
│ │ │ ╰── CommandExample
32+
│ │ │── hud
33+
│ │ │ ╰── HudExample
34+
│ │ │── modules
35+
│ │ │ ╰── ModuleExample
36+
│ │ ╰── AddonTemplate
37+
│ ╰── resources
38+
│ │── assets
39+
│ │ ╰── template
40+
│ │ ╰── icon.png
41+
│ │── addon-template.mixins.json
42+
│ ╰── fabric.mod.json
43+
│── .editorconfig
44+
│── .gitignore
45+
│── build.gradle
46+
│── gradle.properties
47+
│── gradlew
48+
│── gradlew.bat
49+
│── LICENSE
50+
│── README.md
51+
╰── settings.gradle
52+
```
53+
54+
This is the default project structure. Each folder/file has a specific purpose.
55+
Here is a brief explanation of the ones you might need to modify:
56+
57+
- `.github/workflows`: Contains the GitHub Actions configuration files.
58+
- `gradle`: Contains the Gradle wrapper files.
59+
Edit the `gradle.properties` file to change the version of the Gradle wrapper.
60+
- `src/main/java/com/example/addon`: Contains the main class of the addon.
61+
Here you can register your custom commands, modules, and HUDs.
62+
Edit the `getPackage` method to reflect the package of your addon.
63+
- `src/main/resources`: Contains the resources of the addon.
64+
- `assets`: Contains the assets of the addon.
65+
You can add your own assets here, separated in subfolders.
66+
- `template`: Contains the assets of the template.
67+
You can replace the `icon.png` file with your own addon icon.
68+
Also, rename this folder to reflect the name of your addon.
69+
- `addon-template.mixins.json`: Contains the Mixin configuration for the addon.
70+
You can add your own mixins in the `client` array.
71+
- `fabric.mod.json`: Contains the metadata of the addon.
72+
Edit the various fields to reflect the metadata of your addon.
73+
- `build.gradle`: Contains the Gradle build script.
74+
You can manage the dependencies of the addon here.
75+
Remember to keep the `fabric-loom` version up-to-date.
76+
- `gradle.properties`: Contains the properties of the Gradle build.
77+
These will be used by the build script.
78+
- `LICENSE`: Contains the license of the addon.
79+
You can edit this file to change the license of your addon.
80+
- `README.md`: Contains the documentation of the addon.
81+
You can edit this file to reflect the documentation of your addon, and showcase its features.

build.gradle

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ plugins {
22
id "fabric-loom" version "1.6-SNAPSHOT"
33
}
44

5-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
6-
7-
archivesBaseName = project.archives_base_name
8-
version = project.mod_version
9-
group = project.maven_group
5+
base {
6+
archivesBaseName = project.archives_base_name
7+
version = project.mod_version
8+
group = project.maven_group
9+
}
1010

1111
repositories {
1212
maven {
@@ -29,12 +29,31 @@ dependencies {
2929
modImplementation "meteordevelopment:meteor-client:${project.meteor_version}"
3030
}
3131

32-
processResources {
33-
filesMatching("fabric.mod.json") {
34-
expand "version": project.version, "mc_version": project.minecraft_version
32+
tasks {
33+
processResources {
34+
def propertyMap = [
35+
"version" : project.version,
36+
"mc_version": project.minecraft_version,
37+
]
38+
39+
filesMatching("fabric.mod.json") {
40+
expand(propertyMap)
41+
}
3542
}
36-
}
3743

38-
tasks.withType(JavaCompile).configureEach {
39-
it.options.encoding("UTF-8")
44+
jar {
45+
from("LICENSE") {
46+
rename { "${it}_${project.base.archivesBaseName}" }
47+
}
48+
}
49+
50+
java {
51+
sourceCompatibility = JavaVersion.VERSION_21
52+
targetCompatibility = JavaVersion.VERSION_21
53+
}
54+
55+
tasks.withType(JavaCompile).configureEach {
56+
it.options.encoding = "UTF-8"
57+
it.options.release = 21
58+
}
4059
}

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
org.gradle.jvmargs=-Xmx2G
22

33
# Fabric Properties (https://fabricmc.net/develop)
4-
minecraft_version=1.20.4
5-
yarn_mappings=1.20.4+build.2
6-
loader_version=0.15.1
4+
minecraft_version=1.20.6
5+
yarn_mappings=1.20.6+build.1
6+
loader_version=0.15.10
77

88
# Mod Properties
99
mod_version=0.1.0
@@ -13,4 +13,4 @@ archives_base_name=addon-template
1313
# Dependencies
1414

1515
# Meteor (https://maven.meteordev.org)
16-
meteor_version=0.5.6-SNAPSHOT
16+
meteor_version=0.5.7-SNAPSHOT
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

src/main/java/com/example/addon/Addon.java renamed to src/main/java/com/example/addon/AddonTemplate.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import com.example.addon.hud.HudExample;
55
import com.example.addon.modules.ModuleExample;
66
import com.mojang.logging.LogUtils;
7+
import meteordevelopment.meteorclient.addons.GithubRepo;
78
import meteordevelopment.meteorclient.addons.MeteorAddon;
89
import meteordevelopment.meteorclient.commands.Commands;
910
import meteordevelopment.meteorclient.systems.hud.Hud;
@@ -12,7 +13,7 @@
1213
import meteordevelopment.meteorclient.systems.modules.Modules;
1314
import org.slf4j.Logger;
1415

15-
public class Addon extends MeteorAddon {
16+
public class AddonTemplate extends MeteorAddon {
1617
public static final Logger LOG = LogUtils.getLogger();
1718
public static final Category CATEGORY = new Category("Example");
1819
public static final HudGroup HUD_GROUP = new HudGroup("Example");
@@ -40,4 +41,9 @@ public void onRegisterCategories() {
4041
public String getPackage() {
4142
return "com.example.addon";
4243
}
44+
45+
@Override
46+
public GithubRepo getRepo() {
47+
return new GithubRepo("MeteorDevelopment", "meteor-addon-template");
48+
}
4349
}

0 commit comments

Comments
 (0)