Make fluid transfer speed configurable

https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/7919
This commit is contained in:
repo_alt 2021-06-02 16:41:10 +03:00
parent d972b29a78
commit 8d357101c7
5 changed files with 12 additions and 39 deletions

View File

@ -2,8 +2,8 @@ buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "https://files.minecraftforge.net/maven"
name = "gt"
url = "https://gregtech.overminddl1.com/"
}
maven {
name = "sonatype"
@ -14,16 +14,13 @@ buildscript {
}
}
dependencies {
classpath 'com.github.CDAGaming:ForgeGradle:1c670759c5'
classpath 'com.github.CDAGaming:CurseGradle:184e4322fd'
classpath 'com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT'
}
}
apply plugin: 'scala'
apply plugin: 'forge'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'
tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-deprecation:false"]
@ -263,36 +260,6 @@ artifacts {
archives sourcesJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact apiJar
artifact javadocJar
artifact sourcesJar
artifact deobfJar { classifier 'dev' }
}
}
repositories {
maven {
url System.getenv("MAVEN_PATH")
}
}
}
curseforge {
apiKey = project.hasProperty("curseForgeApiKey") ? project.curseForgeApiKey : ""
project {
id = config.curse.project.id
releaseType = config.curse.project.releaseType
changelogType = "markdown"
changelog = file("changelog.md")
addGameVersion config.minecraft.version
addGameVersion "Java 8"
mainArtifact jar
}
}
// this is needed for IntelliJ so we don't have to copy over the assets manually every time
idea {
module {

View File

@ -1,7 +1,7 @@
minecraft.version=1.7.10
forge.version=10.13.4.1614-1.7.10
oc.version=1.7.5.10-GTNH
oc.version=1.7.5.11-GTNH
ae2.version=rv3-beta-31
bc.version=7.0.9

View File

@ -1390,6 +1390,11 @@ opencomputers {
# Radius the MFU is able to operate in
mfuRange: 3
# Transposer fluid transfer rate in millibuckets per second
# It may transfer unlimited amount per operation, but will then
# wait ((Amount in buckets)/16) seconds
transposerFluidTransferRate=16000
}
# Settings for mod integration (the mod previously known as OpenComponents).

View File

@ -53,7 +53,7 @@ class Settings(val config: Config) {
(-1.0, -1.0)
}
val enableNanomachinePfx = config.getBoolean("client.enableNanomachinePfx")
val transposerFluidTransferRate = try { config.getInt("misc.transposerFluidTransferRate") } catch { case _ : Throwable => 16000 }
// ----------------------------------------------------------------------- //
// computer
val threads = config.getInt("computer.threads") max 1

View File

@ -1,5 +1,6 @@
package li.cil.oc.server.component.traits
import li.cil.oc.Settings
import li.cil.oc.api.machine.Arguments
import li.cil.oc.api.machine.Callback
import li.cil.oc.api.machine.Context
@ -54,7 +55,7 @@ trait InventoryTransfer extends traits.WorldAware with traits.SideRestricted {
result(Unit, reason)
case _ =>
val moved = FluidUtils.transferBetweenFluidHandlersAt(sourcePos, sourceSide.getOpposite, sinkPos, sinkSide.getOpposite, count, sourceTank)
if (moved > 0) context.pause(moved / 1000 * 0.25) // Allow up to 4 buckets per second.
if (moved > 0) context.pause(moved / Settings.get.transposerFluidTransferRate) // Allow up to 16 buckets per second.
result(moved > 0, moved)
}
}