Skip to content

Commit

Permalink
Possible autosprayonator infinite usage fix
Browse files Browse the repository at this point in the history
  • Loading branch information
onixiya1337 committed Dec 31, 2023
1 parent 2cc0f18 commit 10fdc76
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -552,11 +552,13 @@ public void onChatReceived(ClientChatReceivedEvent e) {
if (!running) return;
if (!isToggled()) return;
if (e.type != 0) return;
if (e.message.getUnformattedText().contains("You sprayed Plot")) {
String message = StringUtils.stripControlCodes(e.message.getUnformattedText());
if (message.contains(":")) return;
if (message.contains("You sprayed Plot")) {
String plotNumber = e.message.getUnformattedText().split(" ")[5];
PlotData data = new PlotData(Integer.parseInt(plotNumber), sprayItem.getItemName(), TimeUnit.MINUTES.toMillis(30));
sprayonatorPlotStates.put(Integer.parseInt(plotNumber), data);
} else if (e.message.getUnformattedText().contains("sprayed with that item recently")) {
} else if (message.contains("sprayed with that item recently")) {
sprayState = AUTO_SPRAYONATOR_STATE.CHECK_PLOTS;
}
}
Expand Down

0 comments on commit 10fdc76

Please sign in to comment.