Skip to content

Instantly share code, notes, and snippets.

@Zifiv
Created April 24, 2014 20:50
Show Gist options
  • Save Zifiv/11269058 to your computer and use it in GitHub Desktop.
Save Zifiv/11269058 to your computer and use it in GitHub Desktop.
Files and ResourceLocations : Println into out all the text who are containing into txt/test.cfg file who are in my assets folder.
try {
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(new ResourceLocation(LabNetworkMod.MOD_ID + ":txt/test.cfg"));
StringBuilder builder = new StringBuilder();
int ch;
while((ch = iresource.getInputStream().read()) != -1){
builder.append((char)ch);
}
System.out.println(builder.toString());
} catch (IOException e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment