diff options
author | syeyoung <cyong06@naver.com> | 2021-03-11 21:03:14 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-11 21:03:14 +0900 |
commit | 1e7761c2a495add7bbd896a64544374f8ca702b4 (patch) | |
tree | 8e6e2fedd9bcda5ea894ff485dcd5384be162d45 /src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java | |
parent | 45098cc47769c0a7edeacd587c355e99f97e11c9 (diff) | |
download | Skyblock-Dungeons-Guide-1e7761c2a495add7bbd896a64544374f8ca702b4.tar.gz Skyblock-Dungeons-Guide-1e7761c2a495add7bbd896a64544374f8ca702b4.tar.bz2 Skyblock-Dungeons-Guide-1e7761c2a495add7bbd896a64544374f8ca702b4.zip |
resources
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java b/src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java new file mode 100644 index 00000000..a845757d --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/resources/DGTexturePack.java @@ -0,0 +1,57 @@ +package kr.syeyoung.dungeonsguide.resources; + +import kr.syeyoung.dungeonsguide.a; +import kr.syeyoung.dungeonsguide.b; +import kr.syeyoung.dungeonsguide.e; +import lombok.AllArgsConstructor; +import net.minecraft.client.resources.IResourcePack; +import net.minecraft.client.resources.data.IMetadataSection; +import net.minecraft.client.resources.data.IMetadataSerializer; +import net.minecraft.util.ResourceLocation; + +import java.awt.image.BufferedImage; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Collections; +import java.util.Set; + +@AllArgsConstructor +public class DGTexturePack implements IResourcePack { + + private b authenticator; + + @Override + public InputStream getInputStream(ResourceLocation location) throws IOException { + InputStream inputStream = this.getClass().getResourceAsStream("/assets/dg/"+location.getResourcePath()); + if (inputStream != null) return inputStream; + return new ByteArrayInputStream(authenticator.d().get("assets/dg/"+location.getResourcePath())); + } + + @Override + public boolean resourceExists(ResourceLocation location) { + return authenticator.d().containsKey("assets/dg/"+location.getResourcePath()) + || this.getClass().getResourceAsStream("/assets/dg/"+location.getResourcePath()) != null; + } + + @Override + public Set<String> getResourceDomains() { + return Collections.singleton("iamdg"); + } + + @Override + public <T extends IMetadataSection> T getPackMetadata(IMetadataSerializer p_135058_1_, String p_135058_2_) throws IOException { + return null; + } + + @Override + public BufferedImage getPackImage() throws IOException { + return new BufferedImage(512,512, BufferedImage.TYPE_INT_RGB); + } + + @Override + public String getPackName() { + return "Dungeons Guide Default Pack"; + } +} |