Skip to content

Commit

Permalink
Fix longsword ability, minor mattock and longsword scaling changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Mar 30, 2016
1 parent 5b033d2 commit 3cea1ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions src/main/java/slimeknights/tconstruct/tools/item/LongSword.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;

Expand All @@ -26,7 +29,7 @@ public LongSword() {

@Override
public float damagePotential() {
return 1.1f;
return 1.13f;
}

@Override
Expand All @@ -44,6 +47,17 @@ public EnumAction getItemUseAction(ItemStack stack) {
return EnumAction.NONE;
}

@Override
public int getMaxItemUseDuration(ItemStack stack) {
return 200;
}

@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) {
playerIn.setActiveHand(hand);
return ActionResult.newResult(EnumActionResult.SUCCESS, itemStackIn);
}

@Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
// has to be done in onUpdate because onTickUsing is too early and gets overwritten. bleh.
Expand Down Expand Up @@ -81,8 +95,8 @@ public void onPlayerStoppedUsing(ItemStack stack, World world, EntityLivingBase
@Override
public NBTTagCompound buildTag(List<Material> materials) {
ToolNBT data = buildDefaultTag(materials);
// 2 base damage, like vanilla swords
data.attack -= 1.5f;
// a bit less base damage, but it has better scaling
data.attack += 1f;
data.attack = Math.max(1f, data.attack);
return data.get();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public float miningSpeedModifier() {

@Override
public float damagePotential() {
return 0.95f;
return 0.90f;
}

@Override
Expand Down

0 comments on commit 3cea1ef

Please sign in to comment.