Fix enchant command feedback messages #22

Merged
Machine-Maker merged 2 commits from fix/enchant-cmd into master 2023-04-01 03:25:55 +02:00
Machine-Maker commented 2023-03-31 20:44:01 +02:00 (Migrated from github.com)

Fixes https://github.com/PaperMC/Folia/issues/12

This issue probably exists in other places where "feedback messages" are sent in commands, but I just wanted to see if this was an acceptable solution to the issue.

Amaranth also suggested you could keep some atomic int counters that incremented/decremented appropriately so in the last of the scheduled entity tasks, the messages could be sent there so that's an alternative solution.

Fixes https://github.com/PaperMC/Folia/issues/12 This issue probably exists in other places where "feedback messages" are sent in commands, but I just wanted to see if this was an acceptable solution to the issue. Amaranth also suggested you could keep some atomic int counters that incremented/decremented appropriately so in the last of the scheduled entity tasks, the messages could be sent there so that's an alternative solution.
kashike (Migrated from github.com) reviewed 2023-03-31 21:07:10 +02:00
kashike (Migrated from github.com) commented 2023-03-31 21:06:44 +02:00

tsk

tsk
Spottedleaf commented 2023-04-01 02:01:59 +02:00 (Migrated from github.com)

This isn't acceptable due to the usage of completablefutures. The exception handling is broken, as you've swallowed every other exception that isn't CommandSyntaxException. The proper handling is to re-throw those exceptions up the stack, but that isn't possible with completablefutures.

This isn't acceptable due to the usage of completablefutures. The exception handling is broken, as you've swallowed every other exception that isn't CommandSyntaxException. The proper handling is to re-throw those exceptions up the stack, but that isn't possible with completablefutures.
Machine-Maker commented 2023-04-01 02:47:28 +02:00 (Migrated from github.com)

Ok, I removed the use of completable futures and moved over to sending the message when the last of the targets is processed, either inside the scheduled task or not (if its an invalid entity).

Ok, I removed the use of completable futures and moved over to sending the message when the last of the targets is processed, either inside the scheduled task or not (if its an invalid entity).
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Minecraft/Folia!22
No description provided.