From dd046e686d985ff2452d0096e2f7090f96cef60c Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Wed, 27 Mar 2024 12:30:03 +0100 Subject: [PATCH] Remove unused DisplayTest (#103) --- .../net/neoforged/fml/IExtensionPoint.java | 69 ------------------- .../java/net/neoforged/fml/ModContainer.java | 19 ----- .../fml/lowcodemod/LowCodeModContainer.java | 2 - 3 files changed, 90 deletions(-) diff --git a/loader/src/main/java/net/neoforged/fml/IExtensionPoint.java b/loader/src/main/java/net/neoforged/fml/IExtensionPoint.java index c69620ff9..2d14ffc7f 100644 --- a/loader/src/main/java/net/neoforged/fml/IExtensionPoint.java +++ b/loader/src/main/java/net/neoforged/fml/IExtensionPoint.java @@ -18,73 +18,4 @@ */ public interface IExtensionPoint { - /** - * Extension point for the compatibility display test used on the server selection screen. - * - * Note: "server" and "client" refers to the {@linkplain net.neoforged.api.distmarker.Dist#DEDICATED_SERVER dedicated server} - * and {@linkplain net.neoforged.api.distmarker.Dist#CLIENT game client} physical distributions, rather than the - * {@linkplain LogicalSide logical server and client}. - * - *
The {@link Supplier} provides the local compatibility version, which is sent from the server to the client - * for multiplayer connections or stored to disk for the world save. The {@link BiPredicate} accepts the remote - * compatibility version and a boolean indicating whether the remote version is from the server or a world save, - * where {@code true} means it is from the server and {@code false} means it is from the world save. The return - * value of the predicate determines whether the remote version is "compatible" for the purposes of the display test.
- * - *The local compatibility version may be of the value {@link net.neoforged.network.NetworkConstants#IGNORESERVERONLY}, - * in which case clients will ignore the mod's presence if it is present on the server but not on the client. - * However, the remote version test predicate must still accept this value as a remote version in order to display - * as compatible if the mod is present on the client.
- * - *The compatibility display test does not necessarily indicate the success or failure of an actual - * connection attempt. Factors such as display test extension misconfiguration, truncation of ping data, - * difference of registry data or network channels between server and client, and others may cause the result of the - * compatibility test to not reflect the actual likelihood of a connection successfully being established between - * the server and the client.
- * - *An example declaration of a display test extension registration for a regular mod (requires to be present on - * server and client) is as follows:
- *{@code - * String compatibilityVersion = "1"; // Could be linked with a network channel version or mod version - * ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, - * () -> new IExtensionPoint.DisplayTest( - * () -> compatibilityVersion, - * (remoteVersion, isFromServer) -> remoteVersion.equals(compatibilityVersion) - * ) - * ); - * }- * - *
An example declaration of a display test extension registration for a server-side-only mod (does not - * require to be present on the client) is as follows:
- *{@code - * ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, - * () -> new IExtensionPoint.DisplayTest( - * // Ignore this mod if not present on the client - * () -> NetworkConstants.IGNORESERVERONLY, - * // If present on the client, accept any version if from a server - * (remoteVersion, isFromServer) -> isFromServer - * ) - * ); - * }- * - *
An example declaration of a display test extension registration for a client-side-only mod (does not - * require to be present on the server) is as follows:
- *{@code - * ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, - * () -> new IExtensionPoint.DisplayTest( - * // Send any version from server to client, since we will be accepting any version as well - * () -> "dQw4w9WgXcQ", - * // Accept any version on the client, from server or from save - * (remoteVersion, isFromServer) -> true - * ) - * ); - * }- * - * @see net.neoforged.network.ServerStatusPing - * @see net.neoforged.client.ForgeHooksClient#processForgeListPingData(net.minecraft.network.protocol.status.ServerStatus, net.minecraft.client.multiplayer.ServerData) - */ - @SuppressWarnings("JavadocReference") // reference to NetworkConstants, ForgeHooksClient - record DisplayTest(Supplier