Skip to content

Commit 4ca5e20

Browse files
committed
Is this thing on?
- Fix new fabric instances defaulting to flywheel:off
1 parent 94d99af commit 4ca5e20

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

common/src/main/java/dev/engine_room/flywheel/impl/FlwImpl.java

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ public static void init() {
1818
// impl
1919
BackendManagerImpl.init();
2020

21-
// lib
22-
2321
// backend
2422
FlwBackend.init(FlwConfig.INSTANCE.backendConfig());
2523
}

fabric/src/main/java/dev/engine_room/flywheel/impl/FabricFlwConfig.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public class FabricFlwConfig implements FlwConfig {
3838

3939
private final File file;
4040

41-
public Backend backend = BackendManager.defaultBackend();
41+
// Don't actually default to off, we'll find the true default in #load
42+
public Backend backend = BackendManager.offBackend();
4243
public boolean limitUpdates = LIMIT_UPDATES_DEFAULT;
4344
public int workerThreads = WORKER_THREADS_DEFAULT;
4445

@@ -69,6 +70,10 @@ public BackendConfig backendConfig() {
6970
}
7071

7172
public void load() {
73+
// Grab the default backend here because this object is constructed
74+
// very early in flywheel loading and not all backends may be registered
75+
backend = BackendManager.defaultBackend();
76+
7277
if (file.exists()) {
7378
try (FileReader reader = new FileReader(file)) {
7479
fromJson(JsonParser.parseReader(reader));

0 commit comments

Comments
 (0)