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 { repositories {
mavenCentral() mavenCentral()
maven { maven {
name = "forge" name = "gt"
url = "https://files.minecraftforge.net/maven" url = "https://gregtech.overminddl1.com/"
} }
maven { maven {
name = "sonatype" name = "sonatype"
@ -14,16 +14,13 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.github.CDAGaming:ForgeGradle:1c670759c5' classpath 'com.github.GTNH2:ForgeGradle:FG_1.2-SNAPSHOT'
classpath 'com.github.CDAGaming:CurseGradle:184e4322fd'
} }
} }
apply plugin: 'scala' apply plugin: 'scala'
apply plugin: 'forge' apply plugin: 'forge'
apply plugin: 'idea' apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.matthewprenger.cursegradle'
tasks.withType(ScalaCompile) { tasks.withType(ScalaCompile) {
scalaCompileOptions.additionalParameters = ["-deprecation:false"] scalaCompileOptions.additionalParameters = ["-deprecation:false"]
@ -263,36 +260,6 @@ artifacts {
archives sourcesJar 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 // this is needed for IntelliJ so we don't have to copy over the assets manually every time
idea { idea {
module { module {

View File

@ -1,7 +1,7 @@
minecraft.version=1.7.10 minecraft.version=1.7.10
forge.version=10.13.4.1614-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 ae2.version=rv3-beta-31
bc.version=7.0.9 bc.version=7.0.9

View File

@ -1390,6 +1390,11 @@ opencomputers {
# Radius the MFU is able to operate in # Radius the MFU is able to operate in
mfuRange: 3 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). # 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) (-1.0, -1.0)
} }
val enableNanomachinePfx = config.getBoolean("client.enableNanomachinePfx") val enableNanomachinePfx = config.getBoolean("client.enableNanomachinePfx")
val transposerFluidTransferRate = try { config.getInt("misc.transposerFluidTransferRate") } catch { case _ : Throwable => 16000 }
// ----------------------------------------------------------------------- // // ----------------------------------------------------------------------- //
// computer // computer
val threads = config.getInt("computer.threads") max 1 val threads = config.getInt("computer.threads") max 1

View File

@ -1,5 +1,6 @@
package li.cil.oc.server.component.traits 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.Arguments
import li.cil.oc.api.machine.Callback import li.cil.oc.api.machine.Callback
import li.cil.oc.api.machine.Context import li.cil.oc.api.machine.Context
@ -54,7 +55,7 @@ trait InventoryTransfer extends traits.WorldAware with traits.SideRestricted {
result(Unit, reason) result(Unit, reason)
case _ => case _ =>
val moved = FluidUtils.transferBetweenFluidHandlersAt(sourcePos, sourceSide.getOpposite, sinkPos, sinkSide.getOpposite, count, sourceTank) 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) result(moved > 0, moved)
} }
} }