2014/04/11: As of today we have made many changes. The tutorials for this page have been moved to tutorials.darkhax.net. This change brings with it many benefits for those who like my tutorials and myself. Some of these benefits include an easy to use syntax highlighter that displays code samples in a familiar and visually friendly way. We also now have versions of the tutorials available on GitHub. Along with these changes we have some new team members that will be helping out with the tutorials and any issues that may arise. We are also now working on 1.7.2 tutorials. Hope you all enjoy this new update to the tutorials.
2013/12/31: Hello world, after over half a year I have finally decided to make a new tutorial page. My old topic got caught up in "the great archiving" and sadly did not survive. I am planning to resume the creation up my tutorials and I have a lot of fun things I can't wait to show everyone. I have also recently been working with a few other members of the tutorials community such as wuppy and a very old project that some of you may be familiar with shall be resurfacing. Due to this I will have a lot of time to work on fun and abstract tutorials rather than the boring tutorials that covered the ins and outs of making a mod. If you're also a tutorial author and would like to find out more about the project I mentioned please feel free to send me a private message. We're looking for tutorial authors to help aid in the creation of the project. With 1.7.2 about to become the next stable and supported build we're going to need a lot of help.
How To Get Help:
There are several ways to get help from myself or one of our team members. You can contact me by commenting on this page or sending me a private message on the forums however the forums can sometimes take a day or two to alert me of new posts on this page and I may not respond to your private message. The best way to get in touch with a member of our staff or myself is through IRC. IRC is basically a series of chat rooms under a network. We have our own chat room registered on the Esper Network just join #MinecraftForgeTuts and you will find us.
Awesome! I've been looking to add capes to my group project's mod, but Jadar's Developers Cape Library [which is awesome btw] doesn't seem to want to work for me.
Awesome! I've been looking to add capes to my group project's mod, but Jadar's Developers Cape Library [which is awesome btw] doesn't seem to want to work for me.
Thanks, glad you liked the tutorial. I would try to stay away from libraries that are not needed. Although that cape library is rather cool adding new dependencies can be hard on users and considerably not worth it when you can accomplish the same outcome in 5 or less lines of code.
One more question though, does this support HD Capes? Such as a 2048x1024 Cape texture?
Not so sure about a 2048x1024 cape image (That's bigger than a lot of desktop background images :o) But you can certainly use images that are a higher resolution as long as the aspect ratio is the same as the original.
It is not likely that I will be doing any OpenGL specific tutorials however there are literally metric tons of material already around the internet for you to study and use.
Thanks for this! but it seems to not work for me... i probably have the code in the wrong spot.. lol..
Sorry for the late reply. For this to work the players name has to be added (It has to be 100% matching caps and all) and also the code must actually be called. If you post your code (make sure to use spoiler) I could help look into it.
Suggestion: Ingame-Wiki (Just like Tinkers Construct) Yes, we are too lazy to take a look at the source.
lol! i was thinking of doing that for my mod and i didn't know where to find a tut... but now that u said tinkers construct has open source, i might go check that...
Edit: how do i set up for groups of players? I have certain users (like me and some friends and others who have helped me with the mod) have a own custom cape, but i want every other user that installs my mod have a "normal player" cape.. Also, i need to somehow have the list of players who get's the custom capes to load from a google docs thing, so when someone is added it's updated instantly, and then the players can see it in game (if they log out and back into a world or somethin).... i have an update notifier for the mod, so i'll probably use something from that...
lol! i was thinking of doing that for my mod and i didn't know where to find a tut... but now that u said tinkers construct has open source, i might go check that...
Edit: how do i set up for groups of players? I have certain users (like me and some friends and others who have helped me with the mod) have a own custom cape, but i want every other user that installs my mod have a "normal player" cape.. Also, i need to somehow have the list of players who get's the custom capes to load from a google docs thing, so when someone is added it's updated instantly, and then the players can see it in game (if they log out and back into a world or somethin).... i have an update notifier for the mod, so i'll probably use something from that...
I don't really like the in game wiki thing. I will think about it though.
As for your question, I made a PR for the Developer Capes library a while back showing off some of the stuff in the tutorial. Groups are shown in this and also grabbing files from online. The code can be found here.
Hastebin will delete that link sooner or later so for the sake of archives I made a backup.
package com.jadarstudios.developercapes;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.TextureObject;
import net.minecraft.util.ResourceLocation;
public class DevCapes
{
/**
* Adds a cape for just a single player
* @param username: The username of the player.
* @param url: The url of the cape image.
*/
public static void addCape(String username, String url)
{
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (TextureObject) object);
}
public static void addSkin(String username, String url) {
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("skins/" + username), (TextureObject) object);
}
/**
* Adds cape for a group of players from an array.
* @param group: Array of users to give the cape to.
* @param url: The url of the cape image.
*/
public static void addGroupedCape(String[] group, String url)
{
for (String username : group)
{
addCape(username, url);
}
}
/**
* Grabs a string array from an online source.
* Each line of file is a new username.
* @param url: Link to the text file.
* @return: An array from a text file. If link is invalid returns a blank array.
*/
public static String[] getArrayFromUrl(String url)
{
ArrayList<String> list = new ArrayList<String>();
try
{
BufferedReader urlReader = new BufferedReader(new InputStreamReader(new URL(url).openStream()));
String line;
while((line = urlReader.readLine()) != null)
{
list.add(line);
}
return (String[]) list.toArray(new String[list.size()]);
}
catch(Exception e) {
e.printStackTrace();
list.add("");
return (String[]) list.toArray(new String[list.size()]);
}
}
}
I don't really like the in game wiki thing. I will think about it though.
As for your question, I made a PR for the Developer Capes library a while back showing off some of the stuff in the tutorial. Groups are shown in this and also grabbing files from online. The code can be found here.
Hastebin will delete that link sooner or later so for the sake of archives I made a backup.
package com.jadarstudios.developercapes;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ThreadDownloadImageData;
import net.minecraft.client.renderer.texture.TextureObject;
import net.minecraft.util.ResourceLocation;
public class DevCapes
{
/**
* Adds a cape for just a single player
* @param username: The username of the player.
* @param url: The url of the cape image.
*/
public static void addCape(String username, String url)
{
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (TextureObject) object);
}
public static void addSkin(String username, String url) {
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("skins/" + username), (TextureObject) object);
}
/**
* Adds cape for a group of players from an array.
* @param group: Array of users to give the cape to.
* @param url: The url of the cape image.
*/
public static void addGroupedCape(String[] group, String url)
{
for (String username : group)
{
addCape(username, url);
}
}
/**
* Grabs a string array from an online source.
* Each line of file is a new username.
* @param url: Link to the text file.
* @return: An array from a text file. If link is invalid returns a blank array.
*/
public static String[] getArrayFromUrl(String url)
{
ArrayList<String> list = new ArrayList<String>();
try
{
BufferedReader urlReader = new BufferedReader(new InputStreamReader(new URL(url).openStream()));
String line;
while((line = urlReader.readLine()) != null)
{
list.add(line);
}
return (String[]) list.toArray(new String[list.size()]);
}
catch(Exception e) {
e.printStackTrace();
list.add("");
return (String[]) list.toArray(new String[list.size()]);
}
}
}
Thanks for this! but Im a little confused, maybe you can clear it up:
/**
* Adds a cape for just a single player
* @param username: The username of the player.
* @param url: The url of the cape image.
*/
public static void addCape(String username, String url)
{
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (TextureObject) object);
}
public static void addSkin(String username, String url) {
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("skins/" + username), (TextureObject) object);
}
It says it uses a url, yet there is a folder location. where I do I put the url or is it just using a folder?
Thanks for this! but Im a little confused, maybe you can clear it up:
/**
* Adds a cape for just a single player
* @param username: The username of the player.
* @param url: The url of the cape image.
*/
public static void addCape(String username, String url)
{
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("cloaks/" + username), (TextureObject) object);
}
public static void addSkin(String username, String url) {
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
Minecraft.getMinecraft().renderEngine.loadTexture(new ResourceLocation("skins/" + username), (TextureObject) object);
}
It says it uses a url, yet there is a folder location. where I do I put the url or is it just using a folder?
When you call one of those methods it will ask for two strings, the first being a name of a player, the other being the url for an image. The way minecraft capes and skins (and other images) work is in an identifier based association system.
In this line we create an instance of the image based on the url.
ThreadDownloadImageData object = new ThreadDownloadImageData(url, null, null);
In this next line we are creating an association for the player and the image.
assets/minecraft/cloaks/username/texture is not an actual file location it is a symbolic representation that links the player and the cape/skin together.
2014/04/11: As of today we have made many changes. The tutorials for this page have been moved to tutorials.darkhax.net. This change brings with it many benefits for those who like my tutorials and myself. Some of these benefits include an easy to use syntax highlighter that displays code samples in a familiar and visually friendly way. We also now have versions of the tutorials available on GitHub. Along with these changes we have some new team members that will be helping out with the tutorials and any issues that may arise. We are also now working on 1.7.2 tutorials. Hope you all enjoy this new update to the tutorials.
2013/12/31: Hello world, after over half a year I have finally decided to make a new tutorial page. My old topic got caught up in "the great archiving" and sadly did not survive. I am planning to resume the creation up my tutorials and I have a lot of fun things I can't wait to show everyone. I have also recently been working with a few other members of the tutorials community such as wuppy and a very old project that some of you may be familiar with shall be resurfacing. Due to this I will have a lot of time to work on fun and abstract tutorials rather than the boring tutorials that covered the ins and outs of making a mod. If you're also a tutorial author and would like to find out more about the project I mentioned please feel free to send me a private message. We're looking for tutorial authors to help aid in the creation of the project. With 1.7.2 about to become the next stable and supported build we're going to need a lot of help.
The Team:
Darkhax - Tutorial Author
PaleoCrafter - Tutorial Author
Wuppy21 - Tutorial Author
Ghosrec35 - Web Developer
1.7.2 Tutorials:
Custom Creative Tab Tutorial
Inter Mod Communication
Archived Tutorials:
Cape tutorial temporarily removed.
How To Get Help:
There are several ways to get help from myself or one of our team members. You can contact me by commenting on this page or sending me a private message on the forums however the forums can sometimes take a day or two to alert me of new posts on this page and I may not respond to your private message. The best way to get in touch with a member of our staff or myself is through IRC. IRC is basically a series of chat rooms under a network. We have our own chat room registered on the Esper Network just join #MinecraftForgeTuts and you will find us.
Farewell everyone o/
(NOTE: He told me to leave this reply D: )
Actually, he didn't. It was a joke from my side ;-) Love ya, Darkhax :-)
Mapping and Modding rules | Global rules
-TBA-
-TBA-
It's almost like a conspiracy
Thanks ;p
Thanks, glad you liked the tutorial. I would try to stay away from libraries that are not needed. Although that cape library is rather cool adding new dependencies can be hard on users and considerably not worth it when you can accomplish the same outcome in 5 or less lines of code.
Not so sure about a 2048x1024 cape image (That's bigger than a lot of desktop background images :o) But you can certainly use images that are a higher resolution as long as the aspect ratio is the same as the original.
Farewell everyone o/
It is not likely that I will be doing any OpenGL specific tutorials however there are literally metric tons of material already around the internet for you to study and use.
Farewell everyone o/
E
Sorry for the late reply. For this to work the players name has to be added (It has to be 100% matching caps and all) and also the code must actually be called. If you post your code (make sure to use spoiler) I could help look into it.
Farewell everyone o/
Grr haste bin, always removing my pastes. I will have a mirror up from my site soon.
Farewell everyone o/
Derp me..
anyway, thanks for this!!! Now players who play my mod will enjoy a lovely cape! I'll be sure to give a shout out to you when i update the mod.
E
Thanks, I am glad these tutorials were able to help you.
Farewell everyone o/
lol! i was thinking of doing that for my mod and i didn't know where to find a tut... but now that u said tinkers construct has open source, i might go check that...
Edit: how do i set up for groups of players? I have certain users (like me and some friends and others who have helped me with the mod) have a own custom cape, but i want every other user that installs my mod have a "normal player" cape.. Also, i need to somehow have the list of players who get's the custom capes to load from a google docs thing, so when someone is added it's updated instantly, and then the players can see it in game (if they log out and back into a world or somethin).... i have an update notifier for the mod, so i'll probably use something from that...
E
I don't really like the in game wiki thing. I will think about it though.
As for your question, I made a PR for the Developer Capes library a while back showing off some of the stuff in the tutorial. Groups are shown in this and also grabbing files from online. The code can be found here.
Hastebin will delete that link sooner or later so for the sake of archives I made a backup.
Farewell everyone o/
Thanks for this! but Im a little confused, maybe you can clear it up:
It says it uses a url, yet there is a folder location. where I do I put the url or is it just using a folder?
When you call one of those methods it will ask for two strings, the first being a name of a player, the other being the url for an image. The way minecraft capes and skins (and other images) work is in an identifier based association system.
In this line we create an instance of the image based on the url.
In this next line we are creating an association for the player and the image.
assets/minecraft/cloaks/username/texture is not an actual file location it is a symbolic representation that links the player and the cape/skin together.
Farewell everyone o/
Slabs- Bring easily place able upside down slabs back to minecraft!
That's great to hear! I have considered doing this for a few of my mods in the past. Pulling image files from online offers up a lot of cool features.
Farewell everyone o/