Initial Commit
This commit is contained in:
124
Forge/build.gradle
Normal file
124
Forge/build.gradle
Normal file
@@ -0,0 +1,124 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url = 'https://maven.minecraftforge.net' }
|
||||
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
|
||||
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
|
||||
}
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'net.minecraftforge.gradle'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'org.spongepowered.mixin'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
archivesBaseName = "${mod_name}-forge-${minecraft_version}"
|
||||
|
||||
mixin {
|
||||
add sourceSets.main, "${mod_id}.refmap.json"
|
||||
|
||||
config "${mod_id}.mixins.json"
|
||||
}
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'official', version: minecraft_version
|
||||
|
||||
if (project.hasProperty('forge_ats_enabled') && project.findProperty('forge_ats_enabled').toBoolean()) {
|
||||
// This location is hardcoded in Forge and can not be changed.
|
||||
// https://github.com/MinecraftForge/MinecraftForge/blob/be1698bb1554f9c8fa2f58e32b9ab70bc4385e60/fmlloader/src/main/java/net/minecraftforge/fml/loading/moddiscovery/ModFile.java#L123
|
||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||
project.logger.debug('Forge Access Transformers are enabled for this project.')
|
||||
}
|
||||
|
||||
runs {
|
||||
client {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
taskName 'Client'
|
||||
args "-mixin.config=${mod_id}.mixins.json"
|
||||
mods {
|
||||
modClientRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
taskName 'Server'
|
||||
args "-mixin.config=${mod_id}.mixins.json"
|
||||
mods {
|
||||
modServerRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data {
|
||||
workingDirectory project.file('run')
|
||||
ideaModule "${rootProject.name}.${project.name}.main"
|
||||
args '--mod', mod_id, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
|
||||
taskName 'Data'
|
||||
args "-mixin.config=${mod_id}.mixins.json"
|
||||
mods {
|
||||
modDataRun {
|
||||
source sourceSets.main
|
||||
source project(":Common").sourceSets.main
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets.main.resources.srcDir 'src/generated/resources'
|
||||
|
||||
dependencies {
|
||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||
compileOnly project(":Common")
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.4-SNAPSHOT:processor'
|
||||
implementation fg.deobf("me.hypherionmc.craterlib:CraterLib-forge-${minecraft_version}:${craterlib_version}")
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
source(project(":Common").sourceSets.main.allSource)
|
||||
}
|
||||
|
||||
processResources {
|
||||
from project(":Common").sourceSets.main.resources
|
||||
|
||||
filesMatching('*.mixins.json') {
|
||||
expand "refmap_target": "${mod_id}."
|
||||
}
|
||||
}
|
||||
|
||||
jar.finalizedBy('reobfJar')
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenJava(MavenPublication) {
|
||||
groupId project.group
|
||||
artifactId project.archivesBaseName
|
||||
version project.version
|
||||
artifact jar
|
||||
}
|
||||
}
|
||||
repositories {
|
||||
maven {
|
||||
url "file://" + System.getenv("local_maven")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task copyAllArtifacts(type: Copy) {
|
||||
from "$buildDir/libs"
|
||||
into "$rootDir/artifacts"
|
||||
include("*.jar")
|
||||
}
|
||||
|
||||
build.finalizedBy(copyAllArtifacts)
|
||||
18
Forge/src/main/java/me/hypherionmc/ftimeouts/FTimeouts.java
Normal file
18
Forge/src/main/java/me/hypherionmc/ftimeouts/FTimeouts.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package me.hypherionmc.ftimeouts;
|
||||
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.event.lifecycle.FMLDedicatedServerSetupEvent;
|
||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||
|
||||
@Mod(Constants.MOD_ID)
|
||||
public class FTimeouts {
|
||||
|
||||
public FTimeouts() {
|
||||
FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup);
|
||||
}
|
||||
|
||||
public void serverSetup(FMLDedicatedServerSetupEvent event) {
|
||||
ServerInit.load();
|
||||
}
|
||||
|
||||
}
|
||||
38
Forge/src/main/resources/META-INF/mods.toml
Normal file
38
Forge/src/main/resources/META-INF/mods.toml
Normal file
@@ -0,0 +1,38 @@
|
||||
modLoader="javafml"
|
||||
loaderVersion="[45,)"
|
||||
license="MIT"
|
||||
#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/"
|
||||
|
||||
[[mods]] #mandatory
|
||||
modId="ftimeouts"
|
||||
version="${file.jarVersion}"
|
||||
displayName="F Timeouts"
|
||||
#updateJSONURL="https://change.me.example.invalid/updates.json"
|
||||
#displayURL="https://change.me.to.your.mods.homepage.example.invalid/"
|
||||
logoFile="multiloader.png"
|
||||
#credits="Thanks for this example mod goes to Java"
|
||||
authors="HypherionSA"
|
||||
description='''
|
||||
No more Server Timeouts
|
||||
'''
|
||||
|
||||
[[dependencies.ftimeouts]]
|
||||
modId="forge"
|
||||
mandatory=true
|
||||
versionRange="[45,)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies.ftimeouts]]
|
||||
modId="minecraft"
|
||||
mandatory=true
|
||||
versionRange="[1.19.4,1.20)"
|
||||
ordering="NONE"
|
||||
side="BOTH"
|
||||
|
||||
[[dependencies.ftimeouts]]
|
||||
modId="craterlib"
|
||||
mandatory=true
|
||||
versionRange="0.0.x"
|
||||
ordering="AFTER"
|
||||
side="BOTH"
|
||||
Reference in New Issue
Block a user