forked from ValkyrienSkies/Valkyrien-Skies-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
678 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
plugins { | ||
id "architectury-plugin" version "1.3.44" | ||
id "forgified-fabric-loom" version "0.5.23" apply false | ||
id "org.jetbrains.kotlin.jvm" version "1.4.21" apply false | ||
} | ||
|
||
architectury { | ||
minecraft = rootProject.minecraft_version | ||
} | ||
|
||
subprojects { | ||
apply plugin: "forgified-fabric-loom" | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
} | ||
|
||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "architectury-plugin" | ||
|
||
archivesBaseName = rootProject.archives_base_name | ||
version = rootProject.mod_version | ||
group = rootProject.maven_group | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins { | ||
id "org.jetbrains.kotlin.jvm" | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.architect.minecraft}" | ||
mappings minecraft.officialMojangMappings() | ||
compileOnly "com.google.code.findbugs:jsr305:3.+" | ||
// We depend on fabric loader here to use the fabric @Environment annotations | ||
// Do NOT use other classes from fabric loader | ||
modCompile "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" | ||
} | ||
|
||
architect { | ||
common() | ||
} |
25 changes: 25 additions & 0 deletions
25
common/src/main/java/net/examplemod/mixin/ExampleMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.examplemod.mixin; | ||
|
||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import org.apache.logging.log4j.Logger; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TitleScreen.class) | ||
public class ExampleMixin { | ||
|
||
@Shadow @Final private static Logger LOGGER; | ||
|
||
@Inject( | ||
at = @At("HEAD"), | ||
method = "init" | ||
) | ||
public void inject(CallbackInfo info) { | ||
LOGGER.info("Hello from ExampleMixin"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package net.examplemod | ||
|
||
object ExampleMod { | ||
const val MOD_ID = "examplemod" | ||
fun init() { | ||
println("Hello from init") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"required": true, | ||
"package": "net.examplemod.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"refmap": "examplemod-common-refmap.json", | ||
"mixins": [ | ||
], | ||
"client":[ | ||
"ExampleMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"minVersion": "0.8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"_comment": "This file is here to make fabric loader load this on the Knot classloader.", | ||
"schemaVersion": 1, | ||
"id": "modid-common", | ||
"version": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "5.0.0" | ||
id "org.jetbrains.kotlin.jvm" | ||
} | ||
|
||
configurations { | ||
// Use shadow to shade the file but NOT add it as a dependency | ||
shadow | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
} | ||
|
||
dependencies { | ||
minecraft("com.mojang:minecraft:${rootProject.architect.minecraft}") | ||
mappings(minecraft.officialMojangMappings()) | ||
modCompile("net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}") | ||
|
||
compileOnly(project(path: ":common")) { | ||
transitive = false | ||
} | ||
runtimeOnly(project(path: ":common", configuration: "transformedRuntime")) { | ||
transitive = false | ||
} | ||
shadow(project(path: ":common", configuration: "transformed")) { | ||
transitive = false | ||
} | ||
|
||
// Depend on the fabric kotlin mod instead... | ||
modImplementation("net.fabricmc:fabric-language-kotlin:1.4.21+build.1") | ||
} | ||
|
||
processResources { | ||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
inputs.property "version", project.version | ||
} | ||
|
||
shadowJar { | ||
configurations = [project.configurations.shadow] | ||
classifier "shadow" | ||
} | ||
|
||
remapJar { | ||
dependsOn(shadowJar) | ||
input.set(shadowJar.archivePath) | ||
archiveClassifier = "fabric" | ||
} |
25 changes: 25 additions & 0 deletions
25
fabric/src/main/java/net/examplemod/fabric/mixin/ExampleFabricMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.examplemod.fabric.mixin; | ||
|
||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import org.apache.logging.log4j.Logger; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TitleScreen.class) | ||
public class ExampleFabricMixin { | ||
|
||
@Shadow @Final private static Logger LOGGER; | ||
|
||
@Inject( | ||
at = @At("HEAD"), | ||
method = "init" | ||
) | ||
public void inject(CallbackInfo info) { | ||
LOGGER.info("Hello from ExampleFabricMixin"); | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
fabric/src/main/kotlin/net/examplemod/fabric/ExampleModFabric.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package net.examplemod.fabric | ||
|
||
import net.examplemod.ExampleMod | ||
import net.fabricmc.api.ModInitializer | ||
|
||
class ExampleModFabric : ModInitializer { | ||
override fun onInitialize() { | ||
ExampleMod.init() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"required": true, | ||
"package": "net.examplemod.fabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"refmap": "examplemod-fabric-refmap.json", | ||
"mixins": [ | ||
], | ||
"client":[ | ||
"ExampleFabricMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"minVersion": "0.8" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"schemaVersion": 1, | ||
"id": "examplemod", | ||
"version": "${version}", | ||
"name": "Example Mod", | ||
"description": "This is an example description! Tell everyone what your mod is about!", | ||
"authors": [ | ||
"Me!" | ||
], | ||
"contact": { | ||
"homepage": "https://fabricmc.net/", | ||
"sources": "https://github.com/FabricMC/fabric-example-mod" | ||
}, | ||
"license": "Insert License Here", | ||
"icon": "assets/examplemod/icon.png", | ||
"environment": "*", | ||
"entrypoints": { | ||
"main": [ | ||
"net.examplemod.fabric.ExampleModFabric" | ||
] | ||
}, | ||
"mixins": [ | ||
"examplemod-common.mixins.json", | ||
"examplemod-fabric.mixins.json" | ||
], | ||
"depends": { | ||
"fabricloader": ">=0.7.4", | ||
"fabric-language-kotlin": ">=1.4.21", | ||
"minecraft": ">=1.16.4" | ||
}, | ||
"suggests": { | ||
"flamingo": "*" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
plugins { | ||
id "com.github.johnrengelman.shadow" version "5.0.0" | ||
id "org.jetbrains.kotlin.jvm" | ||
} | ||
|
||
configurations { | ||
// Use shadow to shade the file but NOT add it as a dependency | ||
shadow | ||
} | ||
|
||
architectury { | ||
platformSetupLoomIde() | ||
} | ||
|
||
loom { | ||
mixinConfigs = ["examplemod-common.mixins.json", "examplemod-forge.mixins.json"] | ||
} | ||
|
||
dependencies { | ||
minecraft("com.mojang:minecraft:${rootProject.architect.minecraft}") | ||
mappings(minecraft.officialMojangMappings()) | ||
forge("net.minecraftforge:forge:${rootProject.architect.minecraft}-${rootProject.forge_version}") | ||
|
||
compileOnly(project(path: ":common")) { | ||
transitive = false | ||
} | ||
runtimeOnly(project(path: ":common", configuration: "transformForgeFakeMod")) { | ||
transitive = false | ||
} | ||
shadow(project(path: ":common", configuration: "transformForge")) { | ||
transitive = false | ||
} | ||
|
||
shadow("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.21") | ||
shadow("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2") | ||
compile("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2") | ||
} | ||
|
||
shadowJar { | ||
exclude "fabric.mod.json" | ||
|
||
configurations = [project.configurations.shadow] | ||
classifier "shadow" | ||
} | ||
|
||
remapJar { | ||
dependsOn(shadowJar) | ||
input.set(shadowJar.archivePath) | ||
archiveClassifier = "forge" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
loom.forge=true |
25 changes: 25 additions & 0 deletions
25
forge/src/main/java/net/examplemod/forge/mixin/ExampleForgeMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.examplemod.forge.mixin; | ||
|
||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import org.apache.logging.log4j.Logger; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(TitleScreen.class) | ||
public class ExampleForgeMixin { | ||
|
||
@Shadow @Final private static Logger LOGGER; | ||
|
||
@Inject( | ||
at = @At("HEAD"), | ||
method = "init" | ||
) | ||
public void inject(CallbackInfo info) { | ||
LOGGER.info("Hello from ExampleForgeMixin"); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
forge/src/main/kotlin/net/examplemod/forge/ExampleModForge.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package net.examplemod.forge | ||
|
||
import net.examplemod.ExampleMod | ||
import net.minecraftforge.fml.common.Mod | ||
|
||
@Mod(ExampleMod.MOD_ID) | ||
class ExampleModForge { | ||
init { | ||
ExampleMod.init() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
modLoader = "javafml" | ||
loaderVersion = "[35,)" | ||
#issueTrackerURL = "" | ||
license = "Insert License Here" | ||
|
||
[[mods]] | ||
modId = "examplemod" | ||
version = "${version}" | ||
displayName = "Example Mod" | ||
authors = "Me!" | ||
description = ''' | ||
This is an example description! Tell everyone what your mod is about! | ||
''' | ||
#logoFile = "" | ||
|
||
[[dependencies.examplemod]] | ||
modId = "forge" | ||
mandatory = true | ||
versionRange = "[35,)" | ||
ordering = "NONE" | ||
side = "BOTH" | ||
|
||
[[dependencies.examplemod]] | ||
modId = "minecraft" | ||
mandatory = true | ||
versionRange = "[1.16.2,)" | ||
ordering = "NONE" | ||
side = "BOTH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"required": true, | ||
"package": "net.examplemod.forge.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"refmap": "examplemod-forge-refmap.json", | ||
"mixins": [ | ||
], | ||
"client":[ | ||
"ExampleForgeMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
}, | ||
"minVersion": "0.8" | ||
} |
Oops, something went wrong.