Skip to content

Commit

Permalink
Refactor resolveBlocked method in RenderService class
Browse files Browse the repository at this point in the history
The resolveBlocked method in RenderService class has been refactored. We removed the process method and added the remove method from worker object, making the code easier to reason about. This also fixes the issue where playerSink object might not have been correctly updated before performing the remove operation.
  • Loading branch information
rainbowdashlabs committed Jan 26, 2024
1 parent ce9a2e9 commit 53a32ac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public void onPrePaste(PrePasteEvent event) {
* @param player player to resolve
*/
private void resolveBlocked(Player player) {
worker.process(player);
RenderSink playerSink = getSink(player);
worker.remove(player);
// We push and send empty changes
playerSink.pushAndSend(null);
//getChanges(player).ifPresent(change -> new PaketWorker.ChangeEntry(player, change, null).sendChanges());
Expand Down

0 comments on commit 53a32ac

Please sign in to comment.