mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-13 16:54:11 +00:00
Added enabled flag to machine class
This commit is contained in:
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])
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user