Class FusionPredicateRegistry

java.lang.Object
com.supermartijn642.fusion.api.predicate.FusionPredicateRegistry

public final class FusionPredicateRegistry extends Object
Created 27/04/2023 by SuperMartijn642
  • 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 type
      serializer - 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