Repository navigation
Add staff command to give assembled guns - #30
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (9)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughAdds ChangesGun-giving command
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Staff
participant GgCommand
participant GunGiveCommand
participant InventoryManager
participant Recipient
Staff->>GgCommand: Run /gg give
GgCommand->>GunGiveCommand: Execute command
GunGiveCommand->>GunGiveCommand: Check permission and validate recipient, gun, and parts
GunGiveCommand->>InventoryManager: Build gun
InventoryManager-->>GunGiveCommand: Return item
GunGiveCommand->>Recipient: Add item to inventory
GunGiveCommand-->>Staff: Send delivery confirmation
Merge Risk: ⚪ Minimal · up to No confirmed issue blocks merging after normal checks. The deployed item templates’ stack sizes remain unverified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The grant permission is enforced independently of reload and refresh, with validation before inventory delivery. No authorization bypass was established. Deployed permission assignments and the guarantee that configured templates produce exactly one unloaded gun remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
Comment |
Adds
/gg give <player> <rifle|pistol|shotgun|launcher> <part> [part...]to deliver an assembled, unloaded gun using the normal stats, skin and provenance builder. Validates enabled compatible parts, one part per required category, class compatibility and inventory space. Spawned guns record zero crafting cost.give-permissiondefaults togunsandgadgets.giveand supports a custom staff node; blank disables giving. Reload and refresh retain their existing permission checks, while the root command no longer blocks staff with only the configured give permission. Includes completion, documentation and command tests.Validation: full unit suite plus targeted command tests pass; JaCoCo reports zero missed instructions, branches or lines and the configured coverage check passes. CI clean verify passed.
On TFMCDev01 (Paper 1.21.10 / Java 21), CI artifact DEV-20261004-0804 loaded successfully. In-game smoke checks passed permission denial, give permission without reload permission, invalid part rejection and delivery of Rifle, Pistol, Shotgun and Launcher. Inspected item data includes gun type, identity and zero-cost provenance. Test items and temporary permission grants were removed.