-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use architectury to implement both fabric and forge
- Loading branch information
Showing
669 changed files
with
791 additions
and
715 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 |
---|---|---|
@@ -1,101 +1,57 @@ | ||
plugins { | ||
id 'fabric-loom' version '0.10-SNAPSHOT' | ||
id 'maven-publish' | ||
id "architectury-plugin" version "3.4-SNAPSHOT" | ||
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false | ||
} | ||
|
||
sourceCompatibility = JavaVersion.VERSION_16 | ||
targetCompatibility = JavaVersion.VERSION_16 | ||
|
||
archivesBaseName = project.archives_base_name | ||
version = project.mod_version + "-mc" + project.minecraft_version | ||
group = project.maven_group | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/antiqueatlas.accesswidener") | ||
architectury { | ||
minecraft = rootProject.minecraft_version | ||
} | ||
|
||
repositories { | ||
maven { | ||
// for fabric | ||
url = "https://maven.modmuss50.me/" | ||
} | ||
maven { | ||
// for mod menu | ||
url = uri("https://jitpack.io") | ||
} | ||
maven { | ||
// for cloth-config | ||
url = "https://maven.shedaniel.me/" | ||
} | ||
maven { | ||
url = "https://maven.terraformersmc.com/releases" | ||
} | ||
} | ||
|
||
dependencies { | ||
//to change the versions see the gradle.properties file | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" | ||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" | ||
|
||
// Fabric API. This is technically optional, but you probably want it anyway. | ||
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" | ||
subprojects { | ||
apply plugin: "dev.architectury.loom" | ||
|
||
modImplementation "com.terraformersmc:modmenu:${project.mod_menu_version}" | ||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
|
||
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") { | ||
exclude(group: "net.fabricmc.fabric-api") | ||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" | ||
mappings "net.fabricmc:yarn:${rootProject.yarn_mappings}:v2" | ||
} | ||
} | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { // add mod metadata | ||
expand "version": project.version | ||
} | ||
} | ||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "architectury-plugin" | ||
apply plugin: "maven-publish" | ||
|
||
// ensure that the encoding is set to UTF-8, no matter what the system default is | ||
// this fixes some edge cases with special characters not displaying correctly | ||
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html | ||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
it.options.release = 16 | ||
} | ||
archivesBaseName = rootProject.archives_base_name | ||
version = rootProject.mod_version + "-" + project.name + "-mc" + rootProject.minecraft_version | ||
group = rootProject.maven_group | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task | ||
// if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.archivesBaseName}"} | ||
repositories { | ||
// Add repositories to retrieve artifacts from in here. | ||
// You should only use this when depending on other mods because | ||
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically. | ||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html | ||
// for more information about repositories. | ||
|
||
maven { | ||
// for cloth-config | ||
url = "https://maven.shedaniel.me/" | ||
} | ||
maven { | ||
// for mod menu | ||
url = "https://maven.terraformersmc.com/releases" | ||
} | ||
} | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
// add all the jars that should be included when publishing to maven | ||
artifact(remapJar) { | ||
builtBy remapJar | ||
} | ||
artifact(sourcesJar) { | ||
builtBy remapSourcesJar | ||
} | ||
} | ||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
|
||
// See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. | ||
repositories { | ||
// Add repositories to publish to here. | ||
// Notice: This block does NOT have the same function as the block in the top level. | ||
// The repositories here will be used for publishing your artifact, not for | ||
// retrieving dependencies. | ||
java { | ||
withSourcesJar() | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
common/src/main/java/hunternif/mc/impl/atlas/client/IResourceReloadListener.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,34 @@ | ||
package hunternif.mc.impl.atlas.client; | ||
|
||
import net.minecraft.resource.ResourceManager; | ||
import net.minecraft.resource.ResourceReloader; | ||
import net.minecraft.util.profiler.Profiler; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
import java.util.concurrent.Executor; | ||
|
||
public interface IResourceReloadListener<T> extends ResourceReloader | ||
{ | ||
|
||
CompletableFuture<T> load(ResourceManager manager, Profiler profiler, Executor executor); | ||
|
||
CompletableFuture<Void> apply(T data, | ||
ResourceManager manager, | ||
Profiler profiler, | ||
Executor executor); | ||
|
||
|
||
default CompletableFuture<Void> reload(ResourceReloader.Synchronizer synchronizer, | ||
ResourceManager manager, | ||
Profiler prepareProfiler, | ||
Profiler applyProfiler, | ||
Executor prepareExecutor, | ||
Executor applyExecutor) | ||
{ | ||
CompletableFuture<T> load = load(manager, prepareProfiler, prepareExecutor); | ||
|
||
return load.thenCompose(synchronizer::whenPrepared) | ||
.thenCompose(t -> apply(t, manager, applyProfiler, applyExecutor)); | ||
} | ||
|
||
} |
22 changes: 4 additions & 18 deletions
22
...rnif/mc/impl/atlas/client/KeyHandler.java → ...rnif/mc/impl/atlas/client/KeyHandler.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
Oops, something went wrong.