diff --git a/src/main/java/de/florianmichael/viafabricplus/event/ChangeProtocolVersionCallback.java b/src/main/java/de/florianmichael/viafabricplus/event/ChangeProtocolVersionCallback.java index ff8963336..3ab5dd92d 100644 --- a/src/main/java/de/florianmichael/viafabricplus/event/ChangeProtocolVersionCallback.java +++ b/src/main/java/de/florianmichael/viafabricplus/event/ChangeProtocolVersionCallback.java @@ -29,11 +29,11 @@ */ public interface ChangeProtocolVersionCallback { - Event EVENT = EventFactory.createArrayBacked(ChangeProtocolVersionCallback.class, listeners -> version -> { + Event EVENT = EventFactory.createArrayBacked(ChangeProtocolVersionCallback.class, listeners -> (oldVersion, newVersion) -> { for (ChangeProtocolVersionCallback listener : listeners) { - listener.onChangeProtocolVersion(version); + listener.onChangeProtocolVersion(oldVersion, newVersion); } }); - void onChangeProtocolVersion(final VersionEnum protocolVersion); + void onChangeProtocolVersion(final VersionEnum oldVersion, final VersionEnum newVersion); } diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java index ec3972c16..c67c4d745 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/ProtocolHack.java @@ -140,7 +140,9 @@ public static void setTargetVersion(VersionEnum newVersion) { final VersionEnum oldVersion = targetVersion; targetVersion = newVersion; - if (oldVersion != newVersion) ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(targetVersion); + if (oldVersion != newVersion) { + ChangeProtocolVersionCallback.EVENT.invoker().onChangeProtocolVersion(oldVersion, targetVersion); + } } /**