Skip to content

Commit

Permalink
Port to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Jan 4, 2024
1 parent c5b994f commit db92398
Show file tree
Hide file tree
Showing 17 changed files with 196 additions and 93 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ run
.idea/

Fabric/run_client/
Neoforge/runs
18 changes: 13 additions & 5 deletions Common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@ plugins {
id 'maven-publish'
}

archivesBaseName = "${project.property("mod_name")}-${project.name}"

apply {
from file("../gradle/scripts/maven.gradle")
base {
archivesName = "${project.property("mod_name")}-${project.name}"
}

minecraft {
version(minecraft_version)
}


dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
}
}

publishing {
publications {
mavenCommon(MavenPublication) {
artifactId base.archivesName.get()
from components.java
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.world.level.WorldDataConfiguration;
import org.spongepowered.asm.mixin.Debug;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -13,6 +14,7 @@
import java.util.List;
import java.util.function.Consumer;

@Debug(export = true)
@Mixin(CreateWorldScreen.class)
public abstract class CreateWorldScreenMixin {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.worldselection.CreateWorldScreen;
import net.minecraft.client.gui.screens.worldselection.WorldOpenFlows;
import org.spongepowered.asm.mixin.Debug;
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;

@Debug(export = true)
@Mixin(WorldOpenFlows.class)
public abstract class WorldOpenFlowsMixin {

Expand Down
40 changes: 18 additions & 22 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
id 'idea'
}

archivesBaseName = "${project.property("mod_name")}-${project.name}"
base {
archivesName = "${project.property("mod_name")}-${project.name}"
}

Project commonProject = parent.project("Common")

apply {
from file("../gradle/scripts/maven.gradle")
repositories {
maven {
url "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}

dependencies {
Expand All @@ -18,6 +25,9 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation commonProject

// Modmenu
modRuntimeOnly("maven.modrinth:modmenu:${modmenu_version}")
}

loom {
Expand Down Expand Up @@ -50,23 +60,9 @@ tasks.withType(JavaCompile) {

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.maven_group
artifactId project.archivesBaseName
version project.mod_version
artifact jar
mavenFabric(MavenPublication) {
artifactId project.base.archivesName.get()
from components.java
}
}

repositories {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}
}
4 changes: 1 addition & 3 deletions Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
},

"license": "All Rights Reserved unless stated otherwise. Distribution permission is given to FeedTheBeast and CurseForge for use in modpacks",
"icon": "assets/yeetusexperimentus/icon.png",

"icon": "yeetusexperimentus-logo.png",
"environment": "*",
"entrypoints": {},
"mixins": [
Expand All @@ -29,4 +28,3 @@
"java": ">=17"
}
}

26 changes: 6 additions & 20 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '6.0.+'
id 'net.darkhax.curseforgegradle' version '1.0.14'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}

archivesBaseName = "${project.property("mod_name")}-${project.name}"
base {
archivesName = "${project.property("mod_name")}-${project.name}"
}

Project commonProject = parent.project("Common")


mixin {
add commonProject.sourceSets.main, "${mod_id}.refmap.json"
config("${mod_id}.mixins.json")
Expand Down Expand Up @@ -69,23 +69,9 @@ jar.finalizedBy('reobfJar')

publishing {
publications {
mavenJava(MavenPublication) {
groupId project.maven_group
artifactId project.archivesBaseName
version project.mod_version
register("mavenForge", MavenPublication) {
artifactId base.archivesName.get()
artifact jar
}
}

repositories {
if (ENV.NANITE_TOKEN) {
maven {
url "https://maven.nanite.dev/releases"
credentials {
username = "nanite"
password = "${ENV.NANITE_TOKEN}"
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions Forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ license="All Rights Reserved"
modId="yeetusexperimentus"
version="${file.jarVersion}"
displayName="Yeetus Experimentus"
logoFile="assets/yeetusexperimentus/logo.png"
logoFile="yeetusexperimentus-logo.png"
authors="Sunekaer"
description='''
Disables the Experimental Settings popup, which appears when you create or load world.
Expand All @@ -21,4 +21,4 @@ modId="minecraft"
mandatory=true
versionRange="[1.20,)"
ordering="NONE"
side="BOTH"
side="BOTH"
65 changes: 65 additions & 0 deletions Neoforge/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
plugins {
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.+'
id 'net.neoforged.gradle.mixin' version '7.0+'
id 'java-library'
}

base {
archivesName = "${project.property("mod_name")}-${project.name}"
}

Project commonProject = parent.project("Common")

mixin {
config("${mod_id}.mixins.json")
}

runs {
configureEach {
modSource project.sourceSets.main
}

client {
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
}

server {
systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}
}

dependencies {
implementation "net.neoforged:neoforge:${neoforge_version}"
compileOnly commonProject
}

publishing {
publications {
register("mavenNeoforge", MavenPublication) {
artifactId base.archivesName.get()
artifact jar
}
}
}

// Thanks jared
Spec<Task> notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec<Task>

tasks.withType(JavaCompile).matching(notNeoTask).configureEach {
source(project(":Common").sourceSets.main.allSource)
}

tasks.withType(Javadoc).matching(notNeoTask).configureEach {
source(project(":Common").sourceSets.main.allJava)
}

tasks.named("sourcesJar", Jar) {
from(project(":Common").sourceSets.main.allSource)
}

tasks.withType(ProcessResources).matching(notNeoTask).configureEach {
from project(":Common").sourceSets.main.resources
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.sunekaer.yeetusexperimentus;

import net.neoforged.fml.common.Mod;

@Mod(YeetusExperimentus.MOD_ID)
public class YeetusExperimentusNeoForge {

public YeetusExperimentusNeoForge() {
}
}
24 changes: 24 additions & 0 deletions Neoforge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
modLoader="javafml"
loaderVersion="[1,)"
license="All Rights Reserved"
[[mods]]
modId="yeetusexperimentus"
version="${file.jarVersion}"
displayName="Yeetus Experimentus"
logoFile="yeetusexperimentus-logo.png"
authors="Sunekaer"
description='''
Disables the Experimental Settings popup, which appears when you create or load world.
'''
[[dependencies.yeetusexperimentus]]
modId="neoforge"
mandatory=true
versionRange="[20.2,)"
ordering="NONE"
side="BOTH"
[[dependencies.yeetusexperimentus]]
modId="minecraft"
mandatory=true
versionRange="[1.20,)"
ordering="NONE"
side="BOTH"
Loading

0 comments on commit db92398

Please sign in to comment.