File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/main/java/com/github/chainmailstudios/astromine/mixin Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 3333import org .spongepowered .asm .mixin .Mixin ;
3434import org .spongepowered .asm .mixin .Shadow ;
3535
36+ import java .util .Optional ;
3637import java .util .UUID ;
3738
3839@ Mixin (MiningToolItem .class )
@@ -42,6 +43,7 @@ public abstract class MiningToolItemMixin implements MiningToolItemAccess {
4243
4344 @ Override
4445 public double astromine_getAttackSpeed () {
45- return getAttributeModifiers (EquipmentSlot .MAINHAND ).get (EntityAttributes .GENERIC_ATTACK_SPEED ).stream ().filter ((EntityAttributeModifier modifier ) -> modifier .getId ().equals (UUID .fromString ("FA233E1C-4180-4865-B01B-BCCE9785ACA3" ))).findFirst ().get ().getValue ();
46+ Optional <EntityAttributeModifier > opt = getAttributeModifiers (EquipmentSlot .MAINHAND ).get (EntityAttributes .GENERIC_ATTACK_SPEED ).stream ().filter ((EntityAttributeModifier modifier ) -> modifier .getId ().equals (UUID .fromString ("FA233E1C-4180-4865-B01B-BCCE9785ACA3" ))).findFirst ();
47+ return opt .map (EntityAttributeModifier ::getValue ).orElse (0d );
4648 }
4749}
You can’t perform that action at this time.
0 commit comments