Jump to content

Recommended Posts

Posted

Hello everyone im trying to understand how does cape detects the names in string on a html txt and heres is what i gone so far

 

public static void capeList() throws Exception
{
	int timeout = 30;
	String capeURL = "http://i.imgur.com/p0JW7NF.png";
	URL capeListUrl = new URL("https://gist.githubusercontent.com/Bruce/e3f86194c43424abb8c4/raw/capes");
	URLConnection connection = capeListUrl.openConnection();
	connection.setConnectTimeout(timeout);
	connection.setReadTimeout(timeout);
	InputStream stream = connection.getInputStream();
	BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
	String line;
	while ((line = reader.readLine()) != null)
	{
		if(!line.isEmpty()){
			String username = line.toLowerCase();
			ThreadDownloadImageData image = new ThreadDownloadImageData(capeURL, null, null);
			Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (ITextureObject) image);

		}else{
			continue;
		}

	}
}


 

cape wont load to me character please help im newbie and willing to learn

Posted

Try putting breakpoint on the line: ThreadDownloadImageData image = new ThreadDownloadImageData(capeURL, null, null);

and check if it is ever called.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.