Skip to content

Commit

Permalink
fix: ProfileChanger: Now the time condition only changes if it is in …
Browse files Browse the repository at this point in the history
…the defined minute or in the next 5 minutes
  • Loading branch information
dm94 committed Sep 17, 2024
1 parent dd84733 commit eea8c1c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ hs_err_pid*
.idea/*
.gradle/
build/
bin/
out/*
DmPlugin.iml
dmplugin.properties
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/deeme/behaviours/ProfileChanger.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ private boolean isReadyTimeCondition() {

LocalDateTime da = LocalDateTime.now();

return config.timeCondition.hour == da.getHour() && da.getMinute() >= config.timeCondition.minute;
return config.timeCondition.hour == da.getHour()
&& (da.getMinute() >= config.timeCondition.minute && config.timeCondition.minute <= da.getMinute() + 5);
}

private boolean isReadyKeyCondition() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "DmPlugin",
"author": "Dm94Dani",
"version": "2.3.2 beta 2",
"version": "2.3.2 beta 3",
"minVersion": "1.131",
"supportedVersion": "1.131.2",
"basePackage": "com.deeme",
Expand Down

0 comments on commit eea8c1c

Please sign in to comment.