Class ExtensionPoint<T>
- java.lang.Object
-
- net.minecraftforge.fml.ExtensionPoint<T>
-
public class ExtensionPoint<T> extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static ExtensionPoint<java.util.function.BiFunction<Minecraft,Screen,Screen>>
CONFIGGUIFACTORY
static ExtensionPoint<org.apache.commons.lang3.tuple.Pair<java.util.function.Supplier<java.lang.String>,java.util.function.BiPredicate<java.lang.String,java.lang.Boolean>>>
DISPLAYTEST
Compatibility display test for the mod.static ExtensionPoint<java.util.function.BiFunction<Minecraft,ModFileResourcePack,IResourcePack>>
RESOURCEPACK
private java.lang.Class<T>
type
-
Constructor Summary
Constructors Modifier Constructor Description private
ExtensionPoint()
-
-
-
Field Detail
-
CONFIGGUIFACTORY
public static final ExtensionPoint<java.util.function.BiFunction<Minecraft,Screen,Screen>> CONFIGGUIFACTORY
-
RESOURCEPACK
public static final ExtensionPoint<java.util.function.BiFunction<Minecraft,ModFileResourcePack,IResourcePack>> RESOURCEPACK
-
DISPLAYTEST
public static final ExtensionPoint<org.apache.commons.lang3.tuple.Pair<java.util.function.Supplier<java.lang.String>,java.util.function.BiPredicate<java.lang.String,java.lang.Boolean>>> DISPLAYTEST
Compatibility display test for the mod. Used for displaying compatibility with remote servers with the same mod, and on disk saves. 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
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 )
-
type
private java.lang.Class<T> type
-
-