From 0d7f507f4e7337436e3208d5ba4054ef14895669 Mon Sep 17 00:00:00 2001 From: cpw Date: Sat, 7 Nov 2020 23:11:45 -0500 Subject: [PATCH] Some help in ExtensionPoint regarding DISPLAYTEST. Let's improve those tick rates! Signed-off-by: cpw --- .../minecraftforge/fml/ExtensionPoint.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main/java/net/minecraftforge/fml/ExtensionPoint.java b/src/main/java/net/minecraftforge/fml/ExtensionPoint.java index 75eb6af891..0ec8fdef78 100644 --- a/src/main/java/net/minecraftforge/fml/ExtensionPoint.java +++ b/src/main/java/net/minecraftforge/fml/ExtensionPoint.java @@ -40,6 +40,33 @@ public class ExtensionPoint * * The supplier provides my "local" version for sending across the network or writing to disk * The predicate tests the version from a remote instance or save for acceptability (Boolean is true for network, false for local save) + * and returns true if the version is compatible. + * + *

Return {@link net.minecraftforge.fml.network.FMLNetworkConstants#IGNORESERVERONLY} in the supplier, if you wish to be ignored + * as a server side only mod.

+ *

Return true in the predicate for all values of the input string (when network boolean is true) if you are client side, + * and don't care about matching any potential server version.

+ * + *

+ * Examples: A server only mod + * + *

+     *     registerExtensionPoint(DISPLAYTEST, ()->Pair.of(
+     *      ()->FMLNetworkConstants.IGNORESERVERONLY, // ignore me, I'm a server only mod
+     *      (s,b)->true // i accept anything from the server or the save, if I'm asked
+     *     )
+     * 
+ *

+ *

+ * Examples: A client only mod + *

+     *     registerExtensionPoint(DISPLAYTEST, ()->Pair.of(
+     *      ()->"anything. i don't care", // if i'm actually on the server, this string is sent but i'm a client only mod, so it won't be
+     *      (remoteversionstring,networkbool)->networkbool // i accept anything from the server, by returning true if it's asking about the server
+     *     )
+     * 
+ *

+ * */ public static final ExtensionPoint, BiPredicate>> DISPLAYTEST = new ExtensionPoint<>();