Skip to content

Add metadata to brawl game data#137

Merged
BetrixDev merged 5 commits intoreimaginedfrom
cursor/add-metadata-to-brawl-game-data-63c6
Sep 23, 2025
Merged

Add metadata to brawl game data#137
BetrixDev merged 5 commits intoreimaginedfrom
cursor/add-metadata-to-brawl-game-data-63c6

Conversation

@BetrixDev
Copy link
Owner

@BetrixDev BetrixDev commented Sep 21, 2025

Add and standardize metadata for Brawl abilities and passives, and update kit overrides to use the new metadata keys.


Open in Cursor Open in Web

Summary by CodeRabbit

  • New Features

    • Added user-configurable parameters for many abilities: block rotation speed, bone explosion (knockback/count/velocity), explosion knockback/velocity, milk spiral radius, and sulphur bomb projectile speed/size/trail.
    • Exposed new metadata options for abilities and passives to tune charge, damage, timing, movement, and particle effects.
  • Refactor

    • Consolidated and renamed configuration fields across abilities and passives.
    • Kits updated: regenRate replaced with healAmount.

…ent naming

Co-authored-by: rdbailey.dev <rdbailey.dev@gmail.com>
@cursor
Copy link

cursor bot commented Sep 21, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Sep 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
ssm-brawl-docs Error Error Sep 23, 2025 0:45am
ssm-brawl-web Error Error Sep 23, 2025 0:45am

@coderabbitai
Copy link

coderabbitai bot commented Sep 21, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Replaces hardcoded constants with metadata-driven properties across several abilities and passives, and updates YAML metadata (abilities, passives, kits) to expose or rename configuration fields used at runtime.

Changes

Cohort / File(s) Summary of Changes
Abilities: config-driven fields
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt, plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt, plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt, plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt, plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
Introduce private config properties read from metadata and replace hardcoded literals: block rotation step speed, bone explosion: knockback/count/velocity, explode: final velocity strength, milk spiral: particle radius, sulphur bomb: projectile velocity/size/trail particle count. All additions are private; no public signature changes.
Ability metadata
plugin/src/main/resources/data/abilities.yml
Add and rename multiple ability metadata keys (e.g., sulphur_bomb, explode, bone_explosion, roped_arrow, angry_herd, milk_spiral, blink, block_toss), exposing new configurable fields (velocities, sizes, counts, timings, knockback multipliers, etc.).
Kits metadata
plugin/src/main/resources/data/kits.yml
Rename regeneration key regenRatehealAmount for creeper, skeleton, cow, enderman within kit regeneration overrides. Numeric values unchanged.
Passives metadata
plugin/src/main/resources/data/passives.yml
Add/update passive metadata: double_jump motion tuning, hunger restore delay, regeneration heal config (healAmount, healIntervalTicks), arrow_recharge fields (hotbar slot, max arrows, interval), barrage charge/damage, and stampede stack-based timing fields replacing per-level model.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Player
  participant Ability as Ability (Kotlin)
  participant YAML as Config (abilities.yml)
  participant Engine as Game Engine

  Player->>Ability: Activate ability
  Ability->>YAML: Read metadata fields (radius, velocity, counts, timings)
  YAML-->>Ability: Return configured values
  Ability->>Engine: Spawn projectiles/particles, apply knockback/damage using values
  Engine-->>Player: Resulting effects (movement, damage, visuals)
  note right of Ability: Hardcoded literals replaced by metadata-driven values
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Gameplay, Feature

Poem

I nibble on YAML leaves so bright,
Knobs and numbers set just right.
Bones and bombs and spirals spin,
Config carrots tuck them in.
Hop—merge now, and watch them light! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add metadata to brawl game data" accurately and concisely summarizes the PR's main change—introducing and standardizing metadata across abilities, passives, and kits—as reflected in the modified YAML and Kotlin files, so a reviewer scanning history will understand the primary intent.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e0bc95 and db403bf.

📒 Files selected for processing (3)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt (3 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (2 hunks)
  • plugin/src/main/resources/data/abilities.yml (7 hunks)

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (12)
plugin/src/main/resources/data/passives.yml (1)

42-42: Add trailing newline.

File is missing a newline at EOF per yamllint.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt (1)

32-32: Add explicit type and surface the key in abilities.yml.

Follow the guideline to declare types and expose configurable keys publicly.

Apply:

-    private val explosionVelocityStrength = metadata.double("explosionVelocityStrength") ?: 1.8
+    private val explosionVelocityStrength: Double =
+        metadata.double("explosionVelocityStrength") ?: 1.8

Also add explosionVelocityStrength to abilities.yml under explode.metadata with default 1.8.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt (2)

16-19: Add explicit types and document keys.

Declare types and add these keys to YAML to keep all tunables visible.

-    private val explosionKnockbackMultiplier =
-        metadata.double("explosionKnockbackMultiplier") ?: 2.5
-    private val explosionBoneCount = metadata.int("explosionBoneCount") ?: 48
-    private val explosionBoneVelocity = metadata.double("explosionBoneVelocity") ?: 0.8
+    private val explosionKnockbackMultiplier: Double =
+        metadata.double("explosionKnockbackMultiplier") ?: 2.5
+    private val explosionBoneCount: Int = metadata.int("explosionBoneCount") ?: 48
+    private val explosionBoneVelocity: Double = metadata.double("explosionBoneVelocity") ?: 0.8

In abilities.yml > bone_explosion.metadata, add:

  • explosionKnockbackMultiplier: 2.5
  • explosionBoneCount: 48
  • explosionBoneVelocity: 0.8

25-33: Consider externalizing effect duration (40 ticks).

Make the particle/effect lifetime configurable (e.g., effectLifetimeTicks) for parity with other tunables.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt (1)

21-21: Add explicit type and YAML key for radius.

Keep types explicit and surface the visual radius in YAML.

-    private val particleSpiralRadius = metadata.double("particleSpiralRadius") ?: 1.5
+    private val particleSpiralRadius: Double =
+        metadata.double("particleSpiralRadius") ?: 1.5

Add particleSpiralRadius: 1.5 to abilities.yml > milk_spiral.metadata.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (1)

24-27: Types + bounds for projectile tunables; add YAML entries.

Declare types and clamp to safe ranges to avoid visual/perf spikes.

-    private val projectileVelocityMultiplier =
-        metadata.double("projectileVelocityMultiplier") ?: 1.55
-    private val projectileSize = metadata.double("projectileSize") ?: 0.65
-    private val projectileTrailMaxParticles = metadata.int("projectileTrailMaxParticles") ?: 8
+    private val projectileVelocityMultiplier: Double =
+        metadata.double("projectileVelocityMultiplier") ?: 1.55
+    private val projectileSize: Double =
+        (metadata.double("projectileSize") ?: 0.65).coerceAtLeast(0.1)
+    private val projectileTrailMaxParticles: Int =
+        (metadata.int("projectileTrailMaxParticles") ?: 8).coerceIn(0, 32)

Add to abilities.yml > sulphur_bomb.metadata:

  • projectileVelocityMultiplier: 1.55
  • projectileSize: 0.65
  • projectileTrailMaxParticles: 8
plugin/src/main/resources/data/abilities.yml (6)

9-11: Expose all sulphur_bomb tunables referenced in code.

Add the missing metadata keys so operators can tune without code changes.

     metadata:
       projectileKnockbackModifier: 2.5
       projectileDamage: 6.5
+      projectileVelocityMultiplier: 1.55
+      projectileSize: 0.65
+      projectileTrailMaxParticles: 8

20-23: Add explode velocity strength to metadata.

Keep parity with ExplodeAbility.

     metadata:
       fuseTimeTicks: 30
       explosionRadius: 8.0
       explosionKnockbackMultiplier: 2.5
+      explosionVelocityStrength: 1.8

32-34: Bone explosion: include all new keys.

Reflect new tunables used by the ability.

     metadata:
       explosionRadius: 7.0
       baseDamage: 6.0
+      explosionKnockbackMultiplier: 2.5
+      explosionBoneCount: 48
+      explosionBoneVelocity: 0.8

73-79: Add particleSpiralRadius to milk_spiral.

Make the visual radius adjustable in YAML to match code usage.

     metadata:
       spiralDurationMs: 3000
       velocityDurationMs: 1800
       hitboxRadius: 2.0
       damage: 5.0
       maxTimesHit: 2
       damageCooldownMs: 250
+      particleSpiralRadius: 1.5

98-102: Add block rotation step speed to block_toss.

Surface the tick step for the display animation.

     metadata:
       chargeTimeMs: 1200
       maxCharge: 1.4
       maxDamage: 9.0
       damage: 8.0
       knockbackMultiplier: 2.5
+      blockRotationStepSpeedTicks: 4

102-102: Add trailing newline.

File is missing a newline at EOF per yamllint.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d49a973 and 7e0bc95.

📒 Files selected for processing (8)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt (3 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt (2 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt (2 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt (2 hunks)
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (2 hunks)
  • plugin/src/main/resources/data/abilities.yml (7 hunks)
  • plugin/src/main/resources/data/kits.yml (4 hunks)
  • plugin/src/main/resources/data/passives.yml (1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/kotlin-best-practices.mdc)

**/*.kt: Use data classes for immutable data structures like PlayerDocument
Leverage extension functions to enhance existing classes without modifying them
Implement sealed classes for representing different states or types (e.g., game states or player statuses)
Use coroutines for asynchronous operations to avoid blocking the main thread
Use Koin for dependency injection
Use LiteCommands for commands
Use Twilight for events
Use Ktor for HTTP requests
Use Kaml for configuration
Use Okio for file operations
Use Kotlinx Coroutines for asynchronous operations
Use Kotlinx Serialization for serialization
Use English for all code and documentation in source (identifiers, comments, KDoc)
Always declare the type of each variable and function (parameters and return value)
Avoid using any
Create necessary types instead of using overly generic structures
Use PascalCase for classes
Avoid magic numbers and define constants
Start each function with a verb
Use verbs for boolean variables (isLoading, hasError, canDelete, etc.)
Use complete words instead of abbreviations and correct spelling (allow standard ones like API, URL)
Allow well-known abbreviations: i, j for loops; err for errors; ctx for contexts; req, res, next for middleware-like parameters
Write short functions with a single purpose (less than 20 instructions)
Name functions with a verb plus a descriptor
If a function returns boolean, use prefixes like isX, hasX, canX
If a function returns Unit, use prefixes like executeX or saveX
Avoid nesting blocks via early returns, extracting utilities, and using higher-order functions (map, filter, reduce)
Use expression-bodied (arrow-style) functions for simple functions (fewer than 3 instructions)
Use named (block-bodied) functions for non-simple functions
Use default parameter values instead of checking for null
Reduce function parameters using RO-RO (pass/return objects)
Declare necessary types for input arguments and output
Use a single level of abstraction within functions
...

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
plugin/src/main/kotlin/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

plugin/src/main/kotlin/**/*.kt: Handle events using the Twilight library’s event DSL
Use Manageable class/IManageable interface to store and manage event listeners

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/**/*.kt

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Implement abilities by extending BrawlAbility and manage cooldown/usage via the base class

Files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
plugin/src/main/resources/data/{abilities,disguises,maps,kits,minigames,passives,projectiles,theme}.yml

📄 CodeRabbit inference engine (.cursor/rules/plugin-overview.mdc)

Keep core Brawl configuration in YAML files under plugin/src/main/resources/data with fixed filenames

Files:

  • plugin/src/main/resources/data/passives.yml
  • plugin/src/main/resources/data/kits.yml
  • plugin/src/main/resources/data/abilities.yml
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
Learning: Applies to plugin/src/main/resources/data/{abilities,disguises,maps,kits,minigames,passives,projectiles,theme}.yml : Keep core Brawl configuration in YAML files under plugin/src/main/resources/data with fixed filenames
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/**/*.kt : Implement abilities by extending BrawlAbility and manage cooldown/usage via the base class

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/projectiles/**/*.kt : Implement projectiles by extending BrawlProjectile and ensure correct lifecycle/metadata for smooth gameplay

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
Learning: Applies to plugin/src/main/resources/data/{abilities,disguises,maps,kits,minigames,passives,projectiles,theme}.yml : Keep core Brawl configuration in YAML files under plugin/src/main/resources/data with fixed filenames

Applied to files:

  • plugin/src/main/resources/data/abilities.yml
📚 Learning: 2025-09-22T00:09:59.268Z
Learnt from: CR
PR: BetrixDev/ssm-brawl#0
File: .cursor/rules/plugin-overview.mdc:0-0
Timestamp: 2025-09-22T00:09:59.268Z
Learning: Applies to plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/passives/**/*.kt : Implement passives by extending BrawlPassive and define metadata in the base construct

Applied to files:

  • plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt
🪛 YAMLlint (1.37.1)
plugin/src/main/resources/data/passives.yml

[error] 42-42: no new line character at the end of file

(new-line-at-end-of-file)

plugin/src/main/resources/data/abilities.yml

[error] 102-102: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (14)
plugin/src/main/resources/data/kits.yml (1)

29-29: Rename to healAmount is consistent with passives.yml.

Looks good and aligns with the new regeneration metadata key.

Please confirm the regeneration passive implementation reads healAmount (not regenRate) to avoid silent defaults.

Also applies to: 55-55, 84-84, 109-109

plugin/src/main/resources/data/passives.yml (6)

4-8: Double-jump tuning metadata added correctly.

Good externalization of motion params.


12-13: Time unit check (ms vs ticks).

Confirm hungerRestoreDelayMs is consumed as milliseconds across the codebase.


17-19: Regeneration keys look good.

healAmount and healIntervalTicks read cleanly.

Please verify the passive uses healIntervalTicks (not ms) for timing.


25-27: Arrow recharge defaults adjusted.

New fields read well; skeleton kit override to 60 ticks still applies.


32-34: Barrage metadata externalized.

Looks consistent.


40-42: Stampede stacking config looks sensible.

Nice consolidation.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/ExplodeAbility.kt (1)

141-141: Sanity-check setVelocity param order.

Confirm the extension signature matches (x, y, z, multiplyByLookDirection: Boolean) (or equivalent) so only the X component is metadata-driven as intended.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt (1)

141-141: Rotation runnable uses new step speed correctly.

Interval and interpolation duration are wired to the metadata; looks good.

Also applies to: 144-144, 169-169

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BoneExplosionAbility.kt (1)

51-51: Knockback multiplier usage is correct.

Good replacement of hardcoded value.

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/MilkSpiralAbility.kt (1)

71-79: Radius substitution is correct.

Both arc computations now use the configurable radius.

Also applies to: 82-89

plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/SulphurBombAbility.kt (1)

51-53: Projectile builder now uses metadata.

Nice removal of hardcoded values.

plugin/src/main/resources/data/abilities.yml (2)

43-45: Roped arrow defaults look good.

Velocity and damage are publicly configurable.


55-63: Angry herd metadata set looks consistent.

Clear, self-descriptive field names.

private val maxDamage = metadata.double("maxDamage") ?: 9.0
private val damage = metadata.double("damage") ?: 8.0
private val knockbackMultiplier = metadata.double("knockbackMultiplier") ?: 2.5
private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Clamp step speed and add explicit type.

Avoid 0/negative scheduling and follow explicit-type guideline.

-    private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4
+    private val blockRotationStepSpeedTicks: Int =
+        (metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1)

Expose blockRotationStepSpeedTicks in abilities.yml under block_toss.metadata with default 4.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
private val blockRotationStepSpeedTicks = metadata.int("blockRotationStepSpeedTicks") ?: 4
private val blockRotationStepSpeedTicks: Int =
(metadata.int("blockRotationStepSpeedTicks") ?: 4).coerceAtLeast(1)
🤖 Prompt for AI Agents
In
plugin/src/main/kotlin/dev/betrix/superSmashMobsBrawl/abilities/BlockTossAbility.kt
around line 32, the property declaration uses inferred type and can be
zero/negative; change it to an explicit Int and clamp the value so it is at
least 1 (e.g., val blockRotationStepSpeedTicks: Int = max(1,
metadata.int("blockRotationStepSpeedTicks") ?: 4)) to prevent 0/negative
scheduling and keep default 4. Also update abilities.yml to expose
blockRotationStepSpeedTicks under block_toss.metadata with default: 4 and a
brief description.

@BetrixDev BetrixDev merged commit 7a56a1c into reimagined Sep 23, 2025
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants