mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 03:05:30 -04:00
Adjusted export bus driver for AE2 API changes. Closes #997.
Also got rid of another use of an internal class.
This commit is contained in:
parent
171e58c7b8
commit
3251a8ba2f
@ -1,5 +1,6 @@
|
|||||||
package li.cil.oc.integration.appeng
|
package li.cil.oc.integration.appeng
|
||||||
|
|
||||||
|
import appeng.api.AEApi
|
||||||
import appeng.api.config.Actionable
|
import appeng.api.config.Actionable
|
||||||
import appeng.api.config.FuzzyMode
|
import appeng.api.config.FuzzyMode
|
||||||
import appeng.api.config.Settings
|
import appeng.api.config.Settings
|
||||||
@ -7,7 +8,6 @@ import appeng.api.config.Upgrades
|
|||||||
import appeng.api.networking.security.MachineSource
|
import appeng.api.networking.security.MachineSource
|
||||||
import appeng.parts.automation.PartExportBus
|
import appeng.parts.automation.PartExportBus
|
||||||
import appeng.util.Platform
|
import appeng.util.Platform
|
||||||
import appeng.util.item.AEItemStack
|
|
||||||
import li.cil.oc.api.driver
|
import li.cil.oc.api.driver
|
||||||
import li.cil.oc.api.driver.NamedBlock
|
import li.cil.oc.api.driver.NamedBlock
|
||||||
import li.cil.oc.api.internal.Database
|
import li.cil.oc.api.internal.Database
|
||||||
@ -98,11 +98,15 @@ object DriverExportBus extends driver.Block {
|
|||||||
case 4 => 96
|
case 4 => 96
|
||||||
case _ => 1
|
case _ => 1
|
||||||
}
|
}
|
||||||
val fuzzyMode = export.getConfigManager.getSetting(Settings.FUZZY_MODE).asInstanceOf[FuzzyMode]
|
// We need reflection here to avoid compiling against the return type,
|
||||||
|
// which has changed in rv2-beta-20 or so.
|
||||||
|
val fuzzyMode = export.getConfigManager.
|
||||||
|
getClass.getMethod("getSetting", classOf[Enum[_]]).
|
||||||
|
invoke(export.getConfigManager, Settings.FUZZY_MODE).asInstanceOf[FuzzyMode]
|
||||||
val source = new MachineSource(export)
|
val source = new MachineSource(export)
|
||||||
var didSomething = false
|
var didSomething = false
|
||||||
for (slot <- 0 until config.getSizeInventory if count > 0) {
|
for (slot <- 0 until config.getSizeInventory if count > 0) {
|
||||||
val filter = AEItemStack.create(config.getStackInSlot(slot))
|
val filter = AEApi.instance.storage.createItemStack(config.getStackInSlot(slot))
|
||||||
val stacks =
|
val stacks =
|
||||||
if (export.getInstalledUpgrades(Upgrades.FUZZY) > 0)
|
if (export.getInstalledUpgrades(Upgrades.FUZZY) > 0)
|
||||||
itemStorage.getStorageList.findFuzzy(filter, fuzzyMode).toSeq
|
itemStorage.getStorageList.findFuzzy(filter, fuzzyMode).toSeq
|
||||||
|
Loading…
x
Reference in New Issue
Block a user