Posted February 1, 201510 yr Hey, I am making a class which is extension for ranged weapons classes in my mod. The main reason why I want to do that is better and faster weapons coding. Now I am trying to change a reloading time off weapons. Just simply code the number double number of seconds to reload. I stucked on creating new EntityArrow object when the player stops using item. EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, (float) (f * 2.0F * 4/3)); I dont know what is the third parameter. In my forge dev build there isnt any desc of that method and its parameters. It could be a start speed of an arrow or sth like this but I am not sure. What could be the units if so. Meters per second wheter other?
February 3, 201510 yr Look at ItemBow and see what it passes as the 3rd argument. Maker of the Craft++ mod.
February 3, 201510 yr Author I did it but it didnt help. float f = (float)j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; if ((double)f < 0.1D) { return; } if (f > 1.0F) { f = 1.0F; } EntityArrow entityarrow = new EntityArrow(p_77615_2_, p_77615_3_, f * 2.0F); Float f seems to be an amount of seconds of bow pulling(int j is a tick amount) I dont understand that code: f = (f * f + f * 2.0F) / 3.0F; Than there are 2 ifs. First looks if the f isnt too small, second isnt too big. So it probably could be a 0-1 relation of max bow pulling. I can add that changing 3rd parameter changes speed of arrows. Problem is what are the units.
February 3, 201510 yr Hi Based on the code in setThrowableHeading(), it appears to be the initial speed of the arrow, probably in metres per tick. -TGG
February 3, 201510 yr Author Thanks, but next I need to be sure that if I put 10F for par3 it would be 10m/tick.
February 3, 201510 yr Well then - try it and see Put a system.out.println({position}) in the arrow's tick update (don't forget that it will run on both client and server), and you will be able to calculate the distance per tick very easily. -TGG
February 3, 201510 yr Author Greate idea. I will try and reply. I was wrong. That par3 is strange. If I put there 2F speed seems to be 4m/tick When 4F it seems to be from 4 to 6. Can sb tries to get know what are those par3 and how to set correctly speed?? Mayby I have too much lags and speed isnt corectly shown in console. @Edit Ok, now I am 100% sure that par3 is speed par3 is preaty strange argument. The unit of it is meter per tick, but we must / our speed by 1.5 to make it correct in the balistic code.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.