Class FusionPredicateRegistry
java.lang.Object
com.supermartijn642.fusion.api.predicate.FusionPredicateRegistry
Created 27/04/2023 by SuperMartijn642
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionPredicatedeserializeConnectionPredicate(com.google.gson.JsonObject json) Loads a connection predicate from json.static voidregisterConnectionPredicate(net.minecraft.resources.ResourceLocation identifier, Serializer<? extends ConnectionPredicate> serializer) Registers a new connection predicate type.static com.google.gson.JsonObjectserializeConnectionPredicate(ConnectionPredicate predicate) Serializes the given predicate.
-
Constructor Details
-
FusionPredicateRegistry
public FusionPredicateRegistry()
-
-
Method Details
-
registerConnectionPredicate
public static void registerConnectionPredicate(net.minecraft.resources.ResourceLocation identifier, Serializer<? extends ConnectionPredicate> serializer) Registers a new connection predicate type.- Parameters:
identifier- identifier for the predicate typeserializer- serializer used to save the predicates to and load the predicates from json- See Also:
-
serializeConnectionPredicate
public static com.google.gson.JsonObject serializeConnectionPredicate(ConnectionPredicate predicate) Serializes the given predicate. -
deserializeConnectionPredicate
public static ConnectionPredicate deserializeConnectionPredicate(com.google.gson.JsonObject json) throws com.google.gson.JsonParseException Loads a connection predicate from json.- Throws:
com.google.gson.JsonParseException- if the given json does not match the expected format
-