Class Util

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

public class Util extends Object
  • Field Details

    • WORKER_COUNT

      private static final AtomicInteger WORKER_COUNT
    • BOOTSTRAP_EXECUTOR

      private static final ExecutorService BOOTSTRAP_EXECUTOR
    • BACKGROUND_EXECUTOR

      private static final ExecutorService BACKGROUND_EXECUTOR
    • IO_POOL

      private static final ExecutorService IO_POOL
    • timeSource

      public static LongSupplier timeSource
    • NIL_UUID

      public static final UUID NIL_UUID
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • toMap

      public static <K, V> Collector<Map.Entry<? extends K,? extends V>,?,Map<K,V>> toMap()
    • getPropertyName

      public static <T extends Comparable<T>> String getPropertyName(Property<T> p_200269_0_, Object p_200269_1_)
    • makeDescriptionId

      public static String makeDescriptionId(String p_200697_0_, @Nullable ResourceLocation p_200697_1_)
    • getMillis

      public static long getMillis()
    • getNanos

      public static long getNanos()
    • getEpochMillis

      public static long getEpochMillis()
    • makeExecutor

      private static ExecutorService makeExecutor(String p_240979_0_)
    • bootstrapExecutor

      public static Executor bootstrapExecutor()
    • backgroundExecutor

      public static Executor backgroundExecutor()
    • ioPool

      public static Executor ioPool()
    • shutdownExecutors

      public static void shutdownExecutors()
    • shutdownExecutor

      private static void shutdownExecutor(ExecutorService p_240985_0_)
    • makeIoExecutor

      private static ExecutorService makeIoExecutor()
    • failedFuture

      public static <T> CompletableFuture<T> failedFuture(Throwable p_215087_0_)
    • throwAsRuntime

      public static void throwAsRuntime(Throwable p_229756_0_)
    • onThreadException

      private static void onThreadException(Thread p_240983_0_, Throwable p_240983_1_)
    • fetchChoiceType

      @Nullable public static com.mojang.datafixers.types.Type<?> fetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_240976_0_, String p_240976_1_)
    • doFetchChoiceType

      @Nullable private static com.mojang.datafixers.types.Type<?> doFetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_240990_0_, String p_240990_1_)
    • getPlatform

      public static Util.OS getPlatform()
    • getVmArguments

      public static Stream<String> getVmArguments()
    • lastOf

      public static <T> T lastOf(List<T> p_223378_0_)
    • findNextInIterable

      public static <T> T findNextInIterable(Iterable<T> p_195647_0_, @Nullable T p_195647_1_)
    • findPreviousInIterable

      public static <T> T findPreviousInIterable(Iterable<T> p_195648_0_, @Nullable T p_195648_1_)
    • make

      public static <T> T make(Supplier<T> p_199748_0_)
    • make

      public static <T> T make(T p_200696_0_, Consumer<T> p_200696_1_)
    • identityStrategy

      public static <K> it.unimi.dsi.fastutil.Hash.Strategy<K> identityStrategy()
    • sequence

      public static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<? extends V>> p_215079_0_)
    • toStream

      public static <T> Stream<T> toStream(Optional<? extends T> p_215081_0_)
    • ifElse

      public static <T> Optional<T> ifElse(Optional<T> p_215077_0_, Consumer<T> p_215077_1_, Runnable p_215077_2_)
    • name

      public static Runnable name(Runnable p_215075_0_, Supplier<String> p_215075_1_)
    • pauseInIde

      public static <T extends Throwable> T pauseInIde(T p_229757_0_)
    • describeError

      public static String describeError(Throwable p_229758_0_)
    • getRandom

      public static <T> T getRandom(T[] p_240989_0_, Random p_240989_1_)
    • getRandom

      public static int getRandom(int[] p_240988_0_, Random p_240988_1_)
    • createRenamer

      private static BooleanSupplier createRenamer(Path p_244363_0_, Path p_244363_1_)
    • createDeleter

      private static BooleanSupplier createDeleter(Path p_244362_0_)
    • createFileDeletedCheck

      private static BooleanSupplier createFileDeletedCheck(Path p_244366_0_)
    • createFileCreatedCheck

      private static BooleanSupplier createFileCreatedCheck(Path p_244367_0_)
    • executeInSequence

      private static boolean executeInSequence(BooleanSupplier... p_244365_0_)
    • runWithRetries

      private static boolean runWithRetries(int p_244359_0_, String p_244359_1_, BooleanSupplier... p_244359_2_)
    • safeReplaceFile

      public static void safeReplaceFile(File p_240977_0_, File p_240977_1_, File p_240977_2_)
    • safeReplaceFile

      public static void safeReplaceFile(Path p_244364_0_, Path p_244364_1_, Path p_244364_2_)
    • offsetByCodepoints

      public static int offsetByCodepoints(String p_240980_0_, int p_240980_1_, int p_240980_2_)
    • prefix

      public static Consumer<String> prefix(String p_240982_0_, Consumer<String> p_240982_1_)
    • fixedSize

      public static com.mojang.serialization.DataResult<int[]> fixedSize(IntStream p_240987_0_, int p_240987_1_)
    • startTimerHackThread

      public static void startTimerHackThread()
    • copyBetweenDirs

      public static void copyBetweenDirs(Path p_240984_0_, Path p_240984_1_, Path p_240984_2_) throws IOException
      Throws:
      IOException
    • sanitizeName

      public static String sanitizeName(String p_244361_0_, ICharacterPredicate p_244361_1_)