Skip to content

Commit

Permalink
post to correct bus
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 12, 2024
1 parent 6f946fc commit dc3e264
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ public FlywheelNeoForge(IEventBus modEventBus, ModContainer modContainer) {
.getModInfo()
.getVersion();

IEventBus forgeEventBus = NeoForge.EVENT_BUS;
IEventBus gameEventBus = NeoForge.EVENT_BUS;

NeoForgeFlwConfig.INSTANCE.registerSpecs(modContainer);

registerImplEventListeners(forgeEventBus, modEventBus);
registerLibEventListeners(forgeEventBus, modEventBus);
registerBackendEventListeners(forgeEventBus, modEventBus);
registerImplEventListeners(gameEventBus, modEventBus);
registerLibEventListeners(gameEventBus, modEventBus);
registerBackendEventListeners(gameEventBus, modEventBus);

CrashReportCallables.registerCrashCallable("Flywheel Backend", BackendManagerImpl::getBackendString);
FlwImpl.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import dev.engine_room.flywheel.impl.FlwImpl;
import net.minecraft.client.Minecraft;
import net.minecraft.server.packs.resources.ReloadableResourceManager;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.fml.ModLoader;

@Mixin(Minecraft.class)
abstract class MinecraftMixin {
Expand All @@ -30,11 +30,11 @@ abstract class MinecraftMixin {

@Inject(method = "lambda$new$8", at = @At("HEAD"), remap = false)
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)
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));
}
}

0 comments on commit dc3e264

Please sign in to comment.