Skip to content

Commit

Permalink
Merge pull request #3 from Provismet/1.20
Browse files Browse the repository at this point in the history
Fix mace durability.
  • Loading branch information
Provismet authored Feb 26, 2024
2 parents 970a0a5 + 02ff9c7 commit 8503fba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ yarn_mappings=1.20.2+build.4
loader_version=0.15.6

# Mod Properties
mod_version=1.0.0
mod_version=1.0.1
maven_group=com.provismet
archives_base_name=additional-armoury
modid=additional-armoury
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/com/provismet/AdditionalArmoury/items/MaceItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ public float getWeaponDamage () {
return this.attackDamage;
}

@Override
public boolean postHit (ItemStack stack, LivingEntity target, LivingEntity attacker) {
stack.damage(1, attacker, e -> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
return true;
}

@Override
public boolean postMine (ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) {
if (state.getHardness(world, pos) != 0.0f) {
stack.damage(2, miner, e -> e.sendEquipmentBreakStatus(EquipmentSlot.MAINHAND));
}
return true;
}

@Override
public void postCriticalHit (ItemStack itemStack, LivingEntity user, LivingEntity target) {
int shredding = EnchantmentHelper.getLevel(AAEnchantments.SHREDDING, itemStack);
Expand Down

0 comments on commit 8503fba

Please sign in to comment.