▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Red Pockets
Red Pockets

Red Pockets

A Minecraft server plugin for sending "red packets" (random and regular money splits), compatible with Paper/Folia 1.21+.

120
1
Все версииRed Pockets v1.2.5

Red Pockets v1.2.5

Release1 мес. назад

Список изменений

RedPockets Changelog

v1.2.5-Release

Fixes

1. Double refund (ChatListener & RainRedPacketManager)

  • Issue: The runDelayed expiry task and the 5-minute getAndRemoveExpired could both process the same red packet, causing duplicate refunds.
  • Fix: Added removeAndGet(UUID) to RedPacketManager; refund only when the packet is successfully removed atomically; if it returns null, the packet was already handled by the periodic task.
  • Files changed: RedPacketManager.java (new removeAndGet), ChatListener.java, RainRedPacketManager.java

2. RedPacket.claim() race condition

  • Issue: When multiple threads claimed simultaneously, another thread could insert between claims.size() and amounts.get(index), causing duplicate allocation or index errors.
  • Fix: Added synchronized to the claim() method to ensure atomic claiming.
  • Files changed: RedPacket.java

3. RedPacket.tryUseClickClaim() redundant logic

  • Issue: Race condition between clickClaimed.contains() and clickClaimed.add(); ConcurrentHashMap.newKeySet().add() returns false when the element already exists.
  • Fix: Simplified to return clickClaimed.add(playerId), using the return value of add to determine first-time use.
  • Files changed: RedPacket.java

Файлы

RedPockets-v1.2.5.jar(127.25 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

v1.2.5

Загрузчики

Folia
Paper
Purpur

Версии игры

1.21–1.21.11

Загрузок

5

Дата публикации

1 мес. назад

Загрузил

ID версии

Главная