
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
124
3
Список изменений
[2.0.3] - 2026-04-18
Fixed
🔴 AmmoPouchManager.unpackPouch() — Pouch lost when inventory is full (Critical)
- Root cause: When partially unpacking (only a few slots left in inventory), the code always called
pouch.setAmount(0)regardless of how many bullets were actually transferred. The entire pouch was destroyed even if bullets remained inside. - Fix: If
remaining > 0(unpack not completed), update the PDCpouch_quantityto the remaining amount and refresh the lore instead of destroying the pouch. Only callsetAmount(0)when all bullets have been successfully transferred.
🔴 ReloadManager — Reload task running every 1 tick causing high CPU usage (Critical)
- Root cause:
runTaskTimer(plugin, 0L, 1L)scheduled 20 times per second for every player reloading. With 10 players reloading simultaneously, this resulted in 200 task calls per second just for the progress bar. - Fix: Changed to
runTaskTimer(plugin, 0L, 2L)and adjustedtotalTicks = reloadTime * 10.0so reload duration remains unchanged. This reduces reload system CPU load by approximately 50%.
🔴 GunListener.isHeadshot() — Inaccurate headshots while player is crouching (Critical)
- Root cause: Used fixed
entity.getHeight() * 0.8without accounting for crouching players (hitbox shrinks to ~1.5 blocks instead of 1.8). - Fix: Detect
player.isSneaking()and multiplyheight *= 0.85before calculating headY threshold. Headshot detection is now accurate for both standing and crouching states.
🔴 CraftingManager.craftFromStation() — No rollback when crafting fails (Critical)
- Root cause:
consumeIngredients()ran beforecreateResultItem(). IfcreateResultItem()returnednull(invalid gun ID, config error, etc.), ingredients were consumed but no item was given → permanent item loss. - Fix: Snapshot all input slots before consuming. If
createResultItem()returnsnull, restore ingredients from the snapshot.
🟡 GunListener.applyRecoil() — Potential NPE when AntiCheatHook is disabled (Medium)
- Root cause:
if (hm2 != null) hm2.getAntiCheatHook().exempt(player)— checkedhm2but notgetAntiCheatHook(). If the hook was disabled,getAntiCheatHook()could return an uninitialized instance. - Fix: Added full guard:
hm2 != null && hm2.getAntiCheatHook() != null && hm2.getAntiCheatHook().isActive()before callingexempt().
🟡 BleedingManager — Incorrect damage during server lag (Medium)
- Root cause: Task used
elapsed += 20to count ticks, but when the server lagged (>50ms per tick), actual damage was lower than the configureddamage_per_second. - Fix: Switched to
System.currentTimeMillis()for real-time tracking.lastDamageTimeis now updated only when damage is actually applied, ensuring exactly 1 second between damage ticks regardless of server lag.
🟡 CraftingManager.consumeIngredients() — Incorrect null-check order (Medium)
- Root cause:
identifyIngredient(item)was called before checkingitem == null, causing potential NPE with empty inventory slots in some edge cases. - Fix: Moved
if (item == null || item.getType().isAir()) continue;before callingidentifyIngredient().
🟡 GunListener.onItemHeldChange() — Race condition when switching slots rapidly (Medium)
- Root cause: Task with 0-tick delay read
getItemInMainHand()— if the player switched slots again before the task ran, it would process the wrong slot's item. - Fix: Store
newSlot = event.getNewSlot()before scheduling the task. Inside the task, checkplayer.getInventory().getHeldItemSlot() != newSlotand abort if the player has switched slots again.
Файлы
CombatGunSSS-2.0.3.jar(12.91 MiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
2.0.3
Загрузчики
PaperPurpur
Версии игры
1.21–1.21.11
Загрузок
8
Дата публикации
вчера
