Something went wrong. Try again.
The Minecraft: Java Edition decompiled source code.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445package com.mojang.blaze3d.platform;
import java.io.FileNotFoundException;import java.io.IOException;import java.io.InputStream;import java.util.List;import net.minecraft.server.packs.PackResources;import net.minecraft.server.packs.resources.IoSupplier;import org.apache.commons.lang3.ArrayUtils;
public enum IconSet { RELEASE("icons"), SNAPSHOT("icons", "snapshot");
private final String[] path;
private IconSet(final String... strings) { this.path = strings; }
public List<IoSupplier<InputStream>> getStandardIcons(PackResources packResources) throws IOException { return List.of( this.getFile(packResources, "icon_16x16.png"), this.getFile(packResources, "icon_32x32.png"), this.getFile(packResources, "icon_48x48.png"), this.getFile(packResources, "icon_128x128.png"), this.getFile(packResources, "icon_256x256.png") ); }
public IoSupplier<InputStream> getMacIcon(PackResources packResources) throws IOException { return this.getFile(packResources, "minecraft.icns"); }
private IoSupplier<InputStream> getFile(PackResources packResources, String string) throws IOException { String[] strings = (String[])ArrayUtils.add(this.path, string); IoSupplier ioSupplier = packResources.getRootResource(strings); if (ioSupplier == null) { throw new FileNotFoundException(String.join("/", strings)); } else { return ioSupplier; } }}