public class CacheSystem
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CacheSystem.DownloadTask |
| 限定符和类型 | 字段和说明 |
|---|---|
static CacheSystem |
INSTANCE |
| 限定符和类型 | 方法和说明 |
|---|---|
com.google.common.util.concurrent.ListenableFuture<java.io.File> |
cache(net.minecraft.util.ResourceLocation location,
java.net.URL url)
Cache the file to the resource location.
|
com.google.common.util.concurrent.ListenableFuture<java.io.File> |
cachePresisit(net.minecraft.util.ResourceLocation location,
java.net.URL url)
Cache the file to the resource location.
|
void |
clear(java.lang.String domain)
Clear all the resources in a domain.
|
java.io.File |
getCacheFile(net.minecraft.util.ResourceLocation location) |
boolean |
hasCached(net.minecraft.util.ResourceLocation location) |
void |
init(net.minecraftforge.fml.common.event.FMLInitializationEvent event) |
boolean |
isPending(net.minecraft.util.ResourceLocation location)
Determine if the resource is still pending.
|
void |
remove(net.minecraft.util.ResourceLocation location)
Remove the cached resource.
|
public static final CacheSystem INSTANCE
public com.google.common.util.concurrent.ListenableFuture<java.io.File> cachePresisit(net.minecraft.util.ResourceLocation location,
java.net.URL url)
throws java.io.IOException
And this file WON'T be delete after game stop.
location - The resource location.url - The download URL.java.io.IOExceptionpublic com.google.common.util.concurrent.ListenableFuture<java.io.File> cache(net.minecraft.util.ResourceLocation location,
java.net.URL url)
throws java.io.IOException
And this file WILL be delete after game stop.
location - The resource location.url - The download URL.java.io.IOExceptionpublic boolean hasCached(net.minecraft.util.ResourceLocation location)
location - The resource location.public boolean isPending(net.minecraft.util.ResourceLocation location)
location - The locationpublic void remove(net.minecraft.util.ResourceLocation location)
The file will be deleted.
location - The location of the resource.public void clear(java.lang.String domain)
domain - The domain name.public java.io.File getCacheFile(net.minecraft.util.ResourceLocation location)
public void init(net.minecraftforge.fml.common.event.FMLInitializationEvent event)