Список изменений
The bug was in RewardManager.giveRewards() — two issues:
- transactionId was just the player's UUID (line 32): Since the transaction ID never changed between quizzes, the anti-dupe check at line 45 would permanently block the player after their first win.
- cleanup() was called only at the end (line 86): When a player got blocked by the transaction check, the method returned early at line 47, so cleanup() was never reached and the stale entry was never removed.
Fix applied:
- Changed transactionId from playerId.toString() to playerId + "-" + System.currentTimeMillis(), making it unique per reward event instead of per player. This way the anti-dupe check only prevents the same reward call from being processed twice simultaneously, without blocking future quizzes.
- Moved cleanup() to the beginning of the method, before any checks, so stale entries are always cleared regardless of early returns.
Файлы
CRZquiz-1.0.0.jar(54.99 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
1.0.0
Загрузчики
Fabric
Версии игры
1.21.1
Загрузок
543
Дата публикации
1 мес. назад
