public class ResourceImpl extends Object implements Resource
Modifier and Type | Field and Description |
---|---|
private Identifier |
id |
private InputStream |
inputStream |
private JsonObject |
metadata |
private InputStream |
metaInputStream |
private String |
packName |
private boolean |
readMetadata |
Constructor and Description |
---|
ResourceImpl(String packName,
Identifier id,
InputStream inputStream,
InputStream metaInputStream) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
boolean |
equals(Object o) |
Identifier |
getId() |
InputStream |
getInputStream() |
<T> T |
getMetadata(ResourceMetadataReader<T> metaReader) |
String |
getResourcePackName() |
int |
hashCode() |
boolean |
hasMetadata() |
private final String packName
private final Identifier id
private final InputStream inputStream
private final InputStream metaInputStream
@Environment(value=CLIENT) private boolean readMetadata
@Environment(value=CLIENT) private JsonObject metadata
public ResourceImpl(String packName, Identifier id, InputStream inputStream, @Nullable InputStream metaInputStream)
@Environment(value=CLIENT) public Identifier getId()
public InputStream getInputStream()
getInputStream
in interface Resource
@Environment(value=CLIENT) public boolean hasMetadata()
@Environment(value=CLIENT) @Nullable public <T> T getMetadata(ResourceMetadataReader<T> metaReader)
getMetadata
in interface Resource
public String getResourcePackName()
getResourcePackName
in interface Resource
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException