cannon: set count when loading wrong type of cannonballs

This commit is contained in:
Alexsuperfly
2021-04-18 17:00:39 -04:00
committed by Adam
parent 195bdd5971
commit 5bfbff492d
2 changed files with 21 additions and 0 deletions

View File

@@ -384,6 +384,15 @@ public class CannonPlugin extends Plugin
}
}
if (event.getMessage().startsWith("Your cannon contains"))
{
Matcher m = NUMBER_PATTERN.matcher(event.getMessage());
if (m.find())
{
cballsLeft = Integer.parseInt(m.group());
}
}
if (event.getMessage().startsWith("You unload your cannon and receive Cannonball")
|| event.getMessage().startsWith("You unload your cannon and receive Granite cannonball"))
{