Now, if you don't know Java, then you should seriously learn Java before even tryingto make a mod. But if you do know Java then here is a useful utility method for you to get a color of wool as a string based off of the metadata. Now anyone could do this, but it's good to just have something quick and easy without wasting time.
Note to moderators: I posted this in the tutorial section of mapping and modding. This isn't really a tutorial, so should this be somewhere else?
Also, can do whatever the heck you want with this code. You can even say that you invented it yourself because I don't care.
Well here it is:
public static String getWoolColorForMetadata(int metadata) {
if (metadata > 15 || metadata < 0) throw new IllegalArgumentException("The parameter metadata must be the metadata of the wool!");
if (metadata == 0) {
return "white";
}
if (metadata == 1) {
return "orange";
}
if (metadata == 2) {
return "magneta";
}
if (metadata == 3) {
return "light_blue";
}
if (metadata == 4) {
return "yellow";
}
if (metadata == 5) {
return "lime";
}
if (metadata == 6) {
return "pink";
}
if (metadata == 7) {
return "gray";
}
if (metadata == 8) {
return "light_gray";
}
if (metadata == 9) {
return "cyan";
}
if (metadata == 10) {
return "purple";
}
if (metadata == 11) {
return "blue";
}
if (metadata == 12) {
return "brown";
}
if (metadata == 13) {
return "green";
}
if (metadata == 14) {
return "red";
}
if (metadata == 15) {
return "black";
}
throw new IllegalArgumentException("It seems that there is an error! There was no result for metadata " + metadata +
"! This should NOT be happening and is the fault of the programmer!");
}
Note to moderators: I posted this in the tutorial section of mapping and modding. This isn't really a tutorial, so should this be somewhere else?
Also, can do whatever the heck you want with this code. You can even say that you invented it yourself because I don't care.
Well here it is:
public static String getWoolColorForMetadata(int metadata) { if (metadata > 15 || metadata < 0) throw new IllegalArgumentException("The parameter metadata must be the metadata of the wool!"); if (metadata == 0) { return "white"; } if (metadata == 1) { return "orange"; } if (metadata == 2) { return "magneta"; } if (metadata == 3) { return "light_blue"; } if (metadata == 4) { return "yellow"; } if (metadata == 5) { return "lime"; } if (metadata == 6) { return "pink"; } if (metadata == 7) { return "gray"; } if (metadata == 8) { return "light_gray"; } if (metadata == 9) { return "cyan"; } if (metadata == 10) { return "purple"; } if (metadata == 11) { return "blue"; } if (metadata == 12) { return "brown"; } if (metadata == 13) { return "green"; } if (metadata == 14) { return "red"; } if (metadata == 15) { return "black"; } throw new IllegalArgumentException("It seems that there is an error! There was no result for metadata " + metadata + "! This should NOT be happening and is the fault of the programmer!"); }ClothingCraft - Highly customizable and realistic clothing! No more silly leather armor!
-
View User Profile
-
View Posts
-
Send Message
ModeratorClothingCraft - Highly customizable and realistic clothing! No more silly leather armor!