Skip to content

Commit 8c529a5

Browse files
committed
Tool not breaking fix
1 parent 590fa4f commit 8c529a5

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

src/main/java/com/redcrafter07/ultrautilities/item/ProcessorSwordItem.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,19 @@ public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity atta
3434

3535
@Override
3636
public <T extends LivingEntity> int damageItem(ItemStack stack, int amount, T entity, Consumer<T> onBroken) {
37-
if(stack.getDamage() == 1) {
37+
/*if(stack.getDamage() == 1) {
3838
return 0;
39-
}
39+
}*/
4040
return super.damageItem(stack, amount, entity, onBroken);
4141
}
4242

43-
4443

4544
@Override
4645
public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity attacker) {
47-
if(stack.getDamage() == 1) {
48-
return false;
49-
} else {
50-
stack.damageItem(1, attacker, (entity) -> {
51-
entity.sendBreakAnimation(EquipmentSlotType.MAINHAND);
52-
});
53-
return true;
54-
}
46+
stack.damageItem(1, attacker, (entity) -> {
47+
entity.sendBreakAnimation(EquipmentSlotType.MAINHAND);
48+
});
49+
return true;
5550
}
5651

5752
/*public ActionResult<?> setAttackDamage(int attackDamage, PlayerEntity player) {
@@ -60,5 +55,4 @@ public boolean hitEntity(ItemStack stack, LivingEntity target, LivingEntity atta
6055
}*/
6156

6257

63-
6458
}

0 commit comments

Comments
 (0)