
Red Pockets
A Minecraft server plugin for sending "red packets" (random and regular money splits), compatible with Paper/Folia 1.21+.
120
1
Список изменений
RedPockets Changelog
v1.2.5-Release
Fixes
1. Double refund (ChatListener & RainRedPacketManager)
- Issue: The
runDelayedexpiry task and the 5-minutegetAndRemoveExpiredcould both process the same red packet, causing duplicate refunds. - Fix: Added
removeAndGet(UUID)toRedPacketManager; refund only when the packet is successfully removed atomically; if it returnsnull, the packet was already handled by the periodic task. - Files changed:
RedPacketManager.java(newremoveAndGet),ChatListener.java,RainRedPacketManager.java
2. RedPacket.claim() race condition
- Issue: When multiple threads claimed simultaneously, another thread could insert between
claims.size()andamounts.get(index), causing duplicate allocation or index errors. - Fix: Added
synchronizedto theclaim()method to ensure atomic claiming. - Files changed:
RedPacket.java
3. RedPacket.tryUseClickClaim() redundant logic
- Issue: Race condition between
clickClaimed.contains()andclickClaimed.add();ConcurrentHashMap.newKeySet().add()returnsfalsewhen the element already exists. - Fix: Simplified to
return clickClaimed.add(playerId), using the return value ofaddto determine first-time use. - Files changed:
RedPacket.java
Файлы
RedPockets-v1.2.5.jar(127.25 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
v1.2.5
Загрузчики
FoliaPaperPurpur
Версии игры
1.21–1.21.11
Загрузок
5
Дата публикации
1 мес. назад
