Skip to content

Commit 27c8947

Browse files
committed
initial commit
0 parents  commit 27c8947

32 files changed

+2602
-0
lines changed

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Disable autocrlf on generated files, they always generate with LF
2+
# Add any extra files or paths here to make git stop saying they
3+
# are changed when only line endings change.
4+
src/generated/**/.cache/cache text eol=lf
5+
src/generated/**/*.json text eol=lf

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
fetch-tags: true
14+
15+
- name: Setup JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '21'
19+
distribution: 'temurin'
20+
21+
- name: Build with Gradle
22+
uses: gradle/actions/setup-gradle@v3
23+
with:
24+
arguments: build
25+
26+
- name: Upload artifacts
27+
uses: actions/upload-artifact@v4
28+
with:
29+
path: build/libs/*

.gitignore

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

LICENSE

Lines changed: 840 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AE2 Distributed Networks
2+
3+
Modern networking for ME networks.

build.gradle

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
/*
2+
* This file is derived from the NeoForged MDK at https://github.com/NeoForgeMDKs/MDK-1.21-ModDevGradle.
3+
* The license is reproduced below.
4+
*
5+
* MIT License
6+
*
7+
* Copyright (c) 2023 NeoForged project
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in all
17+
* copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25+
* SOFTWARE.
26+
*/
27+
28+
plugins {
29+
id 'java-library'
30+
id 'maven-publish'
31+
id 'net.neoforged.moddev' version '2.0.88'
32+
id 'idea'
33+
}
34+
35+
tasks.named('wrapper', Wrapper).configure {
36+
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
37+
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
38+
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
39+
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
40+
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
41+
distributionType = Wrapper.DistributionType.BIN
42+
}
43+
44+
version = mod_version
45+
group = mod_group_id
46+
47+
repositories {
48+
mavenLocal()
49+
mavenCentral()
50+
maven {
51+
name = "modrinth"
52+
url = "https://api.modrinth.com/maven"
53+
}
54+
maven {
55+
name = "TerraformersMC"
56+
url = "https://maven.terraformersmc.com/"
57+
}
58+
}
59+
60+
base {
61+
archivesName = mod_id
62+
}
63+
64+
java {
65+
// Mojang ships Java 21 to end users starting in 1.20.5, so mods should target Java 21.
66+
toolchain.languageVersion = JavaLanguageVersion.of(21)
67+
withSourcesJar()
68+
}
69+
70+
neoForge {
71+
// Specify the version of NeoForge to use.
72+
version = project.neo_version
73+
74+
parchment {
75+
mappingsVersion = project.parchment_mappings_version
76+
minecraftVersion = project.parchment_minecraft_version
77+
}
78+
79+
validateAccessTransformers = true
80+
81+
accessTransformers {
82+
file('src/main/resources/META-INF/accesstransformer.cfg')
83+
}
84+
85+
// Default run configurations.
86+
// These can be tweaked, removed, or duplicated as needed.
87+
runs {
88+
client {
89+
client()
90+
91+
// Comma-separated list of namespaces to load gametests from. Empty = all namespaces.
92+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
93+
}
94+
95+
server {
96+
server()
97+
programArgument '--nogui'
98+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
99+
}
100+
101+
// This run config launches GameTestServer and runs all registered gametests, then exits.
102+
// By default, the server will crash when no gametests are provided.
103+
// The gametest system is also enabled by default for other run configs under the /test command.
104+
gameTestServer {
105+
type = "gameTestServer"
106+
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
107+
}
108+
109+
data {
110+
data()
111+
112+
// example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it
113+
// gameDirectory = project.file('run-data')
114+
115+
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
116+
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
117+
}
118+
119+
// applies to all the run configs above
120+
configureEach {
121+
// Recommended logging data for a userdev environment
122+
// The markers can be added/remove as needed separated by commas.
123+
// "SCAN": For mods scan.
124+
// "REGISTRIES": For firing of registry events.
125+
// "REGISTRYDUMP": For getting the contents of all registries.
126+
systemProperty 'forge.logging.markers', 'REGISTRIES'
127+
128+
// Recommended logging level for the console
129+
// You can set various levels here.
130+
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
131+
logLevel = org.slf4j.event.Level.DEBUG
132+
}
133+
}
134+
135+
mods {
136+
// define mod <-> source bindings
137+
// these are used to tell the game which sources are for which mod
138+
// mostly optional in a single mod project
139+
// but multi mod projects should define one per mod
140+
"${mod_id}" {
141+
sourceSet(sourceSets.main)
142+
}
143+
}
144+
}
145+
146+
// Include resources generated by data generators.
147+
sourceSets.main.resources { srcDir 'src/generated/resources' }
148+
149+
// Sets up a dependency configuration called 'localRuntime'.
150+
// This configuration should be used instead of 'runtimeOnly' to declare
151+
// a dependency that will be present for runtime testing but that is
152+
// "optional", meaning it will not be pulled by dependents of this mod.
153+
configurations {
154+
runtimeClasspath.extendsFrom localRuntime
155+
}
156+
157+
dependencies {
158+
// Example optional mod dependency with JEI
159+
// The JEI API is declared for compile time use, while the full JEI artifact is used at runtime
160+
// compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}"
161+
// compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}"
162+
// We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it
163+
// localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}"
164+
165+
// Example mod dependency using a mod jar from ./libs with a flat dir repository
166+
// This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar
167+
// The group id is ignored when searching -- in this case, it is "blank"
168+
// implementation "blank:coolmod-${mc_version}:${coolmod_version}"
169+
170+
// Example mod dependency using a file as dependency
171+
// implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar")
172+
173+
// Example project dependency using a sister or child project:
174+
// implementation project(":myproject")
175+
176+
// For more info:
177+
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
178+
// http://www.gradle.org/docs/current/userguide/dependency_management.html
179+
180+
compileOnly "org.appliedenergistics:appliedenergistics2:${project.ae2_version}:api"
181+
implementation "org.appliedenergistics:appliedenergistics2:${project.ae2_version}"
182+
183+
localRuntime "dev.emi:emi-neoforge:${project.emi_version}"
184+
localRuntime "maven.modrinth:jade:${project.jade_version}"
185+
}
186+
187+
// This block of code expands all declared replace properties in the specified resource targets.
188+
// A missing property will result in an error. Properties are expanded using ${} Groovy notation.
189+
var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) {
190+
var replaceProperties = [
191+
minecraft_version : minecraft_version,
192+
minecraft_version_range: minecraft_version_range,
193+
neo_version : neo_version,
194+
neo_version_range : neo_version_range,
195+
loader_version_range : loader_version_range,
196+
mod_id : mod_id,
197+
mod_name : mod_name,
198+
mod_license : mod_license,
199+
mod_version : mod_version,
200+
mod_authors : mod_authors,
201+
mod_description : mod_description
202+
]
203+
inputs.properties replaceProperties
204+
expand replaceProperties
205+
from "src/main/templates"
206+
into "build/generated/sources/modMetadata"
207+
}
208+
// Include the output of "generateModMetadata" as an input directory for the build
209+
// this works with both building through Gradle and the IDE.
210+
sourceSets.main.resources.srcDir generateModMetadata
211+
// To avoid having to run "generateModMetadata" manually, make it run on every project reload
212+
neoForge.ideSyncTask generateModMetadata
213+
214+
// Example configuration to allow publishing using the maven-publish plugin
215+
publishing {
216+
publications {
217+
register('mavenJava', MavenPublication) {
218+
from components.java
219+
}
220+
}
221+
repositories {
222+
maven {
223+
url "file://${project.projectDir}/repo"
224+
}
225+
}
226+
}
227+
228+
tasks.withType(JavaCompile).configureEach {
229+
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
230+
}
231+
232+
// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior.
233+
idea {
234+
module {
235+
downloadSources = true
236+
downloadJavadoc = true
237+
}
238+
}

gradle.properties

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
2+
org.gradle.jvmargs=-Xmx4G
3+
org.gradle.daemon=true
4+
org.gradle.parallel=true
5+
org.gradle.caching=true
6+
org.gradle.configuration-cache=true
7+
8+
# read more on this at https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment
9+
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
10+
parchment_minecraft_version=1.21.1
11+
parchment_mappings_version=2024.11.17
12+
# Environment Properties
13+
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
14+
# The Minecraft version must agree with the Neo version to get a valid artifact
15+
minecraft_version=1.21.1
16+
# The Minecraft version range can use any release version of Minecraft as bounds.
17+
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
18+
# as they do not follow standard versioning conventions.
19+
minecraft_version_range=[1.21.1, 1.21.2)
20+
# The Neo version must agree with the Minecraft version to get a valid artifact
21+
neo_version=21.1.172
22+
# The Neo version range can use any version of Neo as bounds
23+
neo_version_range=[21.1.0,)
24+
# The loader version range can only use the major version of FML as bounds
25+
loader_version_range=[4,)
26+
27+
ae2_version=19.2.10
28+
emi_version=1.1.22+1.21.1
29+
jade_version=15.10.0+neoforge
30+
31+
## Mod Properties
32+
33+
mod_id=ae2dn
34+
mod_name=AE2 Distributed Networks
35+
mod_license=LGPLv3
36+
mod_version=0.1.0
37+
mod_group_id=net.hellomouse.ae2dn
38+
mod_authors=Hellomouse
39+
mod_description=Enables multiple controllers in a single ME network. Bring modern network architectures into AE2.

gradle/wrapper/gradle-wrapper.jar

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

0 commit comments

Comments
 (0)