Class Util

java.lang.Object
net.minecraft.util.Util

public class Util extends Object
A class holding various utility methods.
Mappings:
Namespace Name
named net/minecraft/util/Util
intermediary net/minecraft/class_156
official ae
  • Field Details Link icon

    • LOGGER Link icon

      static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      named LOGGER Lnet/minecraft/util/Util;LOGGER:Lorg/slf4j/Logger;
      intermediary field_1129 Lnet/minecraft/class_156;field_1129:Lorg/slf4j/Logger;
      official g Lae;g:Lorg/slf4j/Logger;
    • MAX_PARALLELISM Link icon

      private static final int MAX_PARALLELISM
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_PARALLELISM Lnet/minecraft/util/Util;MAX_PARALLELISM:I
      intermediary field_34891 Lnet/minecraft/class_156;field_34891:I
      official h Lae;h:I
    • BACKUP_ATTEMPTS Link icon

      private static final int BACKUP_ATTEMPTS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named BACKUP_ATTEMPTS Lnet/minecraft/util/Util;BACKUP_ATTEMPTS:I
      intermediary field_46764 Lnet/minecraft/class_156;field_46764:I
      official i Lae;i:I
    • MAX_BG_THREADS_PROPERTY Link icon

      private static final String MAX_BG_THREADS_PROPERTY
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named MAX_BG_THREADS_PROPERTY Lnet/minecraft/util/Util;MAX_BG_THREADS_PROPERTY:Ljava/lang/String;
      intermediary field_34892 Lnet/minecraft/class_156;field_34892:Ljava/lang/String;
      official j Lae;j:Ljava/lang/String;
    • MAIN_WORKER_EXECUTOR Link icon

      private static final NameableExecutor MAIN_WORKER_EXECUTOR
      Mappings:
      Namespace Name Mixin selector
      named MAIN_WORKER_EXECUTOR Lnet/minecraft/util/Util;MAIN_WORKER_EXECUTOR:Lnet/minecraft/util/thread/NameableExecutor;
      intermediary field_18035 Lnet/minecraft/class_156;field_18035:Lnet/minecraft/class_10207;
      official k Lae;k:Lad;
    • IO_WORKER_EXECUTOR Link icon

      private static final NameableExecutor IO_WORKER_EXECUTOR
      Mappings:
      Namespace Name Mixin selector
      named IO_WORKER_EXECUTOR Lnet/minecraft/util/Util;IO_WORKER_EXECUTOR:Lnet/minecraft/util/thread/NameableExecutor;
      intermediary field_24477 Lnet/minecraft/class_156;field_24477:Lnet/minecraft/class_10207;
      official l Lae;l:Lad;
    • DOWNLOAD_WORKER_EXECUTOR Link icon

      private static final NameableExecutor DOWNLOAD_WORKER_EXECUTOR
      Mappings:
      Namespace Name Mixin selector
      named DOWNLOAD_WORKER_EXECUTOR Lnet/minecraft/util/Util;DOWNLOAD_WORKER_EXECUTOR:Lnet/minecraft/util/thread/NameableExecutor;
      intermediary field_47571 Lnet/minecraft/class_156;field_47571:Lnet/minecraft/class_10207;
      official m Lae;m:Lad;
    • DATE_TIME_FORMATTER Link icon

      private static final DateTimeFormatter DATE_TIME_FORMATTER
      A locale-independent datetime formatter that uses yyyy-MM-dd_HH.mm.ss as the format string. Example: 2022-01-01_00.00.00
      Mappings:
      Namespace Name Mixin selector
      named DATE_TIME_FORMATTER Lnet/minecraft/util/Util;DATE_TIME_FORMATTER:Ljava/time/format/DateTimeFormatter;
      intermediary field_39824 Lnet/minecraft/class_156;field_39824:Ljava/time/format/DateTimeFormatter;
      official n Lae;n:Ljava/time/format/DateTimeFormatter;
    • field_46220 Link icon

      public static final int field_46220
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_46220 Lnet/minecraft/util/Util;field_46220:I
      intermediary field_46220 Lnet/minecraft/class_156;field_46220:I
      official a Lae;a:I
    • SUPPORTED_URI_PROTOCOLS Link icon

      private static final Set<String> SUPPORTED_URI_PROTOCOLS
      Mappings:
      Namespace Name Mixin selector
      named SUPPORTED_URI_PROTOCOLS Lnet/minecraft/util/Util;SUPPORTED_URI_PROTOCOLS:Ljava/util/Set;
      intermediary field_52196 Lnet/minecraft/class_156;field_52196:Ljava/util/Set;
      official o Lae;o:Ljava/util/Set;
    • field_45714 Link icon

      public static final long field_45714
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named field_45714 Lnet/minecraft/util/Util;field_45714:J
      intermediary field_45714 Lnet/minecraft/class_156;field_45714:J
      official b Lae;b:J
    • nanoTimeSupplier Link icon

      public static TimeSupplier.Nanoseconds nanoTimeSupplier
      Mappings:
      Namespace Name Mixin selector
      named nanoTimeSupplier Lnet/minecraft/util/Util;nanoTimeSupplier:Lnet/minecraft/util/TimeSupplier$Nanoseconds;
      intermediary field_1128 Lnet/minecraft/class_156;field_1128:Lnet/minecraft/class_7576$class_7577;
      official c Lae;c:Lbbf$a;
    • TICKER Link icon

      public static final Ticker TICKER
      Mappings:
      Namespace Name Mixin selector
      named TICKER Lnet/minecraft/util/Util;TICKER:Lcom/google/common/base/Ticker;
      intermediary field_37250 Lnet/minecraft/class_156;field_37250:Lcom/google/common/base/Ticker;
      official d Lae;d:Lcom/google/common/base/Ticker;
    • NIL_UUID Link icon

      public static final UUID NIL_UUID
      The "nil UUID" that represents lack of a UUID.
      Mappings:
      Namespace Name Mixin selector
      named NIL_UUID Lnet/minecraft/util/Util;NIL_UUID:Ljava/util/UUID;
      intermediary field_25140 Lnet/minecraft/class_156;field_25140:Ljava/util/UUID;
      official e Lae;e:Ljava/util/UUID;
    • JAR_FILE_SYSTEM_PROVIDER Link icon

      public static final FileSystemProvider JAR_FILE_SYSTEM_PROVIDER
      The file system provider for handling jar and zip files.
      Mappings:
      Namespace Name Mixin selector
      named JAR_FILE_SYSTEM_PROVIDER Lnet/minecraft/util/Util;JAR_FILE_SYSTEM_PROVIDER:Ljava/nio/file/spi/FileSystemProvider;
      intermediary field_33859 Lnet/minecraft/class_156;field_33859:Ljava/nio/file/spi/FileSystemProvider;
      official f Lae;f:Ljava/nio/file/spi/FileSystemProvider;
    • missingBreakpointHandler Link icon

      private static Consumer<String> missingBreakpointHandler
      Mappings:
      Namespace Name Mixin selector
      named missingBreakpointHandler Lnet/minecraft/util/Util;missingBreakpointHandler:Ljava/util/function/Consumer;
      intermediary field_34893 Lnet/minecraft/class_156;field_34893:Ljava/util/function/Consumer;
      official p Lae;p:Ljava/util/function/Consumer;
  • Constructor Details Link icon

    • Util Link icon

      public Util()
  • Method Details Link icon

    • toMap Link icon

      public static <K, V> Collector<Map.Entry<? extends K,? extends V>,?,Map<K,V>> toMap()
      Mappings:
      Namespace Name Mixin selector
      named toMap Lnet/minecraft/util/Util;toMap()Ljava/util/stream/Collector;
      intermediary method_664 Lnet/minecraft/class_156;method_664()Ljava/util/stream/Collector;
      official a Lae;a()Ljava/util/stream/Collector;
    • toArrayList Link icon

      public static <T> Collector<T,?,List<T>> toArrayList()
      Mappings:
      Namespace Name Mixin selector
      named toArrayList Lnet/minecraft/util/Util;toArrayList()Ljava/util/stream/Collector;
      intermediary method_58579 Lnet/minecraft/class_156;method_58579()Ljava/util/stream/Collector;
      official b Lae;b()Ljava/util/stream/Collector;
    • getValueAsString Link icon

      public static <T extends Comparable<T>> String getValueAsString(Property<T> property, Object value)
      Mappings:
      Namespace Name Mixin selector
      named getValueAsString Lnet/minecraft/util/Util;getValueAsString(Lnet/minecraft/state/property/Property;Ljava/lang/Object;)Ljava/lang/String;
      intermediary method_650 Lnet/minecraft/class_156;method_650(Lnet/minecraft/class_2769;Ljava/lang/Object;)Ljava/lang/String;
      official a Lae;a(Ldyw;Ljava/lang/Object;)Ljava/lang/String;
    • createTranslationKey Link icon

      public static String createTranslationKey(String type, @Nullable @Nullable Identifier id)
      Returns the translation key constructed from type and id.

      If id is null, unregistered_sadface is used as the ID.

      Returns:
      the translation key constructed from type and id
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named createTranslationKey Lnet/minecraft/util/Util;createTranslationKey(Ljava/lang/String;Lnet/minecraft/util/Identifier;)Ljava/lang/String;
      intermediary method_646 Lnet/minecraft/class_156;method_646(Ljava/lang/String;Lnet/minecraft/class_2960;)Ljava/lang/String;
      official a Lae;a(Ljava/lang/String;Lalz;)Ljava/lang/String;
    • getMeasuringTimeMs Link icon

      public static long getMeasuringTimeMs()
      Returns the current time in milliseconds, to be used for measuring a duration.

      This is not the Unix epoch time, and can only be used to determine the duration between two calls of this method.

      Returns:
      the current time in milliseconds, to be used for measuring a duration
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getMeasuringTimeMs Lnet/minecraft/util/Util;getMeasuringTimeMs()J
      intermediary method_658 Lnet/minecraft/class_156;method_658()J
      official c Lae;c()J
    • getMeasuringTimeNano Link icon

      public static long getMeasuringTimeNano()
      Returns the current time in nanoseconds, to be used for measuring a duration.

      This is not the Unix epoch time, and can only be used to determine the duration between two calls of this method.

      Returns:
      the current time in nanoseconds, to be used for measuring a duration
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getMeasuringTimeNano Lnet/minecraft/util/Util;getMeasuringTimeNano()J
      intermediary method_648 Lnet/minecraft/class_156;method_648()J
      official d Lae;d()J
    • getEpochTimeMs Link icon

      public static long getEpochTimeMs()
      Returns the milliseconds passed since the Unix epoch.

      This should be used to display or store the current time. getMeasuringTimeMs() should be used for determining the duration between two calls.

      Returns:
      the milliseconds passed since the Unix epoch
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getEpochTimeMs Lnet/minecraft/util/Util;getEpochTimeMs()J
      intermediary method_659 Lnet/minecraft/class_156;method_659()J
      official e Lae;e()J
    • getFormattedCurrentTime Link icon

      public static String getFormattedCurrentTime()
      Returns the current time formatted using DATE_TIME_FORMATTER.
      Returns:
      the current time formatted using DATE_TIME_FORMATTER
      Mappings:
      Namespace Name Mixin selector
      named getFormattedCurrentTime Lnet/minecraft/util/Util;getFormattedCurrentTime()Ljava/lang/String;
      intermediary method_44893 Lnet/minecraft/class_156;method_44893()Ljava/lang/String;
      official f Lae;f()Ljava/lang/String;
    • createWorker Link icon

      private static NameableExecutor createWorker(String name)
      Mappings:
      Namespace Name Mixin selector
      named createWorker Lnet/minecraft/util/Util;createWorker(Ljava/lang/String;)Lnet/minecraft/util/thread/NameableExecutor;
      intermediary method_28122 Lnet/minecraft/class_156;method_28122(Ljava/lang/String;)Lnet/minecraft/class_10207;
      official c Lae;c(Ljava/lang/String;)Lad;
    • getMaxBackgroundThreads Link icon

      private static int getMaxBackgroundThreads()
      Mappings:
      Namespace Name Mixin selector
      named getMaxBackgroundThreads Lnet/minecraft/util/Util;getMaxBackgroundThreads()I
      intermediary method_38648 Lnet/minecraft/class_156;method_38648()I
      official p Lae;p()I
    • getMainWorkerExecutor Link icon

      public static NameableExecutor getMainWorkerExecutor()
      Returns the main worker executor for miscellaneous asynchronous tasks.
      Returns:
      the main worker executor for miscellaneous asynchronous tasks
      Mappings:
      Namespace Name Mixin selector
      named getMainWorkerExecutor Lnet/minecraft/util/Util;getMainWorkerExecutor()Lnet/minecraft/util/thread/NameableExecutor;
      intermediary method_18349 Lnet/minecraft/class_156;method_18349()Lnet/minecraft/class_10207;
      official g Lae;g()Lad;
    • getIoWorkerExecutor Link icon

      public static NameableExecutor getIoWorkerExecutor()
      Returns the executor for disk or network IO tasks.
      Returns:
      the executor for disk or network IO tasks
      Mappings:
      Namespace Name Mixin selector
      named getIoWorkerExecutor Lnet/minecraft/util/Util;getIoWorkerExecutor()Lnet/minecraft/util/thread/NameableExecutor;
      intermediary method_27958 Lnet/minecraft/class_156;method_27958()Lnet/minecraft/class_10207;
      official h Lae;h()Lad;
    • getDownloadWorkerExecutor Link icon

      public static NameableExecutor getDownloadWorkerExecutor()
      Returns the executor for download tasks.
      Returns:
      the executor for download tasks
      Mappings:
      Namespace Name Mixin selector
      named getDownloadWorkerExecutor Lnet/minecraft/util/Util;getDownloadWorkerExecutor()Lnet/minecraft/util/thread/NameableExecutor;
      intermediary method_55473 Lnet/minecraft/class_156;method_55473()Lnet/minecraft/class_10207;
      official i Lae;i()Lad;
    • shutdownExecutors Link icon

      public static void shutdownExecutors()
      Mappings:
      Namespace Name Mixin selector
      named shutdownExecutors Lnet/minecraft/util/Util;shutdownExecutors()V
      intermediary method_18350 Lnet/minecraft/class_156;method_18350()V
      official j Lae;j()V
    • createIoWorker Link icon

      private static NameableExecutor createIoWorker(String namePrefix, boolean daemon)
      Mappings:
      Namespace Name Mixin selector
      named createIoWorker Lnet/minecraft/util/Util;createIoWorker(Ljava/lang/String;Z)Lnet/minecraft/util/thread/NameableExecutor;
      intermediary method_27959 Lnet/minecraft/class_156;method_27959(Ljava/lang/String;Z)Lnet/minecraft/class_10207;
      official a Lae;a(Ljava/lang/String;Z)Lad;
    • throwUnchecked Link icon

      public static void throwUnchecked(Throwable t)
      Throws t if it's a RuntimeException (or any of its subclass), otherwise t wrapped in a RuntimeException.

      Error is wrapped as well, despite being unchecked.

      Mappings:
      Namespace Name Mixin selector
      named throwUnchecked Lnet/minecraft/util/Util;throwUnchecked(Ljava/lang/Throwable;)V
      intermediary method_24155 Lnet/minecraft/class_156;method_24155(Ljava/lang/Throwable;)V
      official a Lae;a(Ljava/lang/Throwable;)V
    • uncaughtExceptionHandler Link icon

      private static void uncaughtExceptionHandler(Thread thread, Throwable t)
      Mappings:
      Namespace Name Mixin selector
      named uncaughtExceptionHandler Lnet/minecraft/util/Util;uncaughtExceptionHandler(Ljava/lang/Thread;Ljava/lang/Throwable;)V
      intermediary method_18347 Lnet/minecraft/class_156;method_18347(Ljava/lang/Thread;Ljava/lang/Throwable;)V
      official a Lae;a(Ljava/lang/Thread;Ljava/lang/Throwable;)V
    • getChoiceType Link icon

      @Nullable public static @Nullable com.mojang.datafixers.types.Type<?> getChoiceType(com.mojang.datafixers.DSL.TypeReference typeReference, String id)
      Mappings:
      Namespace Name Mixin selector
      named getChoiceType Lnet/minecraft/util/Util;getChoiceType(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
      intermediary method_29187 Lnet/minecraft/class_156;method_29187(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
      official a Lae;a(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
    • getChoiceTypeInternal Link icon

      @Nullable private static @Nullable com.mojang.datafixers.types.Type<?> getChoiceTypeInternal(com.mojang.datafixers.DSL.TypeReference typeReference, String id)
      Mappings:
      Namespace Name Mixin selector
      named getChoiceTypeInternal Lnet/minecraft/util/Util;getChoiceTypeInternal(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
      intermediary method_29191 Lnet/minecraft/class_156;method_29191(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
      official b Lae;b(Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
    • runInNamedZone Link icon

      public static void runInNamedZone(Runnable runnable, String name)
      Mappings:
      Namespace Name Mixin selector
      named runInNamedZone Lnet/minecraft/util/Util;runInNamedZone(Ljava/lang/Runnable;Ljava/lang/String;)V
      intermediary method_64122 Lnet/minecraft/class_156;method_64122(Ljava/lang/Runnable;Ljava/lang/String;)V
      official a Lae;a(Ljava/lang/Runnable;Ljava/lang/String;)V
    • registryValueToString Link icon

      public static <T> String registryValueToString(Registry<T> registry, T value)
      Mappings:
      Namespace Name Mixin selector
      named registryValueToString Lnet/minecraft/util/Util;registryValueToString(Lnet/minecraft/registry/Registry;Ljava/lang/Object;)Ljava/lang/String;
      intermediary method_57107 Lnet/minecraft/class_156;method_57107(Lnet/minecraft/class_2378;Ljava/lang/Object;)Ljava/lang/String;
      official a Lae;a(Lkd;Ljava/lang/Object;)Ljava/lang/String;
    • and Link icon

      public static <T> Predicate<T> and()
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and()Ljava/util/function/Predicate;
      intermediary method_61210 Lnet/minecraft/class_156;method_61210()Ljava/util/function/Predicate;
      official k Lae;k()Ljava/util/function/Predicate;
    • and Link icon

      public static <T> Predicate<T> and(Predicate<? super T> a)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61189 Lnet/minecraft/class_156;method_61189(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • and Link icon

      public static <T> Predicate<T> and(Predicate<? super T> a, Predicate<? super T> b)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61190 Lnet/minecraft/class_156;method_61190(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • and Link icon

      public static <T> Predicate<T> and(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61192 Lnet/minecraft/class_156;method_61192(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • and Link icon

      public static <T> Predicate<T> and(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c, Predicate<? super T> d)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61194 Lnet/minecraft/class_156;method_61194(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • and Link icon

      public static <T> Predicate<T> and(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c, Predicate<? super T> d, Predicate<? super T> e)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61196 Lnet/minecraft/class_156;method_61196(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • and Link icon

      @SafeVarargs public static <T> Predicate<T> and(Predicate<? super T>[] predicates)
      Mappings:
      Namespace Name Mixin selector
      named and Lnet/minecraft/util/Util;and([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61198 Lnet/minecraft/class_156;method_61198([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official a Lae;a([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • allOf Link icon

      public static <T> Predicate<T> allOf(List<? extends Predicate<? super T>> predicates)
      Mappings:
      Namespace Name Mixin selector
      named allOf Lnet/minecraft/util/Util;allOf(Ljava/util/List;)Ljava/util/function/Predicate;
      intermediary method_56613 Lnet/minecraft/class_156;method_56613(Ljava/util/List;)Ljava/util/function/Predicate;
      official a Lae;a(Ljava/util/List;)Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or()
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or()Ljava/util/function/Predicate;
      intermediary method_61211 Lnet/minecraft/class_156;method_61211()Ljava/util/function/Predicate;
      official l Lae;l()Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or(Predicate<? super T> a)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61199 Lnet/minecraft/class_156;method_61199(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or(Predicate<? super T> a, Predicate<? super T> b)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61200 Lnet/minecraft/class_156;method_61200(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61202 Lnet/minecraft/class_156;method_61202(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c, Predicate<? super T> d)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61204 Lnet/minecraft/class_156;method_61204(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • or Link icon

      public static <T> Predicate<T> or(Predicate<? super T> a, Predicate<? super T> b, Predicate<? super T> c, Predicate<? super T> d, Predicate<? super T> e)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61206 Lnet/minecraft/class_156;method_61206(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • or Link icon

      @SafeVarargs public static <T> Predicate<T> or(Predicate<? super T>[] predicates)
      Mappings:
      Namespace Name Mixin selector
      named or Lnet/minecraft/util/Util;or([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      intermediary method_61208 Lnet/minecraft/class_156;method_61208([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
      official b Lae;b([Ljava/util/function/Predicate;)Ljava/util/function/Predicate;
    • anyOf Link icon

      public static <T> Predicate<T> anyOf(List<? extends Predicate<? super T>> predicates)
      Mappings:
      Namespace Name Mixin selector
      named anyOf Lnet/minecraft/util/Util;anyOf(Ljava/util/List;)Ljava/util/function/Predicate;
      intermediary method_56616 Lnet/minecraft/class_156;method_56616(Ljava/util/List;)Ljava/util/function/Predicate;
      official b Lae;b(Ljava/util/List;)Ljava/util/function/Predicate;
    • isSymmetrical Link icon

      public static <T> boolean isSymmetrical(int width, int height, List<T> list)
      Mappings:
      Namespace Name Mixin selector
      named isSymmetrical Lnet/minecraft/util/Util;isSymmetrical(IILjava/util/List;)Z
      intermediary method_59901 Lnet/minecraft/class_156;method_59901(IILjava/util/List;)Z
      official a Lae;a(IILjava/util/List;)Z
    • getOperatingSystem Link icon

      public static Util.OperatingSystem getOperatingSystem()
      Returns the operating system instance for the current platform.
      Returns:
      the operating system instance for the current platform
      API Note:
      This is used for opening links.
      Implementation Note:
      This uses the os.name system property to determine the operating system.
      Mappings:
      Namespace Name Mixin selector
      named getOperatingSystem Lnet/minecraft/util/Util;getOperatingSystem()Lnet/minecraft/util/Util$OperatingSystem;
      intermediary method_668 Lnet/minecraft/class_156;method_668()Lnet/minecraft/class_156$class_158;
      official m Lae;m()Lae$a;
    • validateUri Link icon

      public static URI validateUri(String uri) throws URISyntaxException
      Throws:
      URISyntaxException
      Mappings:
      Namespace Name Mixin selector
      named validateUri Lnet/minecraft/util/Util;validateUri(Ljava/lang/String;)Ljava/net/URI;
      intermediary method_60931 Lnet/minecraft/class_156;method_60931(Ljava/lang/String;)Ljava/net/URI;
      official a Lae;a(Ljava/lang/String;)Ljava/net/URI;
    • getJVMFlags Link icon

      public static Stream<String> getJVMFlags()
      Returns a stream of JVM flags passed when launching.

      The streamed strings include the -X prefix.

      Returns:
      a stream of JVM flags passed when launching
      Mappings:
      Namespace Name Mixin selector
      named getJVMFlags Lnet/minecraft/util/Util;getJVMFlags()Ljava/util/stream/Stream;
      intermediary method_651 Lnet/minecraft/class_156;method_651()Ljava/util/stream/Stream;
      official n Lae;n()Ljava/util/stream/Stream;
    • getLast Link icon

      public static <T> T getLast(List<T> list)
      Returns the last item of list.
      Returns:
      the last item of list
      Throws:
      IndexOutOfBoundsException - if list is empty
      Mappings:
      Namespace Name Mixin selector
      named getLast Lnet/minecraft/util/Util;getLast(Ljava/util/List;)Ljava/lang/Object;
      intermediary method_20793 Lnet/minecraft/class_156;method_20793(Ljava/util/List;)Ljava/lang/Object;
      official c Lae;c(Ljava/util/List;)Ljava/lang/Object;
    • next Link icon

      public static <T> T next(Iterable<T> iterable, @Nullable T object)
      Returns the item succeeding object in iterable.
      Returns:
      the item succeeding object in iterable
      Implementation Note:
      If object is null, this returns the first item of the iterable. If object is not in iterable, this enters into an infinite loop. object is compared using the == operator.
      Mappings:
      Namespace Name Mixin selector
      named next Lnet/minecraft/util/Util;next(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_660 Lnet/minecraft/class_156;method_660(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
      official a Lae;a(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
    • previous Link icon

      public static <T> T previous(Iterable<T> iterable, @Nullable T object)
      Returns the item preceding object in iterable.

      If object is not in iterable, this returns the last item of the iterable. object is compared using the == operator.

      Returns:
      the item preceding object in iterable
      Mappings:
      Namespace Name Mixin selector
      named previous Lnet/minecraft/util/Util;previous(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_645 Lnet/minecraft/class_156;method_645(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
      official b Lae;b(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
    • make Link icon

      public static <T> T make(Supplier<T> factory)
      Returns the value supplied from factory.

      This is useful when initializing static fields:

      
       private static final Map<String, String> MAP = Util.make(() -> {
           Map<String, String> map = new HashMap<>();
           map.put("example", "hello");
           return map;
       });
       
      Returns:
      the value supplied from factory
      Mappings:
      Namespace Name Mixin selector
      named make Lnet/minecraft/util/Util;make(Ljava/util/function/Supplier;)Ljava/lang/Object;
      intermediary method_656 Lnet/minecraft/class_156;method_656(Ljava/util/function/Supplier;)Ljava/lang/Object;
      official a Lae;a(Ljava/util/function/Supplier;)Ljava/lang/Object;
    • make Link icon

      public static <T> T make(T object, Consumer<? super T> initializer)
      Returns object initialized with initializer.

      This is useful when initializing static fields:

      
       private static final Map<String, String> MAP = Util.make(new HashMap<>(), (map) -> {
           map.put("example", "hello");
       });
       
      Returns:
      object initialized with initializer
      Mappings:
      Namespace Name Mixin selector
      named make Lnet/minecraft/util/Util;make(Ljava/lang/Object;Ljava/util/function/Consumer;)Ljava/lang/Object;
      intermediary method_654 Lnet/minecraft/class_156;method_654(Ljava/lang/Object;Ljava/util/function/Consumer;)Ljava/lang/Object;
      official a Lae;a(Ljava/lang/Object;Ljava/util/function/Consumer;)Ljava/lang/Object;
    • mapEnum Link icon

      public static <K extends Enum<K>, V> EnumMap<K,V> mapEnum(Class<K> enumClass, Function<K,V> mapper)
      Mappings:
      Namespace Name Mixin selector
      named mapEnum Lnet/minecraft/util/Util;mapEnum(Ljava/lang/Class;Ljava/util/function/Function;)Ljava/util/EnumMap;
      intermediary method_63541 Lnet/minecraft/class_156;method_63541(Ljava/lang/Class;Ljava/util/function/Function;)Ljava/util/EnumMap;
      official a Lae;a(Ljava/lang/Class;Ljava/util/function/Function;)Ljava/util/EnumMap;
    • combineSafe Link icon

      public static <V> CompletableFuture<List<V>> combineSafe(List<? extends CompletableFuture<V>> futures)
      Combines a list of futures into one future that holds a list of their results.

      This version expects all futures to complete successfully and is not optimized in case any of the input futures throws.

      Parameters:
      futures - the completable futures to combine
      Returns:
      the combined future
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named combineSafe Lnet/minecraft/util/Util;combineSafe(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_33791 Lnet/minecraft/class_156;method_33791(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      official d Lae;d(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
    • combine Link icon

      public static <V> CompletableFuture<List<V>> combine(List<? extends CompletableFuture<? extends V>> futures)
      Combines a list of futures into one future that holds a list of their results.

      The returned future is fail-fast; if any of the input futures fails, this returned future will be immediately completed exceptionally than waiting for other input futures.

      Parameters:
      futures - the completable futures to combine
      Returns:
      the combined future
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named combine Lnet/minecraft/util/Util;combine(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_652 Lnet/minecraft/class_156;method_652(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      official e Lae;e(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
    • combineCancellable Link icon

      public static <V> CompletableFuture<List<V>> combineCancellable(List<? extends CompletableFuture<? extends V>> futures)
      Combines a list of futures into one future that holds a list of their results.

      The returned future is fail-fast; if any of the input futures fails, this returned future will be immediately completed exceptionally than waiting for other input futures. Additionally, all other futures will be canceled.

      Returns:
      the combined future
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named combineCancellable Lnet/minecraft/util/Util;combineCancellable(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_43373 Lnet/minecraft/class_156;method_43373(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
      official f Lae;f(Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
    • combine Link icon

      private static <V> CompletableFuture<List<V>> combine(List<? extends CompletableFuture<? extends V>> futures, Consumer<Throwable> exceptionHandler)
      Mappings:
      Namespace Name Mixin selector
      named combine Lnet/minecraft/util/Util;combine(Ljava/util/List;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_43370 Lnet/minecraft/class_156;method_43370(Ljava/util/List;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;
      official a Lae;a(Ljava/util/List;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;
    • ifPresentOrElse Link icon

      public static <T> Optional<T> ifPresentOrElse(Optional<T> optional, Consumer<T> presentAction, Runnable elseAction)
      If optional has value, calls presentAction with the value, otherwise calls elseAction.
      Returns:
      the passed optional
      Mappings:
      Namespace Name Mixin selector
      named ifPresentOrElse Lnet/minecraft/util/Util;ifPresentOrElse(Ljava/util/Optional;Ljava/util/function/Consumer;Ljava/lang/Runnable;)Ljava/util/Optional;
      intermediary method_17974 Lnet/minecraft/class_156;method_17974(Ljava/util/Optional;Ljava/util/function/Consumer;Ljava/lang/Runnable;)Ljava/util/Optional;
      official a Lae;a(Ljava/util/Optional;Ljava/util/function/Consumer;Ljava/lang/Runnable;)Ljava/util/Optional;
    • debugSupplier Link icon

      public static <T> Supplier<T> debugSupplier(Supplier<T> supplier, Supplier<String> messageSupplier)
      Mappings:
      Namespace Name Mixin selector
      named debugSupplier Lnet/minecraft/util/Util;debugSupplier(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;
      intermediary method_41238 Lnet/minecraft/class_156;method_41238(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;
      official a Lae;a(Ljava/util/function/Supplier;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;
    • debugRunnable Link icon

      public static Runnable debugRunnable(Runnable runnable, Supplier<String> messageSupplier)
      Mappings:
      Namespace Name Mixin selector
      named debugRunnable Lnet/minecraft/util/Util;debugRunnable(Ljava/lang/Runnable;Ljava/util/function/Supplier;)Ljava/lang/Runnable;
      intermediary method_18839 Lnet/minecraft/class_156;method_18839(Ljava/lang/Runnable;Ljava/util/function/Supplier;)Ljava/lang/Runnable;
      official a Lae;a(Ljava/lang/Runnable;Ljava/util/function/Supplier;)Ljava/lang/Runnable;
    • logErrorOrPause Link icon

      public static void logErrorOrPause(String message)
      Logs an error-level message and pauses the game if SharedConstants.isDevelopment is true.
      Parameters:
      message - the log message
      Mappings:
      Namespace Name Mixin selector
      named logErrorOrPause Lnet/minecraft/util/Util;logErrorOrPause(Ljava/lang/String;)V
      intermediary method_33559 Lnet/minecraft/class_156;method_33559(Ljava/lang/String;)V
      official b Lae;b(Ljava/lang/String;)V
    • logErrorOrPause Link icon

      public static void logErrorOrPause(String message, Throwable throwable)
      Logs an error-level message and pauses the game if SharedConstants.isDevelopment is true.
      Parameters:
      message - the log message
      throwable - a throwable related to the log message
      Mappings:
      Namespace Name Mixin selector
      named logErrorOrPause Lnet/minecraft/util/Util;logErrorOrPause(Ljava/lang/String;Ljava/lang/Throwable;)V
      intermediary method_39977 Lnet/minecraft/class_156;method_39977(Ljava/lang/String;Ljava/lang/Throwable;)V
      official a Lae;a(Ljava/lang/String;Ljava/lang/Throwable;)V
    • getFatalOrPause Link icon

      public static <T extends Throwable> T getFatalOrPause(T t)
      Returns the provided fatal throwable, or pauses the game if SharedConstants.isDevelopment is true.

      This method is usually chained with a throw statement:

      throw Util.getFatalOrPause(theFatalException);
      
      Parameters:
      t - the throwable
      Returns:
      the provided throwable
      Mappings:
      Namespace Name Mixin selector
      named getFatalOrPause Lnet/minecraft/util/Util;getFatalOrPause(Ljava/lang/Throwable;)Ljava/lang/Throwable;
      intermediary method_22320 Lnet/minecraft/class_156;method_22320(Ljava/lang/Throwable;)Ljava/lang/Throwable;
      official b Lae;b(Ljava/lang/Throwable;)Ljava/lang/Throwable;
    • setMissingBreakpointHandler Link icon

      public static void setMissingBreakpointHandler(Consumer<String> missingBreakpointHandler)
      Mappings:
      Namespace Name Mixin selector
      named setMissingBreakpointHandler Lnet/minecraft/util/Util;setMissingBreakpointHandler(Ljava/util/function/Consumer;)V
      intermediary method_38646 Lnet/minecraft/class_156;method_38646(Ljava/util/function/Consumer;)V
      official a Lae;a(Ljava/util/function/Consumer;)V
    • pause Link icon

      private static void pause(String message)
      Mappings:
      Namespace Name Mixin selector
      named pause Lnet/minecraft/util/Util;pause(Ljava/lang/String;)V
      intermediary method_33560 Lnet/minecraft/class_156;method_33560(Ljava/lang/String;)V
      official d Lae;d(Ljava/lang/String;)V
    • getInnermostMessage Link icon

      public static String getInnermostMessage(Throwable t)
      Mappings:
      Namespace Name Mixin selector
      named getInnermostMessage Lnet/minecraft/util/Util;getInnermostMessage(Ljava/lang/Throwable;)Ljava/lang/String;
      intermediary method_22321 Lnet/minecraft/class_156;method_22321(Ljava/lang/Throwable;)Ljava/lang/String;
      official c Lae;c(Ljava/lang/Throwable;)Ljava/lang/String;
    • getRandom Link icon

      public static <T> T getRandom(T[] array, Random random)
      Returns a random item from array.
      Returns:
      a random item from array
      Throws:
      IllegalArgumentException - if array is empty
      Mappings:
      Namespace Name Mixin selector
      named getRandom Lnet/minecraft/util/Util;getRandom([Ljava/lang/Object;Lnet/minecraft/util/math/random/Random;)Ljava/lang/Object;
      intermediary method_27173 Lnet/minecraft/class_156;method_27173([Ljava/lang/Object;Lnet/minecraft/class_5819;)Ljava/lang/Object;
      official a Lae;a([Ljava/lang/Object;Lbam;)Ljava/lang/Object;
    • getRandom Link icon

      public static int getRandom(int[] array, Random random)
      Returns a random integer from array.
      Returns:
      a random integer from array
      Throws:
      IllegalArgumentException - if array is empty
      Mappings:
      Namespace Name Mixin selector
      named getRandom Lnet/minecraft/util/Util;getRandom([ILnet/minecraft/util/math/random/Random;)I
      intermediary method_27172 Lnet/minecraft/class_156;method_27172([ILnet/minecraft/class_5819;)I
      official a Lae;a([ILbam;)I
    • getRandom Link icon

      public static <T> T getRandom(List<T> list, Random random)
      Returns a random item from list.
      Returns:
      a random item from list
      Throws:
      IllegalArgumentException - if list is empty
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getRandom Lnet/minecraft/util/Util;getRandom(Ljava/util/List;Lnet/minecraft/util/math/random/Random;)Ljava/lang/Object;
      intermediary method_32309 Lnet/minecraft/class_156;method_32309(Ljava/util/List;Lnet/minecraft/class_5819;)Ljava/lang/Object;
      official a Lae;a(Ljava/util/List;Lbam;)Ljava/lang/Object;
    • getRandomOrEmpty Link icon

      public static <T> Optional<T> getRandomOrEmpty(List<T> list, Random random)
      Returns an Optional of a random item from list, or an empty optional if the list is empty.
      Returns:
      an Optional of a random item from list, or an empty optional if the list is empty
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getRandomOrEmpty Lnet/minecraft/util/Util;getRandomOrEmpty(Ljava/util/List;Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;
      intermediary method_40083 Lnet/minecraft/class_156;method_40083(Ljava/util/List;Lnet/minecraft/class_5819;)Ljava/util/Optional;
      official b Lae;b(Ljava/util/List;Lbam;)Ljava/util/Optional;
    • renameTask Link icon

      private static BooleanSupplier renameTask(Path src, Path dest)
      Mappings:
      Namespace Name Mixin selector
      named renameTask Lnet/minecraft/util/Util;renameTask(Ljava/nio/file/Path;Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      intermediary method_30625 Lnet/minecraft/class_156;method_30625(Ljava/nio/file/Path;Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      official a Lae;a(Ljava/nio/file/Path;Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
    • deleteTask Link icon

      private static BooleanSupplier deleteTask(Path path)
      Mappings:
      Namespace Name Mixin selector
      named deleteTask Lnet/minecraft/util/Util;deleteTask(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      intermediary method_30624 Lnet/minecraft/class_156;method_30624(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      official a Lae;a(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
    • deletionVerifyTask Link icon

      private static BooleanSupplier deletionVerifyTask(Path path)
      Mappings:
      Namespace Name Mixin selector
      named deletionVerifyTask Lnet/minecraft/util/Util;deletionVerifyTask(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      intermediary method_30628 Lnet/minecraft/class_156;method_30628(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      official b Lae;b(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
    • existenceCheckTask Link icon

      private static BooleanSupplier existenceCheckTask(Path path)
      Mappings:
      Namespace Name Mixin selector
      named existenceCheckTask Lnet/minecraft/util/Util;existenceCheckTask(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      intermediary method_30629 Lnet/minecraft/class_156;method_30629(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
      official c Lae;c(Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
    • attemptTasks Link icon

      private static boolean attemptTasks(BooleanSupplier[] tasks)
      Mappings:
      Namespace Name Mixin selector
      named attemptTasks Lnet/minecraft/util/Util;attemptTasks([Ljava/util/function/BooleanSupplier;)Z
      intermediary method_30627 Lnet/minecraft/class_156;method_30627([Ljava/util/function/BooleanSupplier;)Z
      official a Lae;a([Ljava/util/function/BooleanSupplier;)Z
    • attemptTasks Link icon

      private static boolean attemptTasks(int retries, String taskName, BooleanSupplier[] tasks)
      Mappings:
      Namespace Name Mixin selector
      named attemptTasks Lnet/minecraft/util/Util;attemptTasks(ILjava/lang/String;[Ljava/util/function/BooleanSupplier;)Z
      intermediary method_30622 Lnet/minecraft/class_156;method_30622(ILjava/lang/String;[Ljava/util/function/BooleanSupplier;)Z
      official a Lae;a(ILjava/lang/String;[Ljava/util/function/BooleanSupplier;)Z
    • backupAndReplace Link icon

      public static void backupAndReplace(Path current, Path newPath, Path backup)
      Copies current to backup and then replaces current with newPath.
      Mappings:
      Namespace Name Mixin selector
      named backupAndReplace Lnet/minecraft/util/Util;backupAndReplace(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
      intermediary method_30626 Lnet/minecraft/class_156;method_30626(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
      official a Lae;a(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
    • backupAndReplace Link icon

      public static boolean backupAndReplace(Path current, Path newPath, Path backup, boolean noRestoreOnFail)
      Copies current to backup and then replaces current with newPath.
      Parameters:
      noRestoreOnFail - if true, does not restore the current file when replacing fails
      Mappings:
      Namespace Name Mixin selector
      named backupAndReplace Lnet/minecraft/util/Util;backupAndReplace(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;Z)Z
      intermediary method_41204 Lnet/minecraft/class_156;method_41204(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;Z)Z
      official a Lae;a(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;Z)Z
    • moveCursor Link icon

      public static int moveCursor(String string, int cursor, int delta)
      Moves the cursor in the string by a delta amount. Skips surrogate characters.
      Mappings:
      Namespace Name Mixin selector
      named moveCursor Lnet/minecraft/util/Util;moveCursor(Ljava/lang/String;II)I
      intermediary method_27761 Lnet/minecraft/class_156;method_27761(Ljava/lang/String;II)I
      official a Lae;a(Ljava/lang/String;II)I
    • addPrefix Link icon

      public static Consumer<String> addPrefix(String prefix, Consumer<String> consumer)
      Returns a consumer that first prepends prefix to its input string and passes the result to consumer.
      Returns:
      a consumer that first prepends prefix to its input string and passes the result to consumer
      API Note:
      This is useful in codec-based deserialization when passing the error consumer to some methods, e.g. Util.addPrefix("Could not parse Example", LOGGER::error).
      Mappings:
      Namespace Name Mixin selector
      named addPrefix Lnet/minecraft/util/Util;addPrefix(Ljava/lang/String;Ljava/util/function/Consumer;)Ljava/util/function/Consumer;
      intermediary method_29188 Lnet/minecraft/class_156;method_29188(Ljava/lang/String;Ljava/util/function/Consumer;)Ljava/util/function/Consumer;
      official a Lae;a(Ljava/lang/String;Ljava/util/function/Consumer;)Ljava/util/function/Consumer;
    • decodeFixedLengthArray Link icon

      public static com.mojang.serialization.DataResult<int[]> decodeFixedLengthArray(IntStream stream, int length)
      Mappings:
      Namespace Name Mixin selector
      named decodeFixedLengthArray Lnet/minecraft/util/Util;decodeFixedLengthArray(Ljava/util/stream/IntStream;I)Lcom/mojang/serialization/DataResult;
      intermediary method_29190 Lnet/minecraft/class_156;method_29190(Ljava/util/stream/IntStream;I)Lcom/mojang/serialization/DataResult;
      official a Lae;a(Ljava/util/stream/IntStream;I)Lcom/mojang/serialization/DataResult;
    • decodeFixedLengthArray Link icon

      public static com.mojang.serialization.DataResult<long[]> decodeFixedLengthArray(LongStream stream, int length)
      Mappings:
      Namespace Name Mixin selector
      named decodeFixedLengthArray Lnet/minecraft/util/Util;decodeFixedLengthArray(Ljava/util/stream/LongStream;I)Lcom/mojang/serialization/DataResult;
      intermediary method_51822 Lnet/minecraft/class_156;method_51822(Ljava/util/stream/LongStream;I)Lcom/mojang/serialization/DataResult;
      official a Lae;a(Ljava/util/stream/LongStream;I)Lcom/mojang/serialization/DataResult;
    • decodeFixedLengthList Link icon

      public static <T> com.mojang.serialization.DataResult<List<T>> decodeFixedLengthList(List<T> list, int length)
      Mappings:
      Namespace Name Mixin selector
      named decodeFixedLengthList Lnet/minecraft/util/Util;decodeFixedLengthList(Ljava/util/List;I)Lcom/mojang/serialization/DataResult;
      intermediary method_33141 Lnet/minecraft/class_156;method_33141(Ljava/util/List;I)Lcom/mojang/serialization/DataResult;
      official a Lae;a(Ljava/util/List;I)Lcom/mojang/serialization/DataResult;
    • startTimerHack Link icon

      public static void startTimerHack()
      Mappings:
      Namespace Name Mixin selector
      named startTimerHack Lnet/minecraft/util/Util;startTimerHack()V
      intermediary method_29476 Lnet/minecraft/class_156;method_29476()V
      official o Lae;o()V
    • relativeCopy Link icon

      public static void relativeCopy(Path src, Path dest, Path toCopy) throws IOException
      Copies a file contained in the folder src to the folder dest. This will replicate any path structure that may exist between src and toCopy.
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      named relativeCopy Lnet/minecraft/util/Util;relativeCopy(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
      intermediary method_29775 Lnet/minecraft/class_156;method_29775(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
      official b Lae;b(Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
    • replaceInvalidChars Link icon

      public static String replaceInvalidChars(String string, CharPredicate predicate)
      Mappings:
      Namespace Name Mixin selector
      named replaceInvalidChars Lnet/minecraft/util/Util;replaceInvalidChars(Ljava/lang/String;Lnet/minecraft/util/function/CharPredicate;)Ljava/lang/String;
      intermediary method_30309 Lnet/minecraft/class_156;method_30309(Ljava/lang/String;Lnet/minecraft/class_5462;)Ljava/lang/String;
      official a Lae;a(Ljava/lang/String;Lm;)Ljava/lang/String;
    • cachedMapper Link icon

      public static <K, V> CachedMapper<K,V> cachedMapper(Function<K,V> mapper)
      Mappings:
      Namespace Name Mixin selector
      named cachedMapper Lnet/minecraft/util/Util;cachedMapper(Ljava/util/function/Function;)Lnet/minecraft/util/CachedMapper;
      intermediary method_48746 Lnet/minecraft/class_156;method_48746(Ljava/util/function/Function;)Lnet/minecraft/class_8105;
      official a Lae;a(Ljava/util/function/Function;)Lbau;
    • memoize Link icon

      public static <T, R> Function<T,R> memoize(Function<T,R> function)
      Mappings:
      Namespace Name Mixin selector
      named memoize Lnet/minecraft/util/Util;memoize(Ljava/util/function/Function;)Ljava/util/function/Function;
      intermediary method_34866 Lnet/minecraft/class_156;method_34866(Ljava/util/function/Function;)Ljava/util/function/Function;
      official b Lae;b(Ljava/util/function/Function;)Ljava/util/function/Function;
    • memoize Link icon

      public static <T, U, R> BiFunction<T,U,R> memoize(BiFunction<T,U,R> biFunction)
      Mappings:
      Namespace Name Mixin selector
      named memoize Lnet/minecraft/util/Util;memoize(Ljava/util/function/BiFunction;)Ljava/util/function/BiFunction;
      intermediary method_34865 Lnet/minecraft/class_156;method_34865(Ljava/util/function/BiFunction;)Ljava/util/function/BiFunction;
      official a Lae;a(Ljava/util/function/BiFunction;)Ljava/util/function/BiFunction;
    • copyShuffled Link icon

      public static <T> List<T> copyShuffled(Stream<T> stream, Random random)
      Returns the contents of stream copied to a list and then shuffled.
      Returns:
      the contents of stream copied to a list and then shuffled
      Mappings:
      Namespace Name Mixin selector
      named copyShuffled Lnet/minecraft/util/Util;copyShuffled(Ljava/util/stream/Stream;Lnet/minecraft/util/math/random/Random;)Ljava/util/List;
      intermediary method_43252 Lnet/minecraft/class_156;method_43252(Ljava/util/stream/Stream;Lnet/minecraft/class_5819;)Ljava/util/List;
      official a Lae;a(Ljava/util/stream/Stream;Lbam;)Ljava/util/List;
    • shuffle Link icon

      public static IntArrayList shuffle(IntStream stream, Random random)
      Returns the contents of stream copied to a list and then shuffled.
      Returns:
      the contents of stream copied to a list and then shuffled
      Mappings:
      Namespace Name Mixin selector
      named shuffle Lnet/minecraft/util/Util;shuffle(Ljava/util/stream/IntStream;Lnet/minecraft/util/math/random/Random;)Lit/unimi/dsi/fastutil/ints/IntArrayList;
      intermediary method_43251 Lnet/minecraft/class_156;method_43251(Ljava/util/stream/IntStream;Lnet/minecraft/class_5819;)Lit/unimi/dsi/fastutil/ints/IntArrayList;
      official a Lae;a(Ljava/util/stream/IntStream;Lbam;)Lit/unimi/dsi/fastutil/ints/IntArrayList;
    • copyShuffled Link icon

      public static <T> List<T> copyShuffled(T[] array, Random random)
      Returns the contents of array copied to a list and then shuffled.
      Returns:
      the contents of array copied to a list and then shuffled
      Mappings:
      Namespace Name Mixin selector
      named copyShuffled Lnet/minecraft/util/Util;copyShuffled([Ljava/lang/Object;Lnet/minecraft/util/math/random/Random;)Ljava/util/List;
      intermediary method_43253 Lnet/minecraft/class_156;method_43253([Ljava/lang/Object;Lnet/minecraft/class_5819;)Ljava/util/List;
      official b Lae;b([Ljava/lang/Object;Lbam;)Ljava/util/List;
    • copyShuffled Link icon

      public static <T> List<T> copyShuffled(ObjectArrayList<T> list, Random random)
      Returns the contents of stream copied to a list and then shuffled.
      Returns:
      the contents of stream copied to a list and then shuffled
      Mappings:
      Namespace Name Mixin selector
      named copyShuffled Lnet/minecraft/util/Util;copyShuffled(Lit/unimi/dsi/fastutil/objects/ObjectArrayList;Lnet/minecraft/util/math/random/Random;)Ljava/util/List;
      intermediary method_43027 Lnet/minecraft/class_156;method_43027(Lit/unimi/dsi/fastutil/objects/ObjectArrayList;Lnet/minecraft/class_5819;)Ljava/util/List;
      official a Lae;a(Lit/unimi/dsi/fastutil/objects/ObjectArrayList;Lbam;)Ljava/util/List;
    • shuffle Link icon

      public static <T> void shuffle(List<T> list, Random random)
      Shuffles list, modifying the passed list in place.
      Mappings:
      Namespace Name Mixin selector
      named shuffle Lnet/minecraft/util/Util;shuffle(Ljava/util/List;Lnet/minecraft/util/math/random/Random;)V
      intermediary method_43028 Lnet/minecraft/class_156;method_43028(Ljava/util/List;Lnet/minecraft/class_5819;)V
      official c Lae;c(Ljava/util/List;Lbam;)V
    • waitAndApply Link icon

      public static <T> CompletableFuture<T> waitAndApply(Function<Executor,CompletableFuture<T>> resultFactory)
      Runs tasks using the prepare-apply model, such as creation of a SaveLoader.
      Parameters:
      resultFactory - a function that takes the apply-stage executor and returns the future
      API Note:
      This method takes a function that supplies an executor to use in the apply stage. Inside the function, callers should run the preparation, and use the passed executor for applying.
      Mappings:
      Namespace Name Mixin selector
      named waitAndApply Lnet/minecraft/util/Util;waitAndApply(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      intermediary method_43499 Lnet/minecraft/class_156;method_43499(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
      official c Lae;c(Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
    • waitAndApply Link icon

      public static <T> T waitAndApply(Function<Executor,T> resultFactory, Predicate<T> donePredicate)
      Runs tasks using the prepare-apply model.
      Parameters:
      resultFactory - a function that takes the apply-stage executor and returns the preliminary result
      donePredicate - a predicate that, given the result, checks whether applying has finished
      API Note:
      This method takes a function that supplies an executor to use in the apply stage. Inside the function, callers should run the preparation, and use the passed executor for applying.
      Mappings:
      Namespace Name Mixin selector
      named waitAndApply Lnet/minecraft/util/Util;waitAndApply(Ljava/util/function/Function;Ljava/util/function/Predicate;)Ljava/lang/Object;
      intermediary method_43498 Lnet/minecraft/class_156;method_43498(Ljava/util/function/Function;Ljava/util/function/Predicate;)Ljava/lang/Object;
      official a Lae;a(Ljava/util/function/Function;Ljava/util/function/Predicate;)Ljava/lang/Object;
    • lastIndexGetter Link icon

      public static <T> ToIntFunction<T> lastIndexGetter(List<T> values)
      Returns a function that, when given a value in values, returns the last index of the value in the list.
      Returns:
      a function that, when given a value in values, returns the last index of the value in the list
      See Also:
      Implementation Note:
      Unlike List.lastIndexOf(java.lang.Object), the returned function will return 0 when given values not in the passed list.
      Mappings:
      Namespace Name Mixin selector
      named lastIndexGetter Lnet/minecraft/util/Util;lastIndexGetter(Ljava/util/List;)Ljava/util/function/ToIntFunction;
      intermediary method_43658 Lnet/minecraft/class_156;method_43658(Ljava/util/List;)Ljava/util/function/ToIntFunction;
      official g Lae;g(Ljava/util/List;)Ljava/util/function/ToIntFunction;
    • lastIdentityIndexGetter Link icon

      public static <T> ToIntFunction<T> lastIdentityIndexGetter(List<T> values)
      Returns a function that, when given a value in values, returns the last index of the value in the list using identity comparison.
      Returns:
      a function that, when given a value in values, returns the last index of the value in the list using identity comparison
      See Also:
      Implementation Note:
      Unlike List.lastIndexOf(java.lang.Object), the returned function will return 0 when given values not in the passed list.
      Mappings:
      Namespace Name Mixin selector
      named lastIdentityIndexGetter Lnet/minecraft/util/Util;lastIdentityIndexGetter(Ljava/util/List;)Ljava/util/function/ToIntFunction;
      intermediary method_53909 Lnet/minecraft/class_156;method_53909(Ljava/util/List;)Ljava/util/function/ToIntFunction;
      official h Lae;h(Ljava/util/List;)Ljava/util/function/ToIntFunction;
    • apply Link icon

      public static <A, B> com.mojang.datafixers.Typed<B> apply(com.mojang.datafixers.Typed<A> typed, com.mojang.datafixers.types.Type<B> type, UnaryOperator<com.mojang.serialization.Dynamic<?>> modifier)
      Mappings:
      Namespace Name Mixin selector
      named apply Lnet/minecraft/util/Util;apply(Lcom/mojang/datafixers/Typed;Lcom/mojang/datafixers/types/Type;Ljava/util/function/UnaryOperator;)Lcom/mojang/datafixers/Typed;
      intermediary method_54907 Lnet/minecraft/class_156;method_54907(Lcom/mojang/datafixers/Typed;Lcom/mojang/datafixers/types/Type;Ljava/util/function/UnaryOperator;)Lcom/mojang/datafixers/Typed;
      official a Lae;a(Lcom/mojang/datafixers/Typed;Lcom/mojang/datafixers/types/Type;Ljava/util/function/UnaryOperator;)Lcom/mojang/datafixers/Typed;
    • readTyped Link icon

      public static <T> com.mojang.datafixers.Typed<T> readTyped(com.mojang.datafixers.types.Type<T> type, com.mojang.serialization.Dynamic<?> value)
      Mappings:
      Namespace Name Mixin selector
      named readTyped Lnet/minecraft/util/Util;readTyped(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;)Lcom/mojang/datafixers/Typed;
      intermediary method_54908 Lnet/minecraft/class_156;method_54908(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;)Lcom/mojang/datafixers/Typed;
      official a Lae;a(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;)Lcom/mojang/datafixers/Typed;
    • readTyped Link icon

      public static <T> com.mojang.datafixers.Typed<T> readTyped(com.mojang.datafixers.types.Type<T> type, com.mojang.serialization.Dynamic<?> value, boolean allowPartial)
      Mappings:
      Namespace Name Mixin selector
      named readTyped Lnet/minecraft/util/Util;readTyped(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;Z)Lcom/mojang/datafixers/Typed;
      intermediary method_55333 Lnet/minecraft/class_156;method_55333(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;Z)Lcom/mojang/datafixers/Typed;
      official a Lae;a(Lcom/mojang/datafixers/types/Type;Lcom/mojang/serialization/Dynamic;Z)Lcom/mojang/datafixers/Typed;
    • withAppended Link icon

      public static <T> List<T> withAppended(List<T> list, T valueToAppend)
      Mappings:
      Namespace Name Mixin selector
      named withAppended Lnet/minecraft/util/Util;withAppended(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;
      intermediary method_57108 Lnet/minecraft/class_156;method_57108(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;
      official a Lae;a(Ljava/util/List;Ljava/lang/Object;)Ljava/util/List;
    • withPrepended Link icon

      public static <T> List<T> withPrepended(T valueToPrepend, List<T> list)
      Mappings:
      Namespace Name Mixin selector
      named withPrepended Lnet/minecraft/util/Util;withPrepended(Ljava/lang/Object;Ljava/util/List;)Ljava/util/List;
      intermediary method_58272 Lnet/minecraft/class_156;method_58272(Ljava/lang/Object;Ljava/util/List;)Ljava/util/List;
      official a Lae;a(Ljava/lang/Object;Ljava/util/List;)Ljava/util/List;
    • mapWith Link icon

      public static <K, V> Map<K,V> mapWith(Map<K,V> map, K keyToAppend, V valueToAppend)
      Mappings:
      Namespace Name Mixin selector
      named mapWith Lnet/minecraft/util/Util;mapWith(Ljava/util/Map;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
      intermediary method_57109 Lnet/minecraft/class_156;method_57109(Ljava/util/Map;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
      official a Lae;a(Ljava/util/Map;Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;