Created
April 24, 2014 20:50
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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