I have attempted several times to texture my file, to no avail. What am I doing wrong?
ItemFireSword.java
package mod.myMod;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ItemFireSword extends Item {
public ItemFireSword(int id) {
super(id);
setMaxStackSize(64);
setCreativeTab(CreativeTabs.tabCombat);
setUnlocalizedName("FireSword");
}
public void func_94581_a(IconRegister iconRegister)
{
iconIndex = iconRegister.func_94245_a("myMod:FireSword");
}
}
ClientProxy.java
package mod.myMod.client;
import net.minecraftforge.client.MinecraftForgeClient;
import mod.myMod.CommonProxy;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
MinecraftForgeClient.preloadTexture(ItemFireSword);
}
}
CommonProxy.java
package mod.myMod;
public class CommonProxy {
public static String ItemFireSword = "/myMod/textures/items/FireSword.png";
// Client stuff
public void registerRenderers() {
// Nothing here as the server doesn't render graphics!
}
}
Texture is located at:
mcp742/jars/mods/myMod/textures/items/FireSword.png
I also tried:
mcp742/eclipse/Minecraft/bin/myMod/textures/items/FireSword.png
When I run the game, I just get a white square with "missing texture" inside of it.
Also try putting the actual string as a parmater to MinecraftForgeClient.preloadTexture instead of just using a variable created in CommonProxy. If you put your textures in /mcp742/eclipse/Minecraft/bin/myMod/textures/items/FireSword.png, then you register
"/myMod/Textures/items/FireSword.png"
I have attempted several times to texture my file, to no avail. What am I doing wrong?
ItemFireSword.java
package mod.myMod;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ItemFireSword extends Item {
public ItemFireSword(int id) {
super(id);
setMaxStackSize(64);
setCreativeTab(CreativeTabs.tabCombat);
setUnlocalizedName("FireSword");
}
public void func_94581_a(IconRegister iconRegister)
{
iconIndex = iconRegister.func_94245_a("myMod:FireSword");
}
}
ClientProxy.java
package mod.myMod.client;
import net.minecraftforge.client.MinecraftForgeClient;
import mod.myMod.CommonProxy;
public class ClientProxy extends CommonProxy {
@Override
public void registerRenderers() {
MinecraftForgeClient.preloadTexture(ItemFireSword);
}
}
CommonProxy.java
package mod.myMod;
public class CommonProxy {
public static String ItemFireSword = "/myMod/textures/items/FireSword.png";
// Client stuff
public void registerRenderers() {
// Nothing here as the server doesn't render graphics!
}
}
Texture is located at:
mcp742/jars/mods/myMod/textures/items/FireSword.png
I also tried:
mcp742/eclipse/Minecraft/bin/myMod/textures/items/FireSword.png
When I run the game, I just get a white square with "missing texture" inside of it.
Hmm, how about we try making an iconPath method?
So it looks like this?
package mod.myMod;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
public class ItemFireSword extends Item {
private String iconPath;
@SideOnly(Side.CLIENT)
private Icon icon;
public ItemFireSword(int id) {
super(id);
setMaxStackSize(64);
setCreativeTab(CreativeTabs.tabCombat);
setUnlocalizedName("FireSword");
}
@SideOnly(Side.CLIENT)
public void func_94581_a(IconRegister par1IconRegister)
{
this.icon = par1IconRegister.func_94245_a("myMod:FireSword");
}
@SideOnly(Side.CLIENT)
public Icon getIconFromDamage(int par1)
{
return this.icon;
}
}
ItemFireSword.java
ClientProxy.java
CommonProxy.java
Texture is located at:
mcp742/jars/mods/myMod/textures/items/FireSword.png
I also tried:
mcp742/eclipse/Minecraft/bin/myMod/textures/items/FireSword.png
When I run the game, I just get a white square with "missing texture" inside of it.
Also try putting the actual string as a parmater to MinecraftForgeClient.preloadTexture instead of just using a variable created in CommonProxy. If you put your textures in /mcp742/eclipse/Minecraft/bin/myMod/textures/items/FireSword.png, then you register
"/myMod/Textures/items/FireSword.png"
For some reason it is still unable to recognize the file is in the location.
Hmm, how about we try making an iconPath method?
So it looks like this?
Try that out and tell me how it did.