@Environment(value=CLIENT) public class ClientBuiltinResourcePackProvider extends Object implements ResourcePackProvider
Modifier and Type | Field and Description |
---|---|
private static Pattern |
ALPHANUMERAL |
private CompletableFuture<?> |
downloadTask |
private ResourceIndex |
index |
private ReentrantLock |
lock |
private static Logger |
LOGGER |
private DefaultResourcePack |
pack |
private ResourcePackProfile |
serverContainer |
private File |
serverPacksRoot |
Constructor and Description |
---|
ClientBuiltinResourcePackProvider(File serverPacksRoot,
ResourceIndex index) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
private static void |
delete(File file) |
private void |
deleteOldServerPack() |
CompletableFuture<?> |
download(String string,
String string2) |
private static Map<String,String> |
getDownloadHeaders() |
DefaultResourcePack |
getPack() |
CompletableFuture<Void> |
loadServerPack(File packZip,
ResourcePackSource resourcePackSource) |
private static ResourcePack |
method_16048(File file) |
private static ResourcePackProfile |
method_25453(ResourcePackProfile.Factory factory,
Supplier<ResourcePack> supplier) |
private ResourcePackProfile |
method_25454(ResourcePackProfile.Factory factory) |
private static DirectoryResourcePack |
method_25455(File file) |
void |
register(Consumer<ResourcePackProfile> consumer,
ResourcePackProfile.Factory factory) |
private boolean |
verifyFile(String expectedSha1,
File file) |
private static final Logger LOGGER
private static final Pattern ALPHANUMERAL
private final DefaultResourcePack pack
private final File serverPacksRoot
private final ReentrantLock lock
private final ResourceIndex index
@Nullable private CompletableFuture<?> downloadTask
@Nullable private ResourcePackProfile serverContainer
public ClientBuiltinResourcePackProvider(File serverPacksRoot, ResourceIndex index)
public void register(Consumer<ResourcePackProfile> consumer, ResourcePackProfile.Factory factory)
register
in interface ResourcePackProvider
public DefaultResourcePack getPack()
public CompletableFuture<?> download(String string, String string2)
private static void delete(File file)
public void clear()
private void deleteOldServerPack()
public CompletableFuture<Void> loadServerPack(File packZip, ResourcePackSource resourcePackSource)
@Nullable private ResourcePackProfile method_25454(ResourcePackProfile.Factory factory)
@Nullable private static ResourcePackProfile method_25453(ResourcePackProfile.Factory factory, Supplier<ResourcePack> supplier)
private static DirectoryResourcePack method_25455(File file)
private static ResourcePack method_16048(File file)