
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
226
3
Список изменений
[2.0.5] - 2026-04-26
Added
AttachmentApplyEvent and AttachmentRemoveEvent — Developer API
- Two new cancellable events fire when a player attaches or removes an attachment from a gun.
AttachmentApplyEvent— fired beforefitAttachment()writes the PDC key. ProvidesgetPlayer(),getGunData(),getIncoming()(attachment being fitted), andgetReplacedAttachment()(previously occupied slot, ornull). Cancellable — cancel to block the attachment action.AttachmentRemoveEvent— fired beforeremoveAttachment()clears the PDC key. ProvidesgetPlayer(),getGunData(),getSlot(), andgetRemoved()(the attachment being stripped). Cancellable — cancel to block the removal.AttachmentManager.fitAttachment(Player, ItemStack, GunData, String)— new overload that fires the apply event. The no-player overload is retained for internal use.AttachmentManager.removeAttachment(Player, ItemStack, GunData, AttachmentType)— new overload that fires the remove event.- Example use-cases: locking legendary weapons from modification, auto-returning detached attachments to the player's inventory, logging equipment changes, restricting attachments in specific regions.
DamageCalculator — Centralised Damage Math Utility
- New
util/DamageCalculator.javaextracts all damage-pipeline calculations fromGunListener, making them independently testable and accessible to add-on plugins. - Static methods:
baseDamage(GunData, double eventMult)— gun damage × projectile multiplier × event multiplier.falloffMultiplier(GunData, double dist)— linear range-based damage reduction fromdamageFalloffStartto min floor.headshotMultiplier(GunData, boolean headshot)— returnsheadshotMultiplieror1.0.finalDamage(GunData, double dist, boolean headshot, double eventMult)— full pipeline in one call.isHeadshot(double hitY, double baseY, double height, boolean crouching)— single source of truth for headshot detection, accounting for crouch state.effectiveSpread(GunData, double scopeSpread, boolean scoped, boolean ads, double moveMult)— spread value for all fire modes.pelletSpread(double baseSpread, boolean multiPellet)— per-pellet spread for shotguns.
- Named constants:
HEAD_ZONE_START(0.80),CROUCH_FACTOR(0.85),SHOTGUN_SPREAD_FACTOR(1.45) — previously magic numbers scattered acrossGunListener. GunListenernow delegates all damage math and spread calculations toDamageCalculator. The privatecomputeFalloffMultiplier()method has been removed (logic moved toDamageCalculator.falloffMultiplier()).
StatsManager — Per-Kill Detail Log (kills_by_gun_detail table)
- New SQLite table
kills_by_gun_detailadded via schema migration v3. Stores one row per kill withuuid,gun_id,headshotflag, and Unixtimestamp(ms). - Enables future features: per-weapon leaderboards, session-based kill analytics, and season resets that preserve historical totals in the detail log while zeroing the aggregate counters.
- Two covering indexes (
idx_kbgd_uuid,idx_kbgd_gun) ensure per-player and per-weapon queries stay fast as the table grows. - Schema migration runs automatically on first startup of 2.0.5 — no manual SQL required.
GunCommand — Season Reset and Per-Player Stats Reset
/gun statsreset <player>— resets kills, deaths, headshots, gun kills, and detail records for a single online player. Wipes the in-memory buffer and schedules async DB deletes across all three stat tables./gun seasonreset confirm— resets ALL players' stats (requires the literalconfirmargument as a safeguard against accidental use). Clears the in-memory buffer and truncatesplayer_stats,gun_kills, andkills_by_gun_detailin a single transaction. Prints a gold confirmation message on success.- Both commands require
combatgun.adminpermission. - Both commands fail gracefully with a clear error if
StatsManageris disabled (SQLite unavailable).
Improved
GunListener — God Class Reduction
performShot()spread logic (previously a three-branchif/else if/elseblock) replaced with a singleDamageCalculator.effectiveSpread()call.applyEntityDamage()damage calculation (previously inline) replaced withDamageCalculator.finalDamage()andDamageCalculator.baseDamage().isHeadshot()private method now delegates entirely toDamageCalculator.isHeadshot()— single source of truth for headshot geometry.- Removed
computeFalloffMultiplier()private method (~7 lines) — logic now lives inDamageCalculator.
StatsManager — Schema Version Bumped to 3
SCHEMA_VERSIONconstant updated from2to3.recordKill()now passes theheadshotflag toincrementGunKill()so both the aggregategun_killstable and the newkills_by_gun_detailtable are updated in one async task.resetStats(UUID)now also deletes fromkills_by_gun_detailin addition toplayer_statsandgun_kills.resetAllStats()truncates all three stat tables in a single transaction.
Файлы
CombatGunSSS-2.0.5.jar(12.92 MiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
2.0.5
Загрузчики
BukkitPaperPurpurSpigot
Версии игры
1.21–1.21.11
Загрузок
46
Дата публикации
1 нед. назад
