Skip to content

Commit eec81ae

Browse files
authored
Initial commit
0 parents  commit eec81ae

File tree

20 files changed

+1342
-0
lines changed

20 files changed

+1342
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/gradle.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
branches: [ "main" ]
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 17
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '17'
29+
distribution: 'temurin'
30+
31+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
32+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
36+
- name: Build with Gradle Wrapper
37+
run: ./gradlew build

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# gradle
2+
3+
.gradle/
4+
build/
5+
out/
6+
classes/
7+
8+
# eclipse
9+
10+
*.launch
11+
12+
# idea
13+
14+
.idea/
15+
*.iml
16+
*.ipr
17+
*.iws
18+
19+
# vscode
20+
21+
.settings/
22+
.vscode/
23+
bin/
24+
.classpath
25+
.project
26+
27+
# macos
28+
29+
*.DS_Store
30+
31+
run/
32+
run-data/

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# GregTech Addon Template
2+
## Template for GregTech Modern addons on 1.20.1
3+
4+
Original template by [screret](https://github.com/screret), updated by [JuiceyBeans](https://github.com/JuiceyBeans)
5+
6+
<hr>
7+
8+
## How do I make an addon for GregTech Modern?
9+
Well for one, you WILL need to know Java to make an addon. There's no getting around this. A good starting point would be [MOOC](https://java-programming.mooc.fi/) or [W3Schools](https://www.w3schools.com/java/
10+
)
11+
12+
Unfortunately, there isn't any official documentation so far for making GregTech Modern addons. There are a couple of mods you can look at to reference though!
13+
14+
Repositories for other addons:
15+
16+
- [CosmicCore](https://github.com/Frontiers-PackForge/CosmicCore)
17+
- [Gregtech: Extended Chemistry Extended](https://github.com/jmoiron/Gregtech-Extended-Chemistry)
18+
- [Juiceycality](https://github.com/JuiceyBeans/Juiceycality)
19+
- [Gregicality Rocketry](https://github.com/Argent-Matter/gcyr/)
20+
21+
Additionally, you may be able to find help on the [GregTech CEu Discord](https://discord.gg/bWSWuYvURP)!
22+
23+
<hr>
24+
25+
## This template comes packaged with [Spotless](https://github.com/diffplug/spotless)!
26+
27+
### 1. What is Spotless?
28+
- Spotless keeps your code neatly formatted. It's essentially a grammar check for your code!
29+
### 2. Can I choose not to use Spotless?
30+
- Yes! Spotless is completely optional and will not affect your project by default
31+
### 3. How do I run Spotless?
32+
- You can run Spotless anytime by:
33+
- Running the `spotlessApply` task from the Gradle tab in IntelliJ
34+
- Installing the [Spotless Gradle plugin for IntelliJ](https://plugins.jetbrains.com/plugin/18321-spotless-gradle)
35+
- Typing in `gradlew.bat :spotlessApply` if you're on Windows
36+
- Typing in `bash gradlew :spotlessApply` if you're on Linux
37+
### 4. So how do I check if Spotless has been applied to my code?
38+
- Running `spotlessApply` will format all files for you automatically! If you want GitHub to check each commit for if Spotless has been run, you can add [this](https://github.com/Frontiers-PackForge/CosmicCore/blob/main-1.20.1-forge/.github/workflows/spotless.yml) and [this](https://github.com/Frontiers-PackForge/CosmicCore/blob/main-1.20.1-forge/.github/actions/build_setup/action.yml) to your project

build.gradle

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
plugins {
2+
id "idea"
3+
id "maven-publish"
4+
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
5+
id 'org.parchmentmc.librarian.forgegradle' version '1.+'
6+
id 'com.diffplug.spotless' version '7.0.2'
7+
}
8+
9+
def generatedResources = file("src/generated")
10+
11+
sourceSets {
12+
main {
13+
resources.srcDir generatedResources
14+
}
15+
}
16+
17+
repositories {
18+
mavenLocal()
19+
mavenCentral()
20+
maven {
21+
name = 'GTCEu Maven'
22+
url = 'https://maven.gtceu.com'
23+
content {
24+
includeGroup 'com.gregtechceu.gtceu'
25+
}
26+
}
27+
maven {
28+
name 'FirstDarkDev'
29+
url "https://maven.firstdarkdev.xyz/snapshots/"
30+
}
31+
maven {
32+
// saps.dev Maven (KubeJS and Rhino)
33+
url = "https://maven.saps.dev/minecraft"
34+
content {
35+
includeGroup "dev.latvian.mods"
36+
}
37+
}
38+
maven { // Registrate
39+
url = "https://maven.tterrag.com/"
40+
content {
41+
// need to be specific here due to version overlaps
42+
includeGroup("com.tterrag.registrate")
43+
}
44+
}
45+
maven {
46+
// Patchouli, JEI
47+
name = "BlameJared"
48+
url = "https://maven.blamejared.com/"
49+
}
50+
maven {
51+
url = "https://maven.theillusivec4.top/"
52+
}
53+
maven {
54+
// Curse Forge File
55+
url "https://cursemaven.com/"
56+
content {
57+
includeGroup "curse.maven"
58+
}
59+
}
60+
maven {
61+
// EMI
62+
name = "TerraformersMC"
63+
url = "https://maven.terraformersmc.com/"
64+
}
65+
66+
maven {
67+
url = "https://maven.architectury.dev"
68+
}
69+
maven {
70+
url = "https://thedarkcolour.github.io/KotlinForForge/"
71+
}
72+
73+
}
74+
75+
version = mod_version
76+
group = maven_group
77+
base { archivesName = archives_base_name }
78+
java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 }
79+
sourceSets.main.resources { srcDir 'src/generated/resources' }
80+
81+
minecraft {
82+
mappings channel: mapping_channel, version: mapping_version
83+
copyIdeResources = true
84+
runs {
85+
configureEach {
86+
workingDirectory project.file('run')
87+
property 'forge.logging.markers', 'REGISTRIES'
88+
property 'forge.logging.console.level', 'debug'
89+
mods { "${mod_id}" { source sourceSets.main } }
90+
property 'mixin.env.remapRefMap', 'true'
91+
property 'mixin.env.refMapRemappingFile', "${buildDir}/createSrgToMcp/output.srg"
92+
}
93+
client { property 'forge.enabledGameTestNamespaces', mod_id }
94+
server { property 'forge.enabledGameTestNamespaces', mod_id; args '--nogui' }
95+
data {
96+
// example of overriding the workingDirectory set in configureEach above
97+
workingDirectory project.file('run-data')
98+
99+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
100+
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
101+
}
102+
}
103+
}
104+
105+
106+
apply from: "$rootDir/gradle/scripts/spotless.gradle"
107+
108+
dependencies {
109+
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
110+
111+
// JEI, EMI, Jade
112+
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
113+
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
114+
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
115+
runtimeOnly fg.deobf("dev.emi:emi-forge:${emi_version}+${minecraft_version}")
116+
runtimeOnly fg.deobf("curse.maven:jade-324717:5390389")
117+
118+
// GregTech and dependencies
119+
implementation fg.deobf("com.gregtechceu.gtceu:gtceu-${minecraft_version}:${gtceu_version}:slim") { transitive = false }
120+
implementation fg.deobf("com.lowdragmc.ldlib:ldlib-forge-${minecraft_version}:${ldlib_version}") { transitive = false }
121+
implementation fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}")
122+
implementation fg.deobf("dev.latvian.mods:kubejs-forge:${kubejs_version}")
123+
implementation fg.deobf("dev.latvian.mods:rhino-forge:${rhino_version}")
124+
runtimeOnly fg.deobf("dev.toma.configuration:configuration-forge-${minecraft_version}:${configuration_version}")
125+
runtimeOnly fg.deobf("dev.architectury:architectury-forge:${architectury_version}")
126+
127+
// lombok
128+
compileOnly 'org.projectlombok:lombok:1.18.24'
129+
annotationProcessor 'org.projectlombok:lombok:1.18.24'
130+
}
131+
132+
tasks.named('processResources', ProcessResources).configure {
133+
var properties = [
134+
"mod_license": mod_license,
135+
"mod_id": mod_id,
136+
"version": version,
137+
"mod_name": mod_name,
138+
"mod_url": mod_url,
139+
"mod_author": mod_author,
140+
"forge_version": forge_version.split("\\.")[0], // only specify major version of forge
141+
"minecraft_version": minecraft_version,
142+
"gtceu_version": gtceu_version,
143+
]
144+
inputs.properties(properties)
145+
146+
filesMatching("META-INF/mods.toml") {
147+
expand properties + [project: project]
148+
}
149+
}
150+
151+
tasks.named('jar', Jar).configure { finalizedBy 'reobfJar' }
152+
tasks.withType(JavaCompile).configureEach {
153+
// ensure that the encoding is set to UTF-8, no matter what the system default is
154+
// this fixes some edge cases with special characters not displaying correctly
155+
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
156+
// If Javadoc is generated, this must be specified in that task too.
157+
options.encoding = "UTF-8"
158+
options.release.set(17)
159+
}

gradle.properties

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Done to increase the memory available to gradle.
2+
org.gradle.jvmargs=-Xmx1G
3+
4+
5+
# Base properties
6+
# minecraft version
7+
minecraft_version=1.20.1
8+
# forge version, latest version can be found on https://files.minecraftforge.net/
9+
forge_version=47.3.0
10+
mapping_channel=parchment
11+
mapping_version=2023.09.03-1.20.1
12+
13+
# Mod Properties
14+
mod_version=1.0.0
15+
maven_group=com.example.examplemod
16+
archives_base_name=examplemod
17+
mod_id=examplemod
18+
mod_name=Example Mod
19+
mod_url=
20+
mod_author=Example Author
21+
mod_license=LGPLv3.0
22+
23+
# Dependencies
24+
architectury_version=9.2.14
25+
gtceu_version=1.6.3
26+
ldlib_version=1.0.31
27+
registrate_version=MC1.20-1.3.11
28+
rhino_version=2001.2.3-build.6
29+
kubejs_version=2001.6.5-build.14
30+
configuration_version=2.2.0
31+
jei_version=15.20.0.105
32+
emi_version = 1.1.13

gradle/scripts/spotless.gradle

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Spotless auto-formatter
2+
// See https://github.com/diffplug/spotless/tree/main/plugin-gradle
3+
// Can be locally toggled via spotless:off/spotless:on comments
4+
spotless {
5+
encoding 'UTF-8'
6+
7+
format 'misc', {
8+
target '.gitignore'
9+
10+
trimTrailingWhitespace()
11+
indentWithSpaces(4)
12+
endWithNewline()
13+
}
14+
java {
15+
target 'src/main/java/**/*.java', 'src/test/java/**/*.java'
16+
17+
def orderFile = file("$rootDir/spotless/spotless.importorder")
18+
def formatFile = file("$rootDir/spotless/spotless.eclipseformat.xml")
19+
20+
toggleOffOn()
21+
importOrderFile(orderFile)
22+
removeUnusedImports('cleanthat-javaparser-unnecessaryimport')
23+
endWithNewline()
24+
eclipse('4.31').configFile(formatFile)
25+
}
26+
}

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

0 commit comments

Comments
 (0)