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

Adding TaskManager, Fixing player-data reset & scoreboard issue #94

Merged

Conversation

RedstoneFuture
Copy link
Owner

@RedstoneFuture RedstoneFuture commented Jul 3, 2023

The class Games.java is the central object for a game. However, some methods and fields can be outsourced to manager classes to keep the Games class a bit more manageable. The following is a suggestion for outsourcing:

Games.java

  • NEW: method TaskManager()

Moving from Game.java to TaskManager.java

  • field Timer timer (+ Getter)
  • field BukkitTask bt (+ Getter)

With this investigation, a runtime issue was also found and fixed that did not correctly reset the player datas after the GameState.END phase, because the EventListeners were already disabled. In addition, the game duration (currently for the scoreboard) was cached for the GameState.END phase.

@RedstoneFuture RedstoneFuture changed the title Refactoring Refactoring Games.java : Adding TaskManager Jul 3, 2023
@RedstoneFuture RedstoneFuture changed the title Refactoring Games.java : Adding TaskManager Refactoring Games.java : Adding TaskManager, Fixing player-data reset & scoreboard issue Jul 3, 2023
@RedstoneFuture RedstoneFuture changed the title Refactoring Games.java : Adding TaskManager, Fixing player-data reset & scoreboard issue Adding TaskManager, Fixing player-data reset & scoreboard issue Jul 3, 2023
@RedstoneFuture RedstoneFuture marked this pull request as ready for review July 3, 2023 15:35
@daniel-naegele daniel-naegele merged commit f043132 into RedstoneFuture:master Jul 18, 2023
1 check passed
@RedstoneFuture RedstoneFuture deleted the refactoring/task-manager branch July 18, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants