Class TransferPreconditions

java.lang.Object
net.neoforged.neoforge.transfer.TransferPreconditions

public class TransferPreconditions extends Object
Precondition checks useful for implementing ResourceHandler.
  • Constructor Details

    • TransferPreconditions

      private TransferPreconditions()
  • Method Details

    • checkNonEmpty

      public static void checkNonEmpty(Resource resource)
      Ensures the resource is non-empty, throws otherwise.
      Throws:
      IllegalArgumentException - when resource is empty.
    • checkNonNegative

      public static void checkNonNegative(int value)
      Ensures the value is non-negative, throws otherwise.
      Throws:
      IllegalArgumentException - when value is negative.
    • checkNonEmptyNonNegative

      public static void checkNonEmptyNonNegative(Resource resource, int value)
      Ensures the resource is non-empty and the value is non-negative, throws otherwise.
      Throws:
      IllegalArgumentException - when resource is empty or value is negative.