Merge branch 'master-MC1.11' into master-MC1.12

This commit is contained in:
payonel 2018-10-31 03:12:10 -07:00
commit 7faadb53ea
4 changed files with 29 additions and 15 deletions

View File

@ -1383,14 +1383,6 @@ opencomputers {
# Radius the MFU is able to operate in
mfuRange: 3
# list of dimension ids blacklisted for the chunk loader upgrade
# a blacklisted dimension blocks a whitelisted dimension
chunkloaderDimensionBlacklist: []
# list of dimension ids whitelisted for the chunk loader upgrade
# a non-empty whitelist denies all unlisted dimensions
chunkloaderDimensionWhitelist: []
}
# Settings for mod integration (the mod previously known as OpenComponents).
@ -1573,4 +1565,18 @@ opencomputers {
# the native C locale).
disableLocaleChanging: false
}
# Chunkloader Upgrade settings.
chunkloader {
# This is a list of blacklisted dimensions. Chunkloaders may only be activated
# in dimensions that aren't present in this list.
dimBlacklist: []
# This is a list of whitelisted dimensions. Chunkloaders may only be activated
# in dimensions that are present in this list. If this list is empty,
# chunkloaders may be activated to all dimensions not blacklisted. Note that the
# blacklist is always applied, so if an entry is present in both the
# whitelist and the blacklist, the blacklist will win.
dimWhitelist: []
}
}

View File

@ -413,6 +413,10 @@ class Settings(val config: Config) {
val printsHaveOpacity = config.getBoolean("printer.printsHaveOpacity")
val noclipMultiplier = config.getDouble("printer.noclipMultiplier") max 0
// chunkloader
val chunkloadDimensionBlacklist = Settings.getIntList(config, "chunkloader.dimBlacklist")
val chunkloadDimensionWhitelist = Settings.getIntList(config, "chunkloader.dimWhitelist")
// ----------------------------------------------------------------------- //
// integration
val modBlacklist = config.getStringList("integration.modBlacklist")
@ -464,11 +468,6 @@ class Settings(val config: Config) {
val registerLuaJArchitecture = config.getBoolean("debug.registerLuaJArchitecture")
val disableLocaleChanging = config.getBoolean("debug.disableLocaleChanging")
val chunkloadDimensionBlacklist = if (config.hasPath("misc.chunkloaderDimensionBlacklist")) config.getIntList("misc.chunkloaderDimensionBlacklist")
else new java.util.LinkedList[Integer]()
val chunkloadDimensionWhitelist = if (config.hasPath("misc.chunkloaderDimensionWhitelist")) config.getIntList("misc.chunkloaderDimensionWhitelist")
else new java.util.LinkedList[Integer]()
}
object Settings {
@ -702,4 +701,12 @@ object Settings {
}
}
}
def getIntList(config: Config, path: String, default: Option[java.util.List[Integer]] = None): java.util.List[Integer] = {
if (config.hasPath(path))
config.getIntList(path)
else
default.getOrElse(new java.util.LinkedList[Integer]())
}
}

View File

@ -166,12 +166,12 @@ class Microcontroller extends traits.PowerAcceptor with traits.Hub with traits.C
if (node == plug.node) {
api.Network.joinNewNetwork(machine.node)
machine.node.connect(snooperNode)
connectComponents()
}
if (plug.isPrimary)
plug.node.connect(componentNodes(plug.side.ordinal()))
else
componentNodes(plug.side.ordinal).remove()
connectComponents()
}
override protected def onPlugDisconnect(plug: Plug, node: Node) {
@ -180,6 +180,8 @@ class Microcontroller extends traits.PowerAcceptor with traits.Hub with traits.C
plug.node.connect(componentNodes(plug.side.ordinal()))
else
componentNodes(plug.side.ordinal).remove()
if (node == plug.node)
disconnectComponents()
}
override protected def onPlugMessage(plug: Plug, message: Message): Unit = {

View File

@ -258,7 +258,6 @@ object ModOpenComputers extends ModProxy {
Constants.ItemName.GraphicsCardTier2,
Constants.ItemName.GraphicsCardTier3,
Constants.ItemName.AngelUpgrade,
Constants.ItemName.ChunkloaderUpgrade,
Constants.ItemName.CraftingUpgrade,
Constants.ItemName.DatabaseUpgradeTier1,
Constants.ItemName.DatabaseUpgradeTier2,