Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make protectionTimer publicly accessible #102

Merged
merged 12 commits into from
Jan 11, 2025

Conversation

Kalibrier
Copy link
Contributor

Changed some stuff to public for API usage

Changed some stuff to public for API usage
@Almighty-Satan
Copy link
Collaborator

Seems ok, except for the fact that it does not compile. But I should add that everything outside of the de.cuuky.varo.api package is not considered api and there may be breaking changes at any time, even in minor updates.

@Almighty-Satan Almighty-Satan added the enhancement New feature or request label Dec 30, 2024
Should compile now, also made the code simpler in getCountdownMin and getCountdownSec
@Kalibrier
Copy link
Contributor Author

Kalibrier commented Dec 30, 2024

Seems ok, except for the fact that it does not compile. But I should add that everything outside of the de.cuuky.varo.api package is not considered api and there may be breaking changes at any time, even in minor updates.

Compiles now, shouldn't break anything as I just added some public methods to get the protection time

src/main/java/de/cuuky/varo/game/start/ProtectionTime.java Outdated Show resolved Hide resolved
Main.getLanguageManager().broadcastMessage(ConfigMessages.PROTECTION_TIME_OVER);
Main.getVaroGame().setProtection(null);
scheduler.cancel();
} else if (protectionTimer % ConfigSetting.STARTPERIOD_PROTECTIONTIME_BROADCAST_INTERVAL.getValueAsInt() == 0 && this.protectionTimer != timer)
Main.getLanguageManager().broadcastMessage(ConfigMessages.PROTECTION_TIME_UPDATE).replace("%minutes%", getCountdownMin(protectionTimer)).replace("%seconds%", getCountdownSec(protectionTimer));
} else if (ProtectionTime.this.protectionTimer % ConfigSetting.STARTPERIOD_PROTECTIONTIME_BROADCAST_INTERVAL.getValueAsInt() == 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to this.protectionTimer != timer?

src/main/java/de/cuuky/varo/game/start/ProtectionTime.java Outdated Show resolved Hide resolved
src/main/java/de/cuuky/varo/game/start/ProtectionTime.java Outdated Show resolved Hide resolved
@Almighty-Satan
Copy link
Collaborator

Seems ok, except for the fact that it does not compile. But I should add that everything outside of the de.cuuky.varo.api package is not considered api and there may be breaking changes at any time, even in minor updates.

Compiles now, shouldn't break anything as I just added some public methods to get the protection time

My comment might have been a bit misleading. What I actually meant was that you can make breaking changes any time you want. But you also might have to update whatever other plugin uses these methods. We also cannot guarantee that these methods will not be changed in the future.

Using Integer might be better

Co-authored-by: Almighty-Satan <[email protected]>
@Almighty-Satan Almighty-Satan changed the base branch from master to dev-v4 January 1, 2025 08:54
@Almighty-Satan Almighty-Satan changed the title Update ProtectionTime.java Make protectionTimer publicly accessible Jan 1, 2025
@Almighty-Satan
Copy link
Collaborator

You removed this.protectionTimer != timer in line 43 (see my comment above). If you want this to get merged you should either re-add that check or explain why it was removed

@Almighty-Satan Almighty-Satan merged commit 6388414 into CuukyOfficial:dev-v4 Jan 11, 2025
2 checks passed
@Kalibrier Kalibrier deleted the patch-2 branch January 11, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants