-
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
31 changed files
with
440 additions
and
160 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 |
---|---|---|
|
@@ -16,12 +16,9 @@ out | |
# gradle | ||
build | ||
.gradle | ||
logs | ||
|
||
# other | ||
eclipse | ||
run | ||
.vscode | ||
|
||
# Files from Forge MDK | ||
forge*changelog.txt | ||
logs/ |
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,3 +1,3 @@ | ||
# Changelog | ||
|
||
Updated build script | ||
Update to 1.20.4 and neo |
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 @@ | ||
|
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,133 +1,108 @@ | ||
plugins { | ||
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" | ||
id 'maven-publish' | ||
id "me.modmuss50.mod-publish-plugin" version "0.3.0" | ||
id "architectury-plugin" version "3.4-SNAPSHOT" | ||
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false | ||
id "me.modmuss50.mod-publish-plugin" version "0.4.5" | ||
} | ||
|
||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
def ENV = System.getenv() | ||
version = "${mod_version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}" | ||
archivesBaseName = project.archives_base_name | ||
group = project.maven_group | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
|
||
forge { | ||
mixinConfigs = [ | ||
'structureexpansion.mixins.json' | ||
] | ||
|
||
dataGen { | ||
mod project.mod_id | ||
} | ||
|
||
launches { | ||
data { | ||
arg "--existing", file("src/main/resources").absolutePath | ||
} | ||
} | ||
} | ||
architectury { | ||
minecraft = rootProject.minecraft_version | ||
} | ||
|
||
repositories { | ||
subprojects { | ||
apply plugin: "dev.architectury.loom" | ||
apply plugin: "maven-publish" | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" | ||
mappings loom.officialMojangMappings() | ||
} | ||
|
||
publishing { | ||
repositories { | ||
if (providers.environmentVariable("NANITE_TOKEN").isPresent()) { | ||
maven { | ||
url "https://maven.nanite.dev/releases" | ||
credentials { | ||
username = "nanite" | ||
password = providers.environmentVariable("NANITE_TOKEN").get() | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
minecraft "com.mojang:minecraft:${project.minecraft_version}" | ||
mappings loom.officialMojangMappings() | ||
allprojects { | ||
apply plugin: "java" | ||
apply plugin: "architectury-plugin" | ||
apply plugin: "maven-publish" | ||
|
||
forge "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}" | ||
} | ||
archivesBaseName = rootProject.archives_base_name | ||
version = rootProject.mod_version | ||
group = rootProject.maven_group | ||
|
||
processResources { | ||
inputs.property "version", project.version | ||
repositories { | ||
} | ||
|
||
filesMatching("META-INF/mods.toml") { | ||
expand "version": project.version | ||
} | ||
} | ||
|
||
compileJava { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
} | ||
|
||
jar { | ||
from("LICENSE") { | ||
rename { "${it}_${project.archivesBaseName}" } | ||
} | ||
|
||
manifest { | ||
attributes([ | ||
"Specification-Title" : project.mod_id, | ||
"Specification-Vendor" : project.mod_author, | ||
"Specification-Version" : "1", | ||
"Implementation-Title" : project.name, | ||
"Implementation-Version" : version, | ||
"Implementation-Vendor" : project.mod_author, | ||
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") | ||
]) | ||
} | ||
} | ||
tasks.withType(JavaCompile) { | ||
options.encoding = "UTF-8" | ||
options.release = 17 | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenForge(MavenPublication) { | ||
artifactId = rootProject.archives_base_name + "-" + project.name | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
if (providers.environmentVariable("NANITE_TOKEN").orNull) { | ||
maven { | ||
url "${maven_url}/releases" | ||
credentials { | ||
username = "nanite" | ||
password = providers.environmentVariable("NANITE_TOKEN").get() | ||
} | ||
} | ||
} | ||
} | ||
java { | ||
withSourcesJar() | ||
} | ||
} | ||
|
||
publishMods { | ||
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null | ||
changelog = file("./CHANGELOG.md").text | ||
version = "${mod_version}" | ||
type = STABLE | ||
|
||
def forgeOptions = publishOptions { | ||
file = project.provider { project.tasks.remapJar }.flatMap { it.archiveFile } | ||
displayName = "${project.name} Forge ${mod_version}+mc${minecraft_version}" | ||
modLoaders.add("forge") | ||
} | ||
|
||
def curseForgeOptions = curseforgeOptions { | ||
accessToken = providers.environmentVariable("CURSE_TOKEN") | ||
projectId = "${curseforge_id}" | ||
minecraftVersions.add("${minecraft_version}") | ||
} | ||
|
||
def modrinthOptions = modrinthOptions { | ||
accessToken = providers.environmentVariable("MODRINTH_TOKEN") | ||
projectId = "${modrinth_id}" | ||
minecraftVersions.add("${minecraft_version}") | ||
} | ||
|
||
curseforge("curseforgeForge") { | ||
from(curseForgeOptions, forgeOptions) | ||
} | ||
|
||
if (providers.environmentVariable("MODRINTH_TOKEN").getOrNull() != null) { | ||
modrinth("modrinthForge") { | ||
from(modrinthOptions, forgeOptions) | ||
} | ||
} | ||
dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null | ||
changelog = file("./CHANGELOG.md").text | ||
version = "${mod_version}" | ||
type = STABLE | ||
|
||
def forgeOptions = publishOptions { | ||
file = project.provider { project(":forge").tasks.remapJar }.flatMap { it.archiveFile } | ||
displayName = "[FORGE][${minecraft_version}] ${project.name} ${mod_version}" | ||
modLoaders.add("forge") | ||
} | ||
|
||
def neoForge = publishOptions { | ||
file = project.provider { project(":neoforge").tasks.remapJar }.flatMap { it.archiveFile } | ||
displayName = "[NEOFORGE][${minecraft_version}] ${project.name} ${mod_version}" | ||
modLoaders.add("neoforge") | ||
} | ||
|
||
def curseForgeOptions = curseforgeOptions { | ||
accessToken = providers.environmentVariable("CURSE_TOKEN") | ||
projectId = "${curseforge_id}" | ||
minecraftVersions.add("${minecraft_version}") | ||
} | ||
|
||
def modrinthOptions = modrinthOptions { | ||
accessToken = providers.environmentVariable("MODRINTH_TOKEN") | ||
projectId = "${modrinth_id}" | ||
minecraftVersions.add("${minecraft_version}") | ||
} | ||
|
||
curseforge("curseforgeForge") { | ||
from(curseForgeOptions, forgeOptions) | ||
} | ||
|
||
curseforge("curseforgeNeoForge") { | ||
from(curseForgeOptions, neoForge) | ||
} | ||
|
||
if (providers.environmentVariable("MODRINTH_TOKEN").getOrNull() != null) { | ||
modrinth("modrinthForge") { | ||
from(modrinthOptions, forgeOptions) | ||
} | ||
|
||
modrinth("modrinthNeoforge") { | ||
from(modrinthOptions, neoForge) | ||
} | ||
} | ||
} |
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,26 @@ | ||
architectury { | ||
common(rootProject.enabled_platforms.split(",")) | ||
} | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/structureexpansion.accesswidener") | ||
} | ||
|
||
// sourceSets.main.resources.srcDirs += file("src/generated/resources") | ||
|
||
dependencies { | ||
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies | ||
// Do NOT use other classes from fabric loader | ||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" | ||
// Remove the next line if you don't want to depend on the API | ||
modApi "dev.architectury:architectury:${rootProject.architectury_version}" | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenCommon(MavenPublication) { | ||
artifactId = "${rootProject.archivesBaseName}-${project.name}" | ||
from components.java | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
common/src/main/java/com/sunekaer/mods/structureexpansion/StructureExpansion.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,23 @@ | ||
package com.sunekaer.mods.structureexpansion; | ||
|
||
import com.mojang.brigadier.CommandDispatcher; | ||
import com.sunekaer.mods.structureexpansion.commands.CommandClean; | ||
import dev.architectury.event.events.common.CommandRegistrationEvent; | ||
import net.minecraft.commands.CommandBuildContext; | ||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.commands.Commands; | ||
|
||
public class StructureExpansion { | ||
public static final int NEW_LIMIT = 200; | ||
public static final int NEW_LIMIT_POS = NEW_LIMIT - 1; | ||
public static final int NEW_LIMIT_NEG = -NEW_LIMIT_POS; | ||
|
||
|
||
public static void init() { | ||
CommandRegistrationEvent.EVENT.register(StructureExpansion::registerCommands); | ||
} | ||
|
||
public static void registerCommands(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context, Commands.CommandSelection selection) { | ||
dispatcher.register(Commands.literal("structure").then(CommandClean.register())); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"accessWidener": "structureexpansion.accesswidener" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessWidener v2 named | ||
accessible field net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate palettes Ljava/util/List; |
Oops, something went wrong.