2021-06-19 07:52:33 +02:00
|
|
|
package com.jozufozu.flywheel;
|
|
|
|
|
|
|
|
import com.jozufozu.flywheel.backend.Backend;
|
2021-06-23 22:19:03 +02:00
|
|
|
import com.jozufozu.flywheel.core.Contexts;
|
|
|
|
import com.jozufozu.flywheel.core.Materials;
|
2021-07-09 22:39:56 +02:00
|
|
|
import com.jozufozu.flywheel.core.PartialModel;
|
2021-11-25 03:43:05 +01:00
|
|
|
import com.jozufozu.flywheel.core.StitchedSprite;
|
2021-12-16 00:13:42 +01:00
|
|
|
import com.jozufozu.flywheel.mixin.PausedPartialTickAccessor;
|
2021-07-09 22:24:26 +02:00
|
|
|
import com.jozufozu.flywheel.vanilla.VanillaInstances;
|
|
|
|
|
2021-06-23 22:19:03 +02:00
|
|
|
import net.minecraftforge.eventbus.api.IEventBus;
|
2021-12-31 05:01:45 +01:00
|
|
|
import net.minecraftforge.fml.CrashReportCallables;
|
2021-06-19 07:52:33 +02:00
|
|
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
|
|
|
|
2021-06-30 21:43:54 +02:00
|
|
|
public class FlywheelClient {
|
2021-06-19 07:52:33 +02:00
|
|
|
|
|
|
|
public static void clientInit() {
|
2021-12-31 05:01:45 +01:00
|
|
|
CrashReportCallables.registerCrashCallable("Flywheel Backend", () ->
|
|
|
|
Backend.getInstance().getBackendDescriptor());
|
|
|
|
|
2021-06-19 07:52:33 +02:00
|
|
|
Backend.init();
|
2021-06-30 21:43:54 +02:00
|
|
|
IEventBus modEventBus = FMLJavaModLoadingContext.get()
|
|
|
|
.getModEventBus();
|
2021-06-23 22:19:03 +02:00
|
|
|
|
|
|
|
modEventBus.addListener(Contexts::flwInit);
|
|
|
|
modEventBus.addListener(Materials::flwInit);
|
2021-07-09 22:39:56 +02:00
|
|
|
modEventBus.addListener(PartialModel::onModelRegistry);
|
|
|
|
modEventBus.addListener(PartialModel::onModelBake);
|
2021-11-25 03:43:05 +01:00
|
|
|
modEventBus.addListener(StitchedSprite::onTextureStitchPre);
|
|
|
|
modEventBus.addListener(StitchedSprite::onTextureStitchPost);
|
2021-07-09 22:24:26 +02:00
|
|
|
|
|
|
|
VanillaInstances.init();
|
2021-12-16 00:13:42 +01:00
|
|
|
|
|
|
|
// https://github.com/Jozufozu/Flywheel/issues/69
|
|
|
|
// Weird issue with accessor loading.
|
|
|
|
// Only thing I've seen that's close to a fix is to force the class to load before trying to use it.
|
|
|
|
// From the SpongePowered discord:
|
|
|
|
// https://discord.com/channels/142425412096491520/626802111455297538/675007581168599041
|
2021-12-25 08:26:18 +01:00
|
|
|
Flywheel.LOGGER.info("Successfully loaded {}", PausedPartialTickAccessor.class.getName());
|
2021-06-19 07:52:33 +02:00
|
|
|
}
|
|
|
|
}
|