Dijkstra Posted July 29, 2016 Posted July 29, 2016 My IResourcePack ask for mcmeta files, instead of images, have done something wrong it is definitely requesting files from my IResourcePack so it wired up right. IResourcePack Class: package dijkstra.wardrobe.client; import com.google.common.collect.ImmutableSet; import dijkstra.wardrobe.Logging; import net.minecraft.client.resources.IResourcePack; import net.minecraft.client.resources.data.IMetadataSection; import net.minecraft.client.resources.data.MetadataSerializer; import net.minecraft.util.ResourceLocation; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.Set; public class ResourceLoader implements IResourcePack { public static final Set<String> RESOURCE_DOMAINS = ImmutableSet.<String>of("wardrobe"); @Override public InputStream getInputStream(ResourceLocation location) throws IOException { File path = new File("resources/wardrobe/textuers/"); if(!path.exists()){ path.mkdirs(); } if(resourceExists(location)){ String name = location.getResourcePath(); if(name.contains(".mc")) name = name.substring(0, name.indexOf('.')); Logging.info(name); File file = new File(String.format("resources/wardrobe/textuers/%s.png", name)); Logging.info(file.toString()); return new FileInputStream(file); } return null; } @Override public boolean resourceExists(ResourceLocation location) { return true; //return new File(String.format("/resources/wardrobe/textuers/%s.png", location.getResourcePath())).exists(); } @Override public Set<String> getResourceDomains() { return RESOURCE_DOMAINS; } @Override public <T extends IMetadataSection> T getPackMetadata(MetadataSerializer metadataSerializer, String metadataSectionName) throws IOException { return null; } @Override public BufferedImage getPackImage() throws IOException { return null; } @Override public String getPackName() { return "Wardrobe"; } } Quote
Dijkstra Posted July 29, 2016 Author Posted July 29, 2016 Return true is just for testing so i can print the files it is asking for to the log. So do i need to make an empty mcmate file for each image I want to load this as it asks for mcmeta files instead of files Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.