Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,10 @@ classes/
.vscode
.settings
*.launch
.architectury-transformer
runs/

# Ignore markdown files except the ones we want tracked
*.md
!README.md
!LICENSE.md
!CHANGES.md
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# EyeMineArchitectury
A version of [EyeMineMods](https://github.com/SpecialEffect/EyeMineMods) that is build upon the [Architectury API](https://github.com/architectury/architectury-api) allowing it to work on either NeoForge, Forge or Fabric.
# EyeMineMods
A version of [EyeMineMods](https://github.com/SpecialEffect/EyeMineMods) using Jared's [MultiLoader Template](https://github.com/jaredlll08/MultiLoader-Template) to support both NeoForge and Fabric.

This repository contains the Minecraft mods used with [EyeMine](https://github.com/SpecialEffect/EyeMine), which provides a gaze-controlled keyboard for in-game actions.

Expand All @@ -21,18 +21,19 @@ A version of the mod ported by [Mrbysco](https://github.com/Mrbysco) supports **

## Information for developers

Code for different versions of Minecraft Forge can be found on different branches:
Code for different versions of Minecraft can be found on different branches:
- Minecraft Forge v1.11.2 (via the [eyemineClassic_mc1_11_2 branch](https://github.com/SpecialEffect/EyeMineMods/tree/eyemineClassic_mc1_11_2))
- Minecraft Forge v1.14.4 (via the [eyemineV2_mc1_14_4 branch](https://github.com/SpecialEffect/EyeMineMods/tree/eyemineV2_mc1_14_4)).
- Minecraft Forge v1.16.5 (via the [eyemineV2_mc1_16_5 branch](https://github.com/SpecialEffect/EyeMineMods/tree/eyemineV2_mc1_16_5)).
- Minecraft 1.21.1 NeoForge + Fabric via Architectury (via the [architectury_1.21 branch](https://github.com/SpecialEffect/EyeMineMods/tree/architectury_1.21)).
- Minecraft 26.1.1 NeoForge + Fabric via MultiLoader (via the [multiloader_26.1.1 branch](https://github.com/SpecialEffect/EyeMineMods/tree/multiloader_26.1.1)).

All the code comprising EyeMine is GPL3 licensed. We would love contributions to port to other versions of Minecraft. If you're interested in doing this, please email eyemine@specialeffect.org.uk to let us know what you're working on!

## Dev setup
These instructions are based on Windows 10 and using Eclipse as an IDE. If you are using a different setup, some details may vary.

### Pre-requisites
- Java SDK ("JDK")
- Java 25 JDK

### Instructions
Get the code.
Expand All @@ -41,17 +42,13 @@ git clone git@github.com:SpecialEffect/EyeMineMods.git
cd EyeMineMods
```

Build the code. The built mod file will be found in the `build/libs` directory.
Build the code. Output JARs will be in `neoforge/build/libs/` and `fabric/build/libs/`.
```
gradlew build
./gradlew build
```

Optionally set up to build and run from Eclipse:
Run the client in dev:
```
gradlew genEclipseRuns
gradlew eclipse
./gradlew :neoforge:runClient
./gradlew :fabric:runClient
```
Now you can open the project in Eclipse:
File -> Import -> Gradle -> Existing Gradle project -> Set Project Root Directory to the EyeMineMods folder -> Finish
Once the project is loaded, select the project in Package Explorer, hit the green "Run" or "Debug" button and select "runClient" as the configuration to run.

66 changes: 4 additions & 62 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,64 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.9-SNAPSHOT" apply false
// https://fabricmc.net/develop/
id 'net.fabricmc.fabric-loom' version '1.16.1' apply false
// https://projects.neoforged.net/neoforged/moddevgradle
id 'net.neoforged.moddev' version '2.0.141' apply false
}

architectury {
minecraft = rootProject.minecraft_version
}

subprojects {
apply plugin: "dev.architectury.loom"

loom {
silentMojangMappingsLicense()
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
// The following line declares the mojmap mappings, you may use other mappings as well
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.19.4+build.2:v2"
}
}

allprojects {
apply plugin: "java"
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

base {
archivesName = rootProject.archives_base_name
}
version = rootProject.mod_version
group = rootProject.maven_group

repositories {
mavenCentral()
maven {
url "https://maven.neoforged.net/releases/"
}
maven {
url "https://maven.terraformersmc.com/"
content {
includeGroup "com.terraformersmc"
}
}
maven {
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.getRelease().set(21)
}

java {
withSourcesJar()
}
}
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id 'groovy-gradle-plugin'
}
99 changes: 99 additions & 0 deletions buildSrc/src/main/groovy/multiloader-common.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
plugins {
id 'java-library'
id 'maven-publish'
}

base {
archivesName = "${mod_id}-${project.name}-${minecraft_version}"
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
withSourcesJar()
withJavadocJar()
}

repositories {
mavenCentral()
exclusiveContent {
forRepository {
maven {
name = 'Sponge'
url = 'https://repo.spongepowered.org/repository/maven-public'
}
}
filter { includeGroupAndSubgroups('org.spongepowered') }
}
}

sourcesJar {
from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" }
}
}

jar {
from(rootProject.file('LICENSE')) {
rename { "${it}_${mod_name}" }
}

manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version': project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Built-On-Minecraft' : minecraft_version
])
}
}

processResources {
var expandProps = [
'version' : version,
'group' : project.group,
'minecraft_version' : minecraft_version,
'minecraft_version_range' : minecraft_version_range,
'fabric_version' : fabric_version,
'fabric_loader_version' : fabric_loader_version,
'mod_name' : mod_name,
'mod_author' : mod_author,
'mod_id' : mod_id,
'license' : license,
'description' : project.description,
'neoforge_version' : neoforge_version,
'neoforge_loader_version_range': neoforge_loader_version_range,
'credits' : credits,
'java_version' : java_version
]

var jsonExpandProps = expandProps.collectEntries {
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
}

filesMatching(['META-INF/mods.toml', 'META-INF/neoforge.mods.toml']) {
expand expandProps
}

filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
expand jsonExpandProps
}

inputs.properties(expandProps)
}

publishing {
publications {
register('mavenJava', MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
repositories {
maven {
url System.getenv('local_maven_url') ?: 'file://invalid'
}
}
}
95 changes: 95 additions & 0 deletions buildSrc/src/main/groovy/multiloader-loader.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// Loader convention plugin - injects common sources into platform builds.

plugins {
id 'java'
}

base {
archivesName = "${mod_id}-${minecraft_version}-${version}-${project.name}"
}

tasks.withType(AbstractArchiveTask).configureEach {
archiveVersion.set('')
}

java {
toolchain.languageVersion = JavaLanguageVersion.of(java_version)
}

configurations {
commonJava {
canBeConsumed = false
canBeResolved = true
}
commonResources {
canBeConsumed = false
canBeResolved = true
}
}

dependencies {
commonJava project(path: ':common', configuration: 'commonJava')
commonResources project(path: ':common', configuration: 'commonResources')
}

tasks.named('compileJava').configure {
dependsOn(configurations.commonJava)
source(configurations.commonJava.incoming.artifactView {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) }
}.files)
}

tasks.named('processResources').configure {
dependsOn(configurations.commonResources)
from(configurations.commonResources.incoming.artifactView {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) }
}.files)

// Property expansion for mod metadata files
var expandProps = [
'version' : version,
'group' : project.group,
'minecraft_version' : minecraft_version,
'minecraft_version_range' : minecraft_version_range,
'fabric_version' : fabric_version,
'fabric_loader_version' : fabric_loader_version,
'mod_name' : mod_name,
'mod_author' : mod_author,
'mod_id' : mod_id,
'license' : license,
'description' : project.description ?: '',
'neoforge_version' : neoforge_version,
'neoforge_loader_version_range': neoforge_loader_version_range,
'credits' : credits,
'java_version' : java_version
]

var jsonExpandProps = expandProps.collectEntries {
key, value -> [(key): value instanceof String ? value.replace("\n", "\\\\n") : value]
}

filesMatching(['META-INF/mods.toml', 'META-INF/neoforge.mods.toml']) {
expand expandProps
}

filesMatching(['pack.mcmeta', 'fabric.mod.json', '*.mixins.json']) {
expand jsonExpandProps
}

inputs.properties(expandProps)
}

tasks.matching { it.name == 'javadoc' }.configureEach {
source(configurations.commonJava.incoming.artifactView {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) }
}.files)
}

tasks.matching { it.name == 'sourcesJar' }.configureEach {
from(configurations.commonJava.incoming.artifactView {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) }
}.files)
from(configurations.commonResources.incoming.artifactView {
attributes { attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME)) }
}.files)
}
Loading