Stewie please reply, i tried to re arrange the code to how you said it, i did, still no lighning, i really need this done before i can release v4 of my mod, please help!
The reason we have two of the same image is because we need one of them to reference when the item is initially loaded and the other one to reference when the item goes back to the non-animated texture. If we reference the same image in both lines of code due to the way either ModLoader or Minecraft work it won't use the image twice. It would use no image the first time and use the image only the second time in the code. I have been unable to find a way around this.
I couldn't get my bow to reset until I moved the default "iconIndex =" to after the if statement. I didn't need an extra image, but that might be because I'm using Forge. Your tutorials are pretty awesome, and I can't find any like them. Thank you for writing them!
The edited code:
public void onUpdate(ItemStack itemstack, World world, Entity entity, int i, boolean flag)
{
EntityPlayer entityplayer = (EntityPlayer)entity;
ItemStack itemstack1 = entityplayer.inventory.getCurrentItem();
if(entityplayer.isUsingItem() && itemstack1.itemID == mod_ToolVariety.IronBow.shiftedIndex)
{
int k = itemstack.getMaxItemUseDuration() - entityplayer.func_35205_Y();
if (k >= 18) {
iconIndex = 3;} else if(k > 13) {
iconIndex = 2;} else if(k > 0) {
iconIndex = 1;}
} else {
iconIndex = 0;}
}
I couldn't get my bow to reset until I moved the default "iconIndex =" to after the if statement. I didn't need an extra image, but that might be because I'm using Forge. Your tutorials are pretty awesome, and I can't find any like them. Thank you for writing them!
Yeah it's something about ModLoader's override that doesn't let you use an image twice in the code.
This post still getting attention? I hope someone replies But anyways. What if I don't want to make a new bow? Just a new arrow and have the normal bow shoot it? So far what I have done is everything haha. I can test it, I can craft my new arrow, everything works. But the bow doesn't shoot the arrow. Here are my class files.
mod_GoldArrow
package net.minecraft.src;
import java.util.*;
public class mod_GoldArrow extends BaseMod
{
public static final Item GoldArrow = new ItemGoldArrow(5000).setItemName("GA");
public void load()
{
GoldArrow.iconIndex = ModLoader.addOverride("/gui/items.png", "/arrows/Gold Arrow.png");
ModLoader.addName(GoldArrow, "Gold Arrow");
ModLoader.addRecipe(new ItemStack(GoldArrow, 1), new Object [] {"G", "S", "F", Character.valueOf('G'), Item.ingotGold, Character.valueOf('S'), Item.stick, Character.valueOf ('F'), Item.feather});
}
public void addRenderer(Map map)
{
map.put(EntityGoldArrow.class, new RenderGoldArrow());
}
public String getVersion()
{
return "1.2.4";
}}
src\minecraft\net\minecraft\src\GrEntityBronzeArrow.java:311: cannot find symbol
symbol : method causeBronzeArrowDamage(net.minecraft.src.GrEntityBronzeArrow,net.minecraft.src.GrEntityBronzeArrow)
location: class net.minecraft.src.DamageSource
damagesource = DamageSource.causeBronzeArrowDamage(this, this);
^
src\minecraft\net\minecraft\src\GrEntityBronzeArrow.java:315: cannot find symbol
symbol : method causeBronzeArrowDamage(net.minecraft.src.GrEntityBronzeArrow,net.minecraft.src.Entity)
location: class net.minecraft.src.DamageSource
damagesource = DamageSource.causeBronzeArrowDamage(this, shootingEntity);
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
== ERRORS FOUND ==
src/minecraft/net/minecraft/src/BlockTrampoline.java:8: cannot find symbol
symbol : constructor Block()
location: class net.minecraft.src.Block
{
^
src/minecraft/net/minecraft/src/ItemGrenade.java:20: cannot find symbol
symbol : constructor EntityGrenade(net.minecraft.src.World,net.minecraft.src.EntityPlayer,float)
location: class net.minecraft.src.EntityGrenade
EntityGrenade entitygrenade = new EntityGrenade(world, entityplayer, 2.0F);
^
2 errors
==================
Rollback Post to RevisionRollBack
Eons ago, there was only void. Then came the big bang. Voxels colliding with voxels, cubes with cubes. Blocks were forming, each texture unique from the rest. That was when our universe was born.
I couldn't get my bow to reset until I moved the default "iconIndex =" to after the if statement. I didn't need an extra image, but that might be because I'm using Forge. Your tutorials are pretty awesome, and I can't find any like them. Thank you for writing them!
The edited code:
Yeah it's something about ModLoader's override that doesn't let you use an image twice in the code.
MCP has given that method a name now. I'm not sure which that one was but check the OP in the same place in the code and it has the updated names.
It's "entityplayer.getItemInUseCount" now. At least I think it is.
-EDIT-
lol im a noob i put a comma instead of a full stop
How would we change the max uses of a bow? I am adding multiple bows and want each one to last longer than the others.Oh wow, how did I miss that x.xAlso, after following all the rendering steps, I still have a white box when I fire the bow
mod_GoldArrow
EntityGoldArrow
RenderGoldArrow
It's getItemInUseCount() now I believe.
yeah how do we fix that?