-
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.
Just SO many changes. I'd write a more detailed log if I could remember.
- Loading branch information
Showing
60 changed files
with
907 additions
and
503 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 |
---|---|---|
|
@@ -43,4 +43,5 @@ replay_*.log | |
/output/ | ||
/1.20.4-srcs/ | ||
/remappedSrc/ | ||
/src/main/generated/ | ||
/src/main/generated/ | ||
vanilla_assets |
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,30 +1,109 @@ | ||
//file:noinspection GroovyAssignabilityCheck | ||
//file:noinspection GrUnresolvedAccess | ||
plugins { //Incredibly annoying I can't offload this block to a non-build.gradle file :( | ||
id 'fabric-loom' version '1.7-SNAPSHOT' | ||
id 'maven-publish' | ||
//Required for versioning.gradle - not loaded if not needed | ||
id 'org.ajoberstar.grgit' version '5.3.0' apply false | ||
plugins { | ||
id 'fabric-loom' version '1.9-SNAPSHOT' | ||
id 'maven-publish' | ||
} | ||
|
||
sourceSets { | ||
loom.mixin.add(main, "exclusionzone.refmap.json") | ||
version = project.mod_version | ||
group = project.maven_group | ||
|
||
base { | ||
archivesName = project.archives_base_name | ||
} | ||
|
||
repositories { | ||
maven { url 'https://maven.fallenbreath.me/releases' } | ||
// 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 { | ||
//conditional-mixin | ||
url 'https://maven.fallenbreath.me/releases' | ||
} | ||
} | ||
|
||
loom { | ||
splitEnvironmentSourceSets() | ||
|
||
mods { | ||
"exclusionzone" { | ||
sourceSet sourceSets.main | ||
sourceSet sourceSets.client | ||
} | ||
} | ||
|
||
accessWidenerPath = file("src/main/resources/${modid}.accesswidener") | ||
|
||
mixin { | ||
defaultRefmapName = "exclusionzone.refmap.json" | ||
} | ||
} | ||
|
||
fabricApi { | ||
configureDataGeneration { | ||
client = true | ||
} | ||
} | ||
|
||
dependencies { | ||
modImplementation 'me.fallenbreath:conditional-mixin-fabric:0.6.3' | ||
// 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}" | ||
|
||
// Suggested, to bundle it into your mod jar. Choose a method your build system provides | ||
include 'me.fallenbreath:conditional-mixin-fabric:0.6.3' | ||
//Conditional Mixin - allows 1.21 and 1.20.1 to work with the same jar | ||
//Required to build. Unsure if it needs to be included, but it's recommended by the CM dev. | ||
modImplementation "me.fallenbreath:conditional-mixin-fabric:${project.conditional_mixin_version}" | ||
include "me.fallenbreath:conditional-mixin-fabric:${project.conditional_mixin_version}" | ||
} | ||
|
||
//Feel free to download these .gradle files and inspect them :) | ||
processResources { | ||
inputs.property "version", project.version | ||
|
||
filesMatching("fabric.mod.json") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 21 | ||
} | ||
|
||
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() | ||
|
||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.base.archivesName.get()}"} | ||
} | ||
} | ||
|
||
// configure the maven publication | ||
publishing { | ||
publications { | ||
create("mavenJava", MavenPublication) { | ||
artifactId = project.archives_base_name | ||
from components.java | ||
} | ||
} | ||
|
||
// 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. | ||
} | ||
} | ||
|
||
//Preset to build for Java 21 using Yarn, and output a sources jar on build. | ||
apply from:"https://kd8lvt.com/gradle/minecraft/fabric/presets/yarn.j21.withSources.gradle" | ||
//Oh hey, versioning.gradle, lookit that. | ||
apply from:"https://kd8lvt.com/gradle/minecraft/versioning.gradle" | ||
sourcesJar.dependsOn.add(runDatagen) |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/com/kd8lvt/exclusionzone/api/CommonConstants.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,17 @@ | ||
package com.kd8lvt.exclusionzone.api; | ||
|
||
import com.kd8lvt.exclusionzone.api.types.CachedValue; | ||
import net.minecraft.registry.RegistryKeys; | ||
import net.minecraft.registry.entry.RegistryEntry; | ||
import net.minecraft.server.MinecraftServer; | ||
import net.minecraft.world.biome.Biome; | ||
|
||
import static com.kd8lvt.exclusionzone.ExclusionZone.id; | ||
|
||
public final class CommonConstants { | ||
public static final String MOD_ID = "exclusionzone"; | ||
public static MinecraftServer SERVER; | ||
public static final CachedValue<RegistryEntry<Biome>> BIOME = new CachedValue<>( | ||
()-> SERVER.getOverworld().getRegistryManager().get(RegistryKeys.BIOME).getEntry(id("exclusionzone")).get() | ||
); | ||
} |
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.