Added enabled flag to machine class

This commit is contained in:
bdew committed 2013-12-23 15:16:56 +02:00
1 parent bed3149880
commit 914815fee7
2 files changed
+2

No files matched your search

@@ -17,6 +17,7 @@ class MachineManager(ids: IdManager, val tuning: ConfigSection, guiHandler: GuiH
def registerMachine[R <: Machine[_]](machine: R): R = {
machine.tuning = tuning.getSection(machine.name)
if (machine.tuning.getBoolean("Enabled")) {
machine.enabled = true
machine.regBlock(ids)
if (machine.isInstanceOf[GuiProvider])
guiHandler.register(machine.asInstanceOf[GuiProvider])
+1
View File
@@ -20,6 +20,7 @@ import net.bdew.lib.Misc
abstract class Machine[T <: Block](val name: String, val blockConstruct: (Int) => T) {
var block: T = null.asInstanceOf[T]
var tuning: ConfigSection = null
var enabled = false
val modId = Misc.getActiveModId
def regBlock(ids: IdManager) {