post to correct bus

This commit is contained in:
IThundxr 2024-10-12 15:48:47 -04:00
parent 6f946fcedc
commit dc3e264869
Failed to generate hash of commit
2 changed files with 7 additions and 7 deletions

View file

@ -41,13 +41,13 @@ public final class FlywheelNeoForge {
.getModInfo() .getModInfo()
.getVersion(); .getVersion();
IEventBus forgeEventBus = NeoForge.EVENT_BUS; IEventBus gameEventBus = NeoForge.EVENT_BUS;
NeoForgeFlwConfig.INSTANCE.registerSpecs(modContainer); NeoForgeFlwConfig.INSTANCE.registerSpecs(modContainer);
registerImplEventListeners(forgeEventBus, modEventBus); registerImplEventListeners(gameEventBus, modEventBus);
registerLibEventListeners(forgeEventBus, modEventBus); registerLibEventListeners(gameEventBus, modEventBus);
registerBackendEventListeners(forgeEventBus, modEventBus); registerBackendEventListeners(gameEventBus, modEventBus);
CrashReportCallables.registerCrashCallable("Flywheel Backend", BackendManagerImpl::getBackendString); CrashReportCallables.registerCrashCallable("Flywheel Backend", BackendManagerImpl::getBackendString);
FlwImpl.init(); FlwImpl.init();

View file

@ -15,7 +15,7 @@ import dev.engine_room.flywheel.api.event.EndClientResourceReloadEvent;
import dev.engine_room.flywheel.impl.FlwImpl; import dev.engine_room.flywheel.impl.FlwImpl;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.server.packs.resources.ReloadableResourceManager; import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.neoforged.neoforge.common.NeoForge; import net.neoforged.fml.ModLoader;
@Mixin(Minecraft.class) @Mixin(Minecraft.class)
abstract class MinecraftMixin { abstract class MinecraftMixin {
@ -30,11 +30,11 @@ abstract class MinecraftMixin {
@Inject(method = "lambda$new$8", at = @At("HEAD"), remap = false) @Inject(method = "lambda$new$8", at = @At("HEAD"), remap = false)
private void flywheel$onEndInitialResourceReload(@Coerce Object gameLoadCookie, Optional<Throwable> error, CallbackInfo ci) { private void flywheel$onEndInitialResourceReload(@Coerce Object gameLoadCookie, Optional<Throwable> error, CallbackInfo ci) {
NeoForge.EVENT_BUS.post(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, true, error)); ModLoader.postEvent(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, true, error));
} }
@Inject(method = "lambda$reloadResourcePacks$21", at = @At("HEAD"), remap = false) @Inject(method = "lambda$reloadResourcePacks$21", at = @At("HEAD"), remap = false)
private void flywheel$onEndManualResourceReload(boolean recovery, @Coerce Object gameLoadCookie, CompletableFuture<Void> completablefuture, Optional<Throwable> error, CallbackInfo ci) { private void flywheel$onEndManualResourceReload(boolean recovery, @Coerce Object gameLoadCookie, CompletableFuture<Void> completablefuture, Optional<Throwable> error, CallbackInfo ci) {
NeoForge.EVENT_BUS.post(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, false, error)); ModLoader.postEvent(new EndClientResourceReloadEvent((Minecraft) (Object) this, resourceManager, false, error));
} }
} }