Fix INIT_POST not being invoked (#418)

* Fix INIT_POST not being invoked

* Fix formatting

* Register callback for INIT_POST event in test mod
This commit is contained in:
Matthias
2023-07-24 18:14:55 +02:00
committed by GitHub
parent 8b1bd40f54
commit 6e1b3d13c1
2 changed files with 5 additions and 2 deletions

View File

@@ -71,8 +71,8 @@ public abstract class MixinScreen implements ScreenInputDelegate {
}
}
@Inject(method = "init(Lnet/minecraft/client/Minecraft;II)V", at = @At(value = "RETURN"))
private void postInit(Minecraft minecraft, int i, int j, CallbackInfo ci) {
@Inject(method = "rebuildWidgets", at = @At(value = "RETURN"))
private void postInit(CallbackInfo ci) {
ClientGuiEvent.INIT_POST.invoker().init((Screen) (Object) this, getAccess());
}
}

View File

@@ -290,6 +290,9 @@ public class DebugEvents {
TestMod.SINK.accept(toSimpleName(screen) + " initializes");
return EventResult.pass();
});
ClientGuiEvent.INIT_POST.register(((screen, access) -> {
TestMod.SINK.accept(toSimpleName(screen) + " initialized");
}));
InteractionEvent.CLIENT_LEFT_CLICK_AIR.register((player, hand) -> {
TestMod.SINK.accept(player.getScoreboardName() + " left clicks air" + logSide(player.level()));
});