Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh my god, I used the wrong texture in RenderRageArrow, and I did not even create the texture when the arrow flying... Oh my god... how did I missed that? What's the purple arrow in the shooting arrow texture?
I fired the arrow and when it landed, it was red, but when I went to collect it, I had the vanilla arrow in my inventory instead of my rage arrow in my inventory
Oh my god, I used the wrong texture in RenderRageArrow, and I did not even create the texture when the arrow flying... Oh my god... how did I missed that? What's the purple arrow in the shooting arrow texture?
Apparently Skeletons used to fire purple arrows before Classic 0.26 and the texture was just never removed from the game.
I fired the arrow and when it landed, it was red, but when I went to collect it, I had the vanilla arrow in my inventory instead of my rage arrow in my inventory
Ah, I forgot about the collecting. Override EntityArrow#onCollideWithPlayer to add your arrow instead of the vanilla one. You can see how I did this here.
The inGround field is private, so you'll need to access it via reflection. The easiest way to do this is store the inGround field's Field object (returned from ReflectionHelper.findField) in a private static final field and then use Field#get to get the value of the field.
ReflectionHelper.findField takes the Class object of the field's class and the field's names (SRG and MCP) as arguments. You can find the SRG name of a field/method in the MCP mappings, which can be found in your Gradle cache (~/.gradle/caches/minecraft/de/oceanlabs/mcp/<mappings_channel>/<mappings_version>, replace ~ with %USERPROFILE% on Windows).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I am receiving an error at return (boolean) IN_GROUND_FIELD.get(this); in private boolen isInground() {}.
Here's the error:
Cannot cast from Object to boolean
Apparently Java 6 doesn't allow object to primitive casts, but Java 7+ does; I wasn't aware of this since I write my code against Java 8.
Cast to Boolean (object) instead and it will automatically be unboxed to a boolean (primitive).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
With your post about those code, it worked and those explanations really helped me understand. Thanks man!
Time for me to create more arrows for fear, will & hope. Thanks again! Sorry for troubling you with my problems with 5 pages.
One question, is there a way to have my bow infinite uses?
I'm glad you finally got it working.
To make your bow have no durability (i.e. infinite uses), set the max damage (Item#setMaxDamage) to 0 in the constructor and remove the call to ItemStack#damageItem in onPlayerStoppedUsing.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
That's the first part of what I recommended. That actually prevents the item from being damaged at all, so the call to ItemStack#damageItem does nothing (which is why I also recommended removing it).
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Does nothing? Oh right, because the max damage set is 0 it means the bow has no durability, and because the bow has 0 durability, the ItemStack#damageItem will have no use except just wasting space in the code. I've learnt a lot from this thread. Thanks again.
I just added an arrow entity with a custom texture and made my bow item fire it. It seems to work without issue.
You can see my code here. I had to implement IThrowableEntity so FML synced the shooter and velocity with the client.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh my god, I used the wrong texture in RenderRageArrow, and I did not even create the texture when the arrow flying... Oh my god... how did I missed that? What's the purple arrow in the shooting arrow texture?
I fired the arrow and when it landed, it was red, but when I went to collect it, I had the vanilla arrow in my inventory instead of my rage arrow in my inventory
Apparently Skeletons used to fire purple arrows before Classic 0.26 and the texture was just never removed from the game.
Ah, I forgot about the collecting. Override EntityArrow#onCollideWithPlayer to add your arrow instead of the vanilla one. You can see how I did this here.
The inGround field is private, so you'll need to access it via reflection. The easiest way to do this is store the inGround field's Field object (returned from ReflectionHelper.findField) in a private static final field and then use Field#get to get the value of the field.
ReflectionHelper.findField takes the Class object of the field's class and the field's names (SRG and MCP) as arguments. You can find the SRG name of a field/method in the MCP mappings, which can be found in your Gradle cache (~/.gradle/caches/minecraft/de/oceanlabs/mcp/<mappings_channel>/<mappings_version>, replace ~ with %USERPROFILE% on Windows).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I am receiving an error at return (boolean) IN_GROUND_FIELD.get(this); in private boolen isInground() {}.
Here's the error:
Apparently Java 6 doesn't allow object to primitive casts, but Java 7+ does; I wasn't aware of this since I write my code against Java 8.
Cast to Boolean (object) instead and it will automatically be unboxed to a boolean (primitive).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
is the corrected code supposed to be like this?
Edit 1: with your post about those code, it worked and those explanations really helped me understand. Thanks man!
Time for me to create more arrows for fear, rage & hope. Thanks again! Sorry for troubling you with my problems with 5 pages.
Edit 2: One question, is there a way to have my bow infinite uses?
Yes. Logger is my wrapper around FMLLog, you can copy or replace it as necessary.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
With your post about those code, it worked and those explanations really helped me understand. Thanks man!
Time for me to create more arrows for fear, will & hope. Thanks again! Sorry for troubling you with my problems with 5 pages.
One question, is there a way to have my bow infinite uses?
I'm glad you finally got it working.
To make your bow have no durability (i.e. infinite uses), set the max damage (Item#setMaxDamage) to 0 in the constructor and remove the call to ItemStack#damageItem in onPlayerStoppedUsing.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks man, but I figured it differently, followed ItemBow on how they set the max damage.
Here's my code:
it's correct isn't it?
That's the first part of what I recommended. That actually prevents the item from being damaged at all, so the call to ItemStack#damageItem does nothing (which is why I also recommended removing it).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Does nothing? Oh right, because the max damage set is 0 it means the bow has no durability, and because the bow has 0 durability, the ItemStack#damageItem will have no use except just wasting space in the code. I've learnt a lot from this thread. Thanks again.
WOW. I can get some help from this XP
No problem man... just make sure you don't skip any parts, they are all very important even .... the noob questions I had
BTW are you r the other guys able to help me on a small tiny bitzy problem here?
Thread is here: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/2586198-need-help-with-error#c2
Sorry, it's out of my league, I'm still sort of a beginner, i'm at the blockstates/metadata stage of modding. Sorry.
Choonster should be able to help you.
Alright thanks anyways. If you want help on ore generation afk me
Yea, I may need help, can't seem to find my custom ores generated in the world
Edit 1: just found one of my ores, can't find the others.
hm... Tell me all of your code. Ill see if it is a coding mistake or just a simple "you put the spawn chance and viens wayyy too low"