Initial Commit

This commit is contained in:
2023-03-20 20:42:09 +02:00
commit aa84399703
26 changed files with 1019 additions and 0 deletions

15
.gitattributes vendored Normal file
View File

@@ -0,0 +1,15 @@
* text eol=lf
*.bat text eol=crlf
*.patch text eol=lf
*.java text eol=lf
*.gradle text eol=crlf
*.png binary
*.gif binary
*.exe binary
*.dll binary
*.jar binary
*.lzma binary
*.zip binary
*.pyd binary
*.cfg text eol=lf
*.jks binary

27
.gitignore vendored Normal file
View File

@@ -0,0 +1,27 @@
# eclipse
bin
*.launch
.settings
.metadata
.classpath
.project
# idea
out
*.ipr
*.iws
*.iml
.idea
# gradle
build
.gradle
# other
eclipse
run
artifacts
ColorGen.java
Forge/src/generated

53
Common/build.gradle Normal file
View File

@@ -0,0 +1,53 @@
plugins {
id 'java'
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT'
id 'maven-publish'
}
archivesBaseName = "${mod_name}-common-${minecraft_version}"
minecraft {
version(minecraft_version)
runs {
if (project.hasProperty('common_runs_enabled') ? project.findProperty('common_runs_enabled').toBoolean() : true) {
server(project.hasProperty('common_server_run_name') ? project.findProperty('common_server_run_name') : 'vanilla_server') {
workingDirectory(this.file("run"))
}
client(project.hasProperty('common_client_run_name') ? project.findProperty('common_client_run_name') : 'vanilla_client') {
workingDirectory(this.file("run"))
}
}
}
}
dependencies {
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5'
compileOnly("me.hypherionmc.craterlib:CraterLib-common-${minecraft_version}:${craterlib_version}")
}
processResources {
def buildProps = project.properties.clone()
filesMatching(['pack.mcmeta']) {
expand buildProps
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}

View File

@@ -0,0 +1,7 @@
package me.hypherionmc.ftimeouts;
public class Constants {
public static final String MOD_ID = "ftimeouts";
}

View File

@@ -0,0 +1,11 @@
package me.hypherionmc.ftimeouts;
import me.hypherionmc.ftimeouts.config.FTimeoutsConfig;
public class ServerInit {
public static FTimeoutsConfig config = new FTimeoutsConfig();
public static void load() {}
}

View File

@@ -0,0 +1,40 @@
package me.hypherionmc.ftimeouts.config;
import me.hypherionmc.craterlib.common.config.ModuleConfig;
import me.hypherionmc.ftimeouts.ServerInit;
import me.hypherionmc.ftimeouts.Constants;
import me.hypherionmc.moonconfig.core.conversion.Path;
import me.hypherionmc.moonconfig.core.conversion.SpecComment;
public class FTimeoutsConfig extends ModuleConfig {
@Path("connectionTimeout")
@SpecComment("The login timeout in ticks")
public int connectionTimeout = 2400;
@Path("readTimeout")
@SpecComment("The connection read timeout in seconds")
public int readTimeout = 120;
@Path("keepAlive")
@SpecComment("How long (in seconds) before server keep alive ends")
public int keepAlive = 60;
@Path("keepAlivePacket")
@SpecComment("""
The KeepAlive timeout in seconds.
This is how long the server waits for a player to return a KeepAlive packet\s
before disconnecting them.
This is automatically rounded up to a multiple of the KeepAlive packet interval.""")
public int keepAlivePacket = 120;
public FTimeoutsConfig() {
super(Constants.MOD_ID, "ftimeouts");
registerAndSetup(this);
}
@Override
public void configReloaded() {
ServerInit.config = loadConfig(this);
}
}

View File

@@ -0,0 +1,21 @@
package me.hypherionmc.ftimeouts.mixin;
import me.hypherionmc.ftimeouts.ServerInit;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(targets = {
"net/minecraft/network/Connection$1",
"net/minecraft/server/network/ServerConnectionListener$1"
})
public class ConnectionMixin {
@ModifyArg(method = "initChannel",
at = @At(value = "INVOKE", target = "Lio/netty/handler/timeout/ReadTimeoutHandler;<init>(I)V")
)
private int getReadTimeout(int timeout) {
return ServerInit.config.readTimeout;
}
}

View File

@@ -0,0 +1,32 @@
package me.hypherionmc.ftimeouts.mixin;
import me.hypherionmc.ftimeouts.ServerInit;
import net.minecraft.Util;
import net.minecraft.network.chat.Component;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
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.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ServerGamePacketListenerImpl.class)
public class ServerGamePacketMixin {
@Shadow private long keepAliveTime;
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerGamePacketListenerImpl;disconnect(Lnet/minecraft/network/chat/Component;)V"))
private void disconnect(ServerGamePacketListenerImpl instance, Component $$0) {
final long keepAliveTimeoutMillis = ServerInit.config.keepAlive * 1000L;
if (Util.getMillis() - keepAliveTime >= keepAliveTimeoutMillis) {
instance.disconnect($$0);
}
}
@ModifyConstant(method = "tick", constant = { @Constant(longValue = 15000L), @Constant(longValue = 25000L) })
private long getKeepAlivePacketInterval(long interval) {
return ServerInit.config.keepAlivePacket * 1000L;
}
}

View File

@@ -0,0 +1,31 @@
package me.hypherionmc.ftimeouts.mixin;
import me.hypherionmc.ftimeouts.ServerInit;
import net.minecraft.network.chat.Component;
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(ServerLoginPacketListenerImpl.class)
public class ServerLoginMixin {
@Shadow private int tick;
@Inject(method = "tick", at = @At("TAIL"))
private void injectTick(CallbackInfo ci) {
if (tick >= ServerInit.config.connectionTimeout) {
((ServerLoginPacketListenerImpl) (Object) this).disconnect(
Component.translatable("multiplayer.disconnect.slow_login")
);
}
}
@Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/network/ServerLoginPacketListenerImpl;disconnect(Lnet/minecraft/network/chat/Component;)V"))
private void disconnect(ServerLoginPacketListenerImpl instance, Component $$0) {
}
}

View File

@@ -0,0 +1,15 @@
{
"required": true,
"minVersion": "0.8",
"package": "me.hypherionmc.ftimeouts.mixin",
"compatibilityLevel": "JAVA_17",
"server": [
"ConnectionMixin",
"ServerLoginMixin",
"ServerGamePacketMixin"
],
"injectors": {
"defaultRequire": 1
},
"refmap": "${refmap_target}refmap.json"
}

View File

@@ -0,0 +1,6 @@
{
"pack": {
"description": "${mod_name}",
"pack_format": 9
}
}

98
Fabric/build.gradle Normal file
View File

@@ -0,0 +1,98 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
id 'idea'
}
archivesBaseName = "${mod_name}-fabric-${minecraft_version}"
repositories {
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" }
}
dependencies {
minecraft "com.mojang:minecraft:${minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
implementation project(":Common")
modApi("me.hypherionmc.craterlib:CraterLib-fabric-${minecraft_version}:${craterlib_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}
loom {
runs {
client {
client()
setConfigName("Fabric Client")
ideConfigGenerated(true)
runDir("run")
}
server {
server()
setConfigName("Fabric Server")
ideConfigGenerated(true)
runDir("run")
}
}
}
processResources {
from project(":Common").sourceSets.main.resources
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
filesMatching('*.mixins.json') {
expand "refmap_target": "${archivesBaseName}-"
}
}
tasks.withType(JavaCompile) {
source(project(":Common").sourceSets.main.allSource)
}
jar {
from("LICENSE") {
rename { "${it}_${mod_name}" }
}
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
version project.version
from components.java
}
}
repositories {
maven {
url "file://" + System.getenv("local_maven")
}
}
}
task delDevJar {
doLast {
def tree = fileTree('build/libs')
tree.include '**/*-dev.jar'
tree.each { it.delete() }
}
}
build.finalizedBy delDevJar
task copyAllArtifacts(type: Copy) {
from "$buildDir/libs"
into "$rootDir/artifacts"
include("*.jar")
}
build.finalizedBy(copyAllArtifacts);

View File

@@ -0,0 +1,11 @@
package me.hypherionmc.ftimeouts;
import net.fabricmc.api.DedicatedServerModInitializer;
public class FTimeouts implements DedicatedServerModInitializer {
@Override
public void onInitializeServer() {
ServerInit.load();
}
}

View File

@@ -0,0 +1,35 @@
{
"schemaVersion": 1,
"id": "ftimeouts",
"version": "${version}",
"name": "F Timeouts",
"description": "No more server timeouts",
"authors": [
"HypherionSA"
],
"contact": {
"homepage": "",
"sources": ""
},
"license": "MIT",
"environment": "server",
"entrypoints": {
"server": [
"me.hypherionmc.fucktimeouts.FTimeouts"
]
},
"mixins": [
"ftimeouts.mixins.json"
],
"depends": {
"fabricloader": ">=0.14",
"fabric": "*",
"minecraft": ">=1.19.4",
"java": ">=17",
"craterlib": "*"
}
}

124
Forge/build.gradle Normal file
View 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)

View 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();
}
}

View 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"

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) [2022] [HypherionMC and Contributors]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
# F**k Timeouts
Slow connections and getting kicked from servers pissing you off? Well, time to say "F**k TIMEOUTS"!
This SERVER SIDE mod contains the connection timeout configuration from Random Patches standalone because it hasn't updated to 1.18.
This mod is for internal use only, but, if you REALLY need it, download it from our [Jenkins](https://ci.firstdarkdev.xyz/job/FTimeouts/).
Relies on [CraterLib](https://ci.firstdarkdev.xyz/job/CraterLib)

82
build.gradle Normal file
View File

@@ -0,0 +1,82 @@
subprojects {
ext {
release=project.properties['release'] ?: false
}
def version_base = "${project.version_major}.${project.version_minor}"
version = "${version_base}.${project.version_patch}"
// Jenkins
if (!release && System.getenv('BUILD_NUMBER') != null) {
version = version_base + "." + System.getenv('BUILD_NUMBER') + "d"
}
apply plugin: 'java'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
//java.withSourcesJar()
//java.withJavadocJar()
jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestampe' : System.currentTimeMillis(),
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Build-On-Minecraft' : minecraft_version
])
}
}
repositories {
mavenCentral()
mavenLocal()
maven {
name = 'Sponge / Mixin'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
maven {
name = 'First Dark Dev Maven Snapshots'
url = 'https://maven.firstdarkdev.xyz/snapshots'
}
maven {
name = 'First Dark Dev Maven Releases'
url = 'https://maven.firstdarkdev.xyz/releases'
}
maven {
name = "TerraformersMC Maven"
url = "https://maven.terraformersmc.com/releases"
}
maven {
name = "Curseforge Maven"
url 'https://cfa2.cursemaven.com'
}
maven { url = "https://maven.k-4u.nl" }
maven { url = "https://maven.wispforest.io/" }
maven { url "https://maven.bai.lol" }
}
tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.release = 17
}
// Disables Gradle's custom module metadata from being published to maven. The
// metadata includes mapped dependencies which are not reasonably consumable by
// other mod developers.
tasks.withType(GenerateModuleMetadata) {
enabled = false
}
clean {
delete "$rootDir/artifacts"
}
}

31
gradle.properties Normal file
View File

@@ -0,0 +1,31 @@
# Project
version_major=1
version_minor=0
version_patch=0
group=me.hypherionmc.ftimeouts
# Common
minecraft_version=1.19.4
common_runs_enabled=false
common_client_run_name=Common Client
common_server_run_name=Common Server
# Forge
forge_version=45.0.9
forge_ats_enabled=true
# Fabric
fabric_version=0.76.0+1.19.4
fabric_loader_version=0.14.9
# Mod options
mod_name=FTimeouts
mod_author=HypherionSA
mod_id=ftimeouts
# Gradle
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
#dependencies
craterlib_version=0.0.6d

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

183
gradlew vendored Normal file
View File

@@ -0,0 +1,183 @@
#!/usr/bin/env bash
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
ARGV=("$@")
eval set -- $DEFAULT_JVM_OPTS
IFS=$'
' read -rd '' -a JAVA_OPTS_ARR <<< "$(echo $JAVA_OPTS | xargs -n1)"
IFS=$'
' read -rd '' -a GRADLE_OPTS_ARR <<< "$(echo $GRADLE_OPTS | xargs -n1)"
exec "$JAVACMD" "$@" "${JAVA_OPTS_ARR[@]}" "${GRADLE_OPTS_ARR[@]}" "-Dorg.gradle.appname=$APP_BASE_NAME" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "${ARGV[@]}"

89
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

16
settings.gradle Normal file
View File

@@ -0,0 +1,16 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven {
name = 'Sponge Snapshots'
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
}
}
rootProject.name = 'FTimeouts'
include("Common", "Fabric", "Forge")