Prevent Fish Flurry from activating if no suitable blocks are found

Steps to reproduce:
1) Select squid on hyrule castle
2) Activate fish flurry while looking at middle of empty side of castle
This commit is contained in:
samczsun 2017-02-26 14:28:45 -05:00 committed by cnr
parent 7e9211815f
commit cb9ac1fc9f
1 changed files with 11 additions and 8 deletions

View File

@ -102,11 +102,6 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
return;
}
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
{
return;
}
event.setCancelled(true);
Set<Block> blocks = new HashSet<>();
@ -131,11 +126,19 @@ public class PerkFishFlurry extends SmashPerk implements IThrown
blocks.add(cur);
}
if (!blocks.isEmpty())
{
if (!Recharge.Instance.use(player, GetName(), COOLDOWN, true, true))
{
return;
}
_active.add(new DataSquidGeyser(player, blocks));
// Inform
UtilPlayer.message(player, F.main("Game", "You used " + F.skill(GetName()) + "."));
}
}
@EventHandler
public void update(UpdateEvent event)