
CombatGunSSS
Adds 45 unique guns to Minecraft, each with custom damage, recoil, fire rate, and reload mechanics, enhancing combat with balanced gameplay, multiple weapon types, and flexible customization for varied playstyles
676
4
Список изменений
[2.0.6] - 2026-05-14
Fixed
🔴 GunListener.isFriendlyFire() — Scoreboard team detection using wrong scoreboard (Critical)
- Root cause:
shooter.getScoreboard()andtargetPlayer.getScoreboard()return each player's personal scoreboard view, which may differ between players when a scoreboard plugin assigns individual views. Team membership is defined on the main scoreboard, so using a personal scoreboard could returnnulleven when both players are on the same team — or vice versa, allowing players to bypass friendly-fire restrictions. - Fix: Replaced both
player.getScoreboard()calls with a singleBukkit.getScoreboardManager().getMainScoreboard()lookup. Team membership is now always evaluated against the authoritative server scoreboard.
🔴 GunListener — Memory leak in recentDamage map (Critical)
- Root cause:
recentDamageentries were only evicted bypruneRecentDamage(), which runs after each shot. Players who disconnected (crash,/kick, network drop) or died without triggering a subsequent shot by another player left staleDamageRecordentries in the map indefinitely, growing unbounded on long-running servers. - Fix: Added
recentDamage.remove(p.getUniqueId())to bothonQuit()andonDeath()event handlers, ensuring entries are cleaned up immediately when a player leaves or dies — in addition to the existing TTL-based pruning.
🟡 GunListener — Shared static Random causes thread contention and predictable spread (Medium)
- Root cause:
private static final Random RANDOM = new Random()is shared across all usages ofGunListener. Java'sRandomis thread-safe via internal synchronization, which causes lock contention when multiple players fire simultaneously, and its LCG algorithm produces correlated sequences when called rapidly — making bullet spread slightly predictable. - Fix: Replaced the shared field with a private helper
rng()that returnsThreadLocalRandom.current(). Each thread gets its own independent, higher-quality RNG with zero contention. All threeRANDOM.nextDouble()call sites updated torng().nextDouble().
🟡 StatsManager — Unsynchronized async DB access on shared connection (Medium)
- Root cause:
flushBuffer()issynchronizedon theStatsManagerinstance, butincrementGunKill()andgetGunKills()— both called from async tasks — are not. All three methods share the same JDBCConnection. Concurrent execution offlushBuffer()andincrementGunKill()could interleave SQL transactions, causingSQLITE_BUSYerrors, corrupted auto-commit state, or inconsistent read results ingetGunKills(). - Fix: Marked both
incrementGunKill()andgetGunKills()assynchronized. All three DB-touching methods now synchronize on the same monitor (theStatsManagerinstance), serializing access to the sharedconnectionwithout requiring a connection pool.
Метаданные
Канал релиза
Release
Номер версии
2.0.6
Загрузчики
BukkitPaperPurpurSpigot
Версии игры
1.21–1.21.11
Загрузок
68
Дата публикации
1 мес. назад

