Skip to content

Commit

Permalink
Throwing knives windup is shorter and they nearly don't slow you down…
Browse files Browse the repository at this point in the history
… while doing so.

Also minimal javelin buff.
  • Loading branch information
bonii-xx committed Nov 21, 2014
1 parent a44919a commit d57f8b6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/weaponry/weapons/Javelin.java
Expand Up @@ -108,7 +108,7 @@ public float maxAccuracy(ItemStack itemStack) {

@Override
public int getWindupTime(ItemStack itemStack) {
return 20;
return 17;
}

@Override
Expand Down
21 changes: 20 additions & 1 deletion src/main/java/tconstruct/weaponry/weapons/ThrowingKnife.java
@@ -1,5 +1,6 @@
package tconstruct.weaponry.weapons;

import net.minecraft.client.entity.EntityPlayerSP;
import tconstruct.weaponry.client.CrosshairType;
import tconstruct.weaponry.entity.ThrowingKnifeEntity;
import tconstruct.library.weaponry.AmmoWeapon;
Expand Down Expand Up @@ -58,7 +59,7 @@ public Item getAccessoryItem() {
}

@Override
public int getWindupTime(ItemStack itemStack) { return 30; } // 1 1/2 seconds
public int getWindupTime(ItemStack itemStack) { return 15; } // 1 1/2 seconds

@Override
public float getMinWindupProgress(ItemStack itemStack) {
Expand Down Expand Up @@ -90,4 +91,22 @@ public float getProjectileSpeed() {
public CrosshairType getCrosshairType() {
return CrosshairType.SPIKE;
}

@Override
@SideOnly(Side.CLIENT)
public void onUpdate (ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
// aiming with throwing knives slows down much less than with a bow
super.onUpdate(stack, world, entity, par4, par5);
if (entity instanceof EntityPlayerSP)
{
EntityPlayerSP player = (EntityPlayerSP) entity;
ItemStack usingItem = player.getItemInUse();
if (usingItem != null && usingItem.getItem() == this)
{
player.movementInput.moveForward *= 3.0F;
player.movementInput.moveStrafe *= 3.0F;
}
}
}
}

0 comments on commit d57f8b6

Please sign in to comment.