Skip to content

Commit 1833128

Browse files
committed
Setup base architecture
1 parent e11e1b4 commit 1833128

File tree

28 files changed

+1443
-0
lines changed

28 files changed

+1443
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea/
2+
.gradle/
3+
4+
build/
5+
run/

LICENSE.md

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

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Lambda
2+
3+
[![Minecraft](https://img.shields.io/badge/Minecraft-1.20.4-lime?style=for-the-badge&link=https://www.minecraft.net/)](https://www.minecraft.net/)
4+
[![License](https://img.shields.io/badge/License-GPL%20v3-blue?style=for-the-badge&link=https://www.gnu.org/licenses/gpl-3.0.en.html)](https://www.gnu.org/licenses/gpl-3.0.en.html)
5+
6+
<div align="center">
7+
<a href="https://discord.gg/3y3ah5BtjB"><img src="https://invidget.switchblade.xyz/3y3ah5BtjB" alt="Link to the lambda discord server https://discord.gg/3y3ah5BtjB"></a>
8+
</div>
9+
10+
## License
11+
12+
Lambda is distributed under
13+
the [GNU General Public License v3.0](https://github.com/Avanatiker/NeoLambda/blob/master/LICENSE.md).
14+
15+
---
16+
17+
If you have any questions, concerns, or suggestions,
18+
you can visit our [official Discord server](https://discord.gg/3y3ah5BtjB).
19+
20+
**Disclaimer:** Lambda is not affiliated with Mojang Studios. Minecraft is a registered trademark of Mojang Studios.
21+
Use of the Lambda software is subject to the terms outlined in the license agreement.

build.gradle.kts

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
import net.fabricmc.loom.task.RemapJarTask
3+
4+
val modId = project.properties["mod_id"].toString()
5+
val modVersion = project.properties["mod_version"].toString()
6+
val mavenGroup = project.properties["maven_group"].toString()
7+
val minecraftVersion = project.properties["minecraft_version"].toString()
8+
val yarnMappings = project.properties["yarn_mappings"].toString()
9+
10+
plugins {
11+
kotlin("jvm") version ("1.9.22")
12+
id("architectury-plugin") version "3.4-SNAPSHOT"
13+
id("dev.architectury.loom") version "1.5-SNAPSHOT" apply false
14+
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
15+
}
16+
17+
architectury {
18+
minecraft = minecraftVersion
19+
}
20+
21+
subprojects {
22+
apply(plugin = "dev.architectury.loom")
23+
dependencies {
24+
"minecraft"("com.mojang:minecraft:$minecraftVersion")
25+
"mappings"("net.fabricmc:yarn:$yarnMappings:v2")
26+
}
27+
28+
if (path == ":common") return@subprojects
29+
30+
apply(plugin = "com.github.johnrengelman.shadow")
31+
32+
val versionWithMCVersion = "$modVersion+$minecraftVersion"
33+
tasks {
34+
val shadowCommon by configurations.creating {
35+
isCanBeConsumed = false
36+
isCanBeResolved = true
37+
}
38+
val shadow = named<ShadowJar>("shadowJar") {
39+
archiveVersion = versionWithMCVersion
40+
archiveClassifier.set("shadow")
41+
configurations = listOf(shadowCommon)
42+
}
43+
named<RemapJarTask>("remapJar") {
44+
dependsOn(shadow)
45+
inputFile = shadow.flatMap { it.archiveFile }
46+
archiveVersion = versionWithMCVersion
47+
archiveClassifier = ""
48+
}
49+
jar {
50+
enabled = false
51+
}
52+
}
53+
}
54+
55+
allprojects {
56+
apply(plugin = "java")
57+
apply(plugin = "architectury-plugin")
58+
apply(plugin = "maven-publish")
59+
apply(plugin = "org.jetbrains.kotlin.jvm")
60+
base.archivesName.set(modId)
61+
group = mavenGroup
62+
version = modVersion
63+
64+
repositories {
65+
maven("https://api.modrinth.com/maven")
66+
maven("https://jitpack.io")
67+
maven("https://maven.shedaniel.me/") {
68+
name = "Architectury"
69+
}
70+
maven("https://maven.terraformersmc.com/releases/")
71+
}
72+
73+
tasks {
74+
withType<JavaCompile> {
75+
options.encoding = "UTF-8"
76+
options.release = 17
77+
}
78+
compileKotlin {
79+
kotlinOptions.jvmTarget = "17"
80+
}
81+
}
82+
}

common/build.gradle.kts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
val fabricLoaderVersion = project.properties["fabric_loader_version"].toString()
2+
val fabricKotlinVersion = project.properties["fabric_kotlin_version"].toString()
3+
val mixinExtrasVersion = project.properties["mixinextras_version"].toString()
4+
5+
architectury { common("fabric", "forge") }
6+
7+
loom {
8+
accessWidenerPath.set(File("src/main/resources/lambda.accesswidener"))
9+
}
10+
11+
repositories {
12+
maven("https://maven.fabricmc.net/") {
13+
name = "Fabric"
14+
}
15+
maven("https://jitpack.io")
16+
mavenCentral()
17+
mavenLocal()
18+
}
19+
20+
dependencies {
21+
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
22+
// Do NOT use other classes from fabric loader
23+
modImplementation("net.fabricmc:fabric-loader:$fabricLoaderVersion")
24+
// Add dependencies on the required Kotlin modules.
25+
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricKotlinVersion")
26+
implementation(annotationProcessor("io.github.llamalad7:mixinextras-common:$mixinExtrasVersion")!!)
27+
}
28+
29+
tasks.named("remapJar") {
30+
enabled = false
31+
}
32+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.lambda.mixin;
2+
3+
import net.minecraft.client.MinecraftClient;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.injection.At;
6+
import org.spongepowered.asm.mixin.injection.Inject;
7+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8+
9+
@Mixin(MinecraftClient.class)
10+
public class MixinMinecraftClient {
11+
@Inject(method = "tick", at = @At("HEAD"))
12+
void onTickPre(CallbackInfo ci) {
13+
// EventBus.post(new TickEvent.Pre());
14+
}
15+
16+
@Inject(method = "tick", at = @At("RETURN"))
17+
void onTickPost(CallbackInfo ci) {
18+
// EventBus.post(new TickEvent.Post());
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.lambda
2+
3+
import net.minecraft.client.MinecraftClient
4+
import org.apache.logging.log4j.LogManager
5+
import org.apache.logging.log4j.Logger
6+
7+
object Lambda {
8+
private const val MOD_NAME = "Lambda"
9+
const val MOD_ID = "lambda"
10+
const val SYMBOL = "λ"
11+
private val VERSION: String = LoaderInfo.getVersion()
12+
13+
val LOG: Logger = LogManager.getLogger()
14+
15+
val mc: MinecraftClient = MinecraftClient.getInstance()
16+
17+
fun initialize() {
18+
LOG.info("Initializing $MOD_NAME $VERSION")
19+
}
20+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.lambda
2+
3+
import dev.architectury.injectables.annotations.ExpectPlatform
4+
import org.jetbrains.annotations.Contract
5+
6+
object LoaderInfo {
7+
@Contract(pure = true)
8+
@ExpectPlatform
9+
@JvmStatic
10+
fun getVersion(): String = "DEV"
11+
}
37.8 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
accessWidener v2 named

0 commit comments

Comments
 (0)