mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 09:18:05 -04:00
Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8
This commit is contained in:
commit
3a5b8047e8
10
.travis.yml
10
.travis.yml
@ -1,12 +1,16 @@
|
|||||||
sudo: false
|
sudo: false
|
||||||
language: scala
|
language: scala
|
||||||
scala: 2.11.1
|
scala: 2.11.1
|
||||||
jdk: openjdk7
|
jdk:
|
||||||
|
- openjdk7
|
||||||
|
- openjdk8
|
||||||
|
- oraclejdk7
|
||||||
|
- oraclejdk8
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
env:
|
env:
|
||||||
global: TERM=dumb
|
global: TERM=dumb
|
||||||
|
|
||||||
install: ./gradlew setupCIWorkspace
|
install: gradle setupCIWorkspace
|
||||||
script: ./gradlew build
|
script: gradle build
|
||||||
|
@ -22,12 +22,12 @@ import net.minecraft.inventory.IInventory;
|
|||||||
*/
|
*/
|
||||||
public interface ServerRack extends Environment, SidedEnvironment, Rotatable, IInventory {
|
public interface ServerRack extends Environment, SidedEnvironment, Rotatable, IInventory {
|
||||||
/**
|
/**
|
||||||
* The machine currently hosted by the server in the specified slot.
|
* The server in the specified slot.
|
||||||
* <p/>
|
* <p/>
|
||||||
* This can be <tt>null</tt>, for example when there is no CPU installed
|
* This can be <tt>null</tt>, for example when there is no server installed
|
||||||
* in the server in that slot, or there is no server in that slot.
|
* in that slot.
|
||||||
*
|
*
|
||||||
* @return the machine currently hosted in the specified slot.
|
* @return the server currently hosted in the specified slot.
|
||||||
*/
|
*/
|
||||||
Server server(int slot);
|
Server server(int slot);
|
||||||
|
|
||||||
|
@ -1172,6 +1172,13 @@ opencomputers {
|
|||||||
# Time in seconds to pause a calling machine when the soft limit for a data
|
# Time in seconds to pause a calling machine when the soft limit for a data
|
||||||
# card callback is exceeded.
|
# card callback is exceeded.
|
||||||
dataCardTimeout: 1.0
|
dataCardTimeout: 1.0
|
||||||
|
|
||||||
|
# The general upgrade tier of the switch built into server racks, i.e. how
|
||||||
|
# upgraded server racks' switching logic is. Prior to the introduction of
|
||||||
|
# this setting (1.5.15) this was always none. This applies to all
|
||||||
|
# properties, i.e. througput, frequency and buffer size.
|
||||||
|
# Valid values are: 0 = none, 1 = tier 1, 2 = tier 2, 3 = tier 3.
|
||||||
|
serverRackSwitchTier: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Settings for mod integration (the mod previously known as OpenComponents).
|
# Settings for mod integration (the mod previously known as OpenComponents).
|
||||||
|
@ -9,6 +9,7 @@ import com.google.common.net.InetAddresses
|
|||||||
import com.mojang.authlib.GameProfile
|
import com.mojang.authlib.GameProfile
|
||||||
import com.typesafe.config._
|
import com.typesafe.config._
|
||||||
import li.cil.oc.api.component.TextBuffer.ColorDepth
|
import li.cil.oc.api.component.TextBuffer.ColorDepth
|
||||||
|
import li.cil.oc.common.Tier
|
||||||
import li.cil.oc.integration.Mods
|
import li.cil.oc.integration.Mods
|
||||||
import net.minecraftforge.fml.common.Loader
|
import net.minecraftforge.fml.common.Loader
|
||||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion
|
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion
|
||||||
@ -325,6 +326,7 @@ class Settings(val config: Config) {
|
|||||||
val dataCardSoftLimit = config.getInt("misc.dataCardSoftLimit") max 0
|
val dataCardSoftLimit = config.getInt("misc.dataCardSoftLimit") max 0
|
||||||
val dataCardHardLimit = config.getInt("misc.dataCardHardLimit") max 0
|
val dataCardHardLimit = config.getInt("misc.dataCardHardLimit") max 0
|
||||||
val dataCardTimeout = config.getDouble("misc.dataCardTimeout") max 0
|
val dataCardTimeout = config.getDouble("misc.dataCardTimeout") max 0
|
||||||
|
val serverRackSwitchTier = (config.getInt("misc.serverRackSwitchTier") - 1) max Tier.None min Tier.Three
|
||||||
|
|
||||||
// ----------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------- //
|
||||||
// printer
|
// printer
|
||||||
|
@ -5,6 +5,7 @@ import java.util.Calendar
|
|||||||
import li.cil.oc._
|
import li.cil.oc._
|
||||||
import li.cil.oc.api.Network
|
import li.cil.oc.api.Network
|
||||||
import li.cil.oc.api.detail.ItemInfo
|
import li.cil.oc.api.detail.ItemInfo
|
||||||
|
import li.cil.oc.api.internal.ServerRack
|
||||||
import li.cil.oc.api.machine.MachineHost
|
import li.cil.oc.api.machine.MachineHost
|
||||||
import li.cil.oc.client.renderer.PetRenderer
|
import li.cil.oc.client.renderer.PetRenderer
|
||||||
import li.cil.oc.common.asm.ClassTransformer
|
import li.cil.oc.common.asm.ClassTransformer
|
||||||
@ -322,7 +323,15 @@ object EventHandler {
|
|||||||
e.getChunk.getEntityLists.foreach(_.collect {
|
e.getChunk.getEntityLists.foreach(_.collect {
|
||||||
case host: MachineHost => host.machine match {
|
case host: MachineHost => host.machine match {
|
||||||
case machine: Machine => scheduleClose(machine)
|
case machine: Machine => scheduleClose(machine)
|
||||||
|
case _ => // Dafuq?
|
||||||
}
|
}
|
||||||
|
case rack: ServerRack =>
|
||||||
|
(0 until rack.getSizeInventory).
|
||||||
|
map(rack.server).
|
||||||
|
filter(_ != null).
|
||||||
|
map(_.machine()).
|
||||||
|
filter(_ != null).
|
||||||
|
foreach(_.stop())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,11 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB
|
|||||||
// Used on client side to check whether to render disk activity indicators.
|
// Used on client side to check whether to render disk activity indicators.
|
||||||
var lastAccess = Array.fill(4)(0L)
|
var lastAccess = Array.fill(4)(0L)
|
||||||
|
|
||||||
|
val builtInSwitchTier = Settings.get.serverRackSwitchTier
|
||||||
|
relayDelay = math.max(1, relayBaseDelay - (builtInSwitchTier + 1) * relayDelayPerUpgrade)
|
||||||
|
relayAmount = math.max(1, relayBaseAmount + (builtInSwitchTier + 1) * relayAmountPerUpgrade)
|
||||||
|
maxQueueSize = math.max(1, queueBaseSize + (builtInSwitchTier + 1) * queueSizePerUpgrade)
|
||||||
|
|
||||||
override def server(slot: Int) = servers(slot).orNull
|
override def server(slot: Int) = servers(slot).orNull
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user