Skip to content

Commit 42427f5

Browse files
committed
fix pestsFromVacuum
1 parent 91da3f8 commit 42427f5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
44
mcVersion=1.8.9
55
modid=farmhelperv2
66
modName=FarmHelper
7-
version=2.9.1
7+
version=2.9.2
88
shouldRelease=true

src/main/java/com/jelly/farmhelperv2/handler/GameStateHandler.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class GameStateHandler {
4949
public final Pattern jacobsRemainingTimePattern = Pattern.compile("([0-9]|[1-2][0-9])m([0-9]|[1-5][0-9])s");
5050
public final Pattern jacobsStartsInTimePattern = Pattern.compile("Starts In: ([1-3]?[0-9])?m ?([1-5]?[0-9])?s?");
5151
private final Pattern serverClosingPattern = Pattern.compile("Server closing: (?<minutes>\\d+):(?<seconds>\\d+) .*");
52-
private final Pattern pestsFromVacuumPattern = Pattern.compile("Vacuum Bag: (\\d+) Pest(s)?");
52+
private final Pattern pestsFromVacuumPattern = Pattern.compile("Vacuum Bag: ([\\d,]+) Pest(s)?");
5353
private final Pattern composterResourceTablistPattern = Pattern.compile("\\s(Organic Matter|Fuel): (\\d{1,3}(\\.\\d{1,3})?)k");
5454
@Getter
5555
private Location lastLocation = Location.TELEPORTING;
@@ -770,7 +770,8 @@ public int getPestsFromVacuum() {
770770
Matcher matcher = pestsFromVacuumPattern.matcher(line);
771771
if (matcher.find()) {
772772
try {
773-
return Integer.parseInt(matcher.group(1));
773+
String numberStr = matcher.group(1).replaceAll(",", "");
774+
return Integer.parseInt(numberStr);
774775
} catch (Exception e) {
775776
LogUtils.sendError("Failed to parse pests from vacuum bag!");
776777
LogUtils.sendWarning("Report this to #bug-reports!");

0 commit comments

Comments
 (0)