Move logCall() invocation outside of Runnable

This ensures debug log messages are kept in order
This commit is contained in:
JeremyStar™ 2024-07-21 21:22:53 +02:00
parent e8b9642177
commit f3acca7456
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -143,11 +143,11 @@ public class EventHelper {
* @since v1-alpha0
*/
public static void invokeAnnotatedMethods(@NotNull Class<? extends Event> event, Object... arguments) {
Runnable eventCode = () -> {
LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE));
if (event != LogEvent.class)
logCall(event);
LoggerInstance logger = new LoggerInstance(new LogIssuer(EventHelper.class, event.getName(), CodePart.ENGINE));
if (event != LogEvent.class)
logCall(event);
Runnable eventCode = () -> {
for (ReflectionMethod method : getAnnotatedMethods(event)) {
try {
method.invoke(arguments);