Skip to content

Conversation

Marten-Mrfc
Copy link
Collaborator

@Marten-Mrfc Marten-Mrfc commented Jul 25, 2025

For now please keep this PR open so I can later add more (:

If someone has more entity ideas please say so.

Summary by CodeRabbit

  • New Features

    • Added camel, donkey, pig, goat, panda, polar bear, and sniffer entities with unique appearances, sounds, and spawnable instances.
    • Added panda gene support for customizable genetics and a panda pose system (multiple poses and timers).
  • Documentation

    • Added a guided "NewEntity" chat mode and detailed contributor instructions for consistently adding new entities.

@Copilot Copilot AI review requested due to automatic review settings July 25, 2025 07:14
Copy link
Contributor

coderabbitai bot commented Jul 25, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds multiple new Minecraft-like entity definition and instance entries (Camel, Donkey, Pig, Goat, Panda, Polar Bear, Sniffer), panda-specific entity data (genes and poses), and documentation/chatmode instructions for adding entities. Wrapper runtime classes apply ageable, generic, living, and entity-specific properties.

Changes

Cohort / File(s) Change Summary
Entity definitions & wrappers
.../entity/entries/entity/minecraft/CamelEntity.kt, .../DonkeyEntity.kt, .../PigEntity.kt, .../GoatEntity.kt, .../PandaEntity.kt, .../PolarBearEntity.kt, .../SnifferEntity.kt
Added SimpleEntityDefinition and SimpleEntityInstance entries for each entity plus private WrapperFakeEntity runtime classes. Each wrapper overrides property application to handle AgeableProperty and to delegate to generic/living/entity-specific data appliers.
Panda data — genes & poses
.../entity/entries/data/minecraft/living/panda/PandaGeneData.kt, .../panda/PandaPoseData.kt
Added PandaGeneData and PandaPoseData entries, their property types (PandaGeneProperty, PandaPoseProperty, PandaPose enum), and apply helper functions to set PandaMeta fields (genes, poses, timers).
Documentation & chatmode
.github/chatmodes/NewEntity.chatmode.md, .github/instructions/entity-extension.add-entity.instructions.md, .github/instructions/entity-extension.instructions.md
Added a guided chat mode and two detailed instruction documents describing the process and conventions for adding new entities to the Entity Extension.

Sequence Diagram(s)

sequenceDiagram
    participant Player
    participant EntityDefinition
    participant WrapperFakeEntity
    participant EntityDataAppliers

    Player->>EntityDefinition: create(player)
    EntityDefinition->>WrapperFakeEntity: instantiate wrapper for player
    WrapperFakeEntity->>WrapperFakeEntity: spawn / hold viewers / metadata
    WrapperFakeEntity->>EntityDataAppliers: applyProperty(property)
    EntityDataAppliers->>WrapperFakeEntity: apply ageable / generic / living / entity-specific metadata
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

codex

Suggested reviewers

  • gabber235

Poem

🐇 A hop for code, a nibble of bliss,
New camels, pigs, and a panda's kiss.
Donkeys, goats, bears stand in a row,
Sniffers sniff where soft winds blow.
Kotlin carrots and metadata cheer—hooray! 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch features/entities

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copilot

This comment was marked as outdated.

Copy link
Contributor

@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8192fe1 and 7492d65.

📒 Files selected for processing (3)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/CamelEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/DonkeyEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PigEntity.kt (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/DonkeyEntity.kt (2)

31-40: LGTM! Well-structured entity definition.

The DonkeyDefinition class follows the established pattern with proper annotations, type restrictions, and default values.


42-51: LGTM! Consistent entity instance implementation.

The DonkeyInstance class properly implements SimpleEntityInstance with appropriate property defaults and tag restrictions.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/CamelEntity.kt (2)

31-51: LGTM! Consistent entity definition and instance implementation.

Both CamelDefinition and CamelInstance classes follow the established patterns with proper annotations, type restrictions, and default values.


56-63: LGTM! Proper entity property handling implementation.

The applyProperty method correctly handles AgeableProperty explicitly before applying generic and living entity data. This is the proper pattern for ageable entities.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PigEntity.kt (2)

31-51: LGTM! Consistent entity definition and instance implementation.

Both PigDefinition and PigInstance classes follow the established patterns with proper annotations, type restrictions, and default values.


56-63: LGTM! Consistent entity property handling implementation.

The applyProperty method correctly handles AgeableProperty explicitly before applying generic and living entity data, maintaining consistency with the CamelEntity implementation.

@Marten-Mrfc Marten-Mrfc requested a review from Copilot July 25, 2025 07:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds three new animal entities (camel, donkey, and pig) to the EntityExtension, expanding the available Minecraft entities that can be created and managed within the game environment.

  • Introduces three new entity types with corresponding definition and instance classes
  • Each entity follows the same pattern with ageable properties and standard entity data support
  • Provides consistent API for creating and managing camel, donkey, and pig entities

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
CamelEntity.kt Adds camel entity with ageable properties and camel-specific data tags
DonkeyEntity.kt Adds donkey entity with basic living entity properties and donkey-specific data tags
PigEntity.kt Adds pig entity with ageable properties and pig-specific data tags

Copy link
Contributor

@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: 2

🧹 Nitpick comments (15)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (2)

29-34: Provide a default to SinglePropertyCollectorSupplier for consistency

Many data entries supply a default property via the supplier. Consider adding one for predictable aggregation.

Apply this diff:

 data class PandaGeneProperty(
     val mainGene: PandaMeta.Gene,
     val hiddenGene: PandaMeta.Gene,
 ) : EntityProperty {
-    companion object : SinglePropertyCollectorSupplier<PandaGeneProperty>(PandaGeneProperty::class)
+    companion object : SinglePropertyCollectorSupplier<PandaGeneProperty>(
+        PandaGeneProperty::class,
+        PandaGeneProperty(PandaMeta.Gene.NORMAL, PandaMeta.Gene.NORMAL)
+    )
 }

13-13: Avoid star import from java.util

Prefer explicitly importing Optional for clarity and to prevent namespace pollution.

-import java.util.*
+import java.util.Optional
.github/chatmodes/NewEntity.chatmode.md (3)

44-46: Fix bare URL formatting (MD034)

Wrap the URL to satisfy markdownlint.

-   - Search https://github.com/Tofaa2/EntityLib/tree/master/api/src/main/java/me/tofaa/entitylib/meta
+   - Search <https://github.com/Tofaa2/EntityLib/tree/master/api/src/main/java/me/tofaa/entitylib/meta>

73-77: Include mob_data in OnlyTags guidance

Entity files in this PR (e.g., Sniffer/Panda) include mob_data. Reflect that here.

-   - Ensure `@OnlyTags` includes: `generic_entity_data`, optionally `living_entity_data`, plus `<entity>_data`.
+   - Ensure `@OnlyTags` includes: `generic_entity_data`, `mob_data` (for mobs), optionally `living_entity_data`, plus `<entity>_data`.

96-101: Clarify “no new data files” constraint scope

Make it explicit this constraint is specific to this guided mode (not a repo-wide rule), to avoid confusion since the PR adds Panda-specific data.

- - Prefer reusing existing data entries before adding new ones.
+ - Prefer reusing existing data entries before adding new ones.
+ - Note: “No new data files” is a constraint of this guided mode to reduce churn. Maintainers may still add new data entries outside this mode when necessary.
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SnifferEntity.kt (1)

59-66: Short-circuit after handling AgeableProperty

Minor perf/readability: return immediately after applying a matched property to avoid extra checks.

 override fun applyProperty(property: EntityProperty) {
-    when (property) {
-        is AgeableProperty -> applyAgeableData(entity, property)
-        else -> {}
-    }
-    if (applyGenericEntityData(entity, property)) return
-    if (applyLivingEntityData(entity, property)) return
+    when (property) {
+        is AgeableProperty -> { applyAgeableData(entity, property); return }
+    }
+    if (applyGenericEntityData(entity, property)) return
+    if (applyLivingEntityData(entity, property)) return
 }
.github/instructions/entity-extension.add-entity.instructions.md (3)

14-15: Wrap bare URL to satisfy MD034

Use angle brackets or link syntax.

-Upstream library: https://github.com/Tofaa2/EntityLib/tree/master/api/src/main/java/me/tofaa/entitylib/meta
+Upstream library: <https://github.com/Tofaa2/EntityLib/tree/master/api/src/main/java/me/tofaa/entitylib/meta>

50-51: Include mob_data in OnlyTags example

Entities in this PR use mob_data. Reflect this in the instruction.

-- Constrain `data` with `@OnlyTags("generic_entity_data", "living_entity_data", "<entity>_data")` where applicable.
+- Constrain `data` with `@OnlyTags("generic_entity_data", "mob_data", "living_entity_data", "<entity>_data")` where applicable.

21-22: Optional wording tweak

“Brief description” reads cleaner than “short description.”

-- A short description, an icon id, and a color from `Colors`.
+- A brief description, an icon id, and a color from `Colors`.
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (2)

48-56: Short-circuit after applying specific properties

After handling PandaGeneProperty or AgeableProperty, return to avoid unnecessary route checks.

 private class PandaEntity(player: Player) : WrapperFakeEntity(EntityTypes.PANDA, player) {
     override fun applyProperty(property: EntityProperty) {
         when (property) {
-            is PandaGeneProperty -> applyPandaGeneData(entity, property)
-            is AgeableProperty -> applyAgeableData(entity, property)
+            is PandaGeneProperty -> { applyPandaGeneData(entity, property); return }
+            is AgeableProperty -> { applyAgeableData(entity, property); return }
         }
         if (applyGenericEntityData(entity, property)) return
         if (applyLivingEntityData(entity, property)) return
     }
 }

48-56: Optional: Document skipped panda fields for parity

Add a short “Skipped data” block (like Sniffer) if any PandaMeta fields aren’t exposed due to missing data entries.

Example to append at end of file:

// Skipped data (no existing data entry available):
// - Panda: isSneezing / isSitting / isOnBack (if applicable in PandaMeta)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/GoatEntity.kt (2)

28-36: Doc says generic/living/ageable, but OnlyTags also includes mob_data

The KDoc states support for generic, living, and ageable data, but Line 35 also allows "mob_data". Either update the KDoc to reflect mob support (if implemented), or drop "mob_data" from OnlyTags as in the previous comment.


59-66: Micro-optimization: return early after handling AgeableProperty

After applying AgeableProperty, you can return immediately to avoid the subsequent checks.

     override fun applyProperty(property: EntityProperty) {
-        when (property) {
-            is AgeableProperty -> applyAgeableData(entity, property)
-            else -> {}
-        }
+        when (property) {
+            is AgeableProperty -> {
+                applyAgeableData(entity, property)
+                return
+            }
+        }
         if (applyGenericEntityData(entity, property)) return
         if (applyLivingEntityData(entity, property)) return
     }
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PolarBearEntity.kt (2)

28-36: KDoc vs OnlyTags: document mob support or remove the tag

KDoc lists generic/living/ageable only, but OnlyTags includes "mob_data". Align either the documentation or the allowed tags.


59-66: Return early after AgeableProperty for efficiency and clarity

Same micro-optimization as Goat entity.

     override fun applyProperty(property: EntityProperty) {
-        when (property) {
-            is AgeableProperty -> applyAgeableData(entity, property)
-            else -> {}
-        }
+        when (property) {
+            is AgeableProperty -> {
+                applyAgeableData(entity, property)
+                return
+            }
+        }
         if (applyGenericEntityData(entity, property)) return
         if (applyLivingEntityData(entity, property)) return
     }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b8ed5b and 36dbd4a.

📒 Files selected for processing (11)
  • .github/chatmodes/NewEntity.chatmode.md (1 hunks)
  • .github/instructions/entity-extension.add-entity.instructions.md (1 hunks)
  • .github/instructions/entity-extension.instructions.md (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/CamelEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/DonkeyEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/GoatEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PigEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PolarBearEntity.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SnifferEntity.kt (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/instructions/entity-extension.instructions.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/DonkeyEntity.kt
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/CamelEntity.kt
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PigEntity.kt
🧰 Additional context used
🧬 Code Graph Analysis (5)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/GoatEntity.kt (4)
engine/engine-core/src/main/kotlin/com/typewritermc/core/entries/EntryReference.kt (1)
  • emptyRef (6-6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/AgeableData.kt (1)
  • applyAgeableData (38-46)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/GenericData.kt (1)
  • applyGenericEntityData (9-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/LivingData.kt (1)
  • applyLivingEntityData (7-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SnifferEntity.kt (4)
engine/engine-core/src/main/kotlin/com/typewritermc/core/entries/EntryReference.kt (1)
  • emptyRef (6-6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/AgeableData.kt (1)
  • applyAgeableData (38-46)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/GenericData.kt (1)
  • applyGenericEntityData (9-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/LivingData.kt (1)
  • applyLivingEntityData (7-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (1)
engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/command/dsl/TypewriterDsl.kt (1)
  • error (21-23)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (5)
engine/engine-core/src/main/kotlin/com/typewritermc/core/entries/EntryReference.kt (1)
  • emptyRef (6-6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (1)
  • applyPandaGeneData (36-44)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/AgeableData.kt (1)
  • applyAgeableData (38-46)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/GenericData.kt (1)
  • applyGenericEntityData (9-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/LivingData.kt (1)
  • applyLivingEntityData (7-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PolarBearEntity.kt (4)
engine/engine-core/src/main/kotlin/com/typewritermc/core/entries/EntryReference.kt (1)
  • emptyRef (6-6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/AgeableData.kt (1)
  • applyAgeableData (38-46)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/GenericData.kt (1)
  • applyGenericEntityData (9-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/LivingData.kt (1)
  • applyLivingEntityData (7-20)
🪛 markdownlint-cli2 (0.17.2)
.github/chatmodes/NewEntity.chatmode.md

44-44: Bare URL used

(MD034, no-bare-urls)

🪛 LanguageTool
.github/instructions/entity-extension.add-entity.instructions.md

[style] ~21-~21: Consider using the synonym “brief” (= concise, using a few words, not lasting long) to strengthen your wording.
Context: ...instance, tag armor_stand_data`). - A short description, an icon id, and a color fr...

(QUICK_BRIEF)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (7)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (2)

16-27: Solid data entry and property build pattern

Entry/Tags, defaults, and build/type functions are consistent with existing patterns. The metas-DSL usage matches AgeableData’s approach.


36-44: Confirm metas-DSL error behavior matches intent

Placing error("Could not apply...") at the end of the metas block relies on the DSL suppressing it when a prior meta<...> matched. This mirrors AgeableData; just flagging to ensure the DSL’s contract is consistent here.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/SnifferEntity.kt (3)

23-39: Definition entry looks correct

IDs, colors, tags, OnlyTags, and create() returning the wrapper align with peers.


41-53: Instance entry matches project conventions

Fields, defaults, and OnlyTags are consistent with similar entities.


69-71: Good call documenting skipped Sniffer fields

This aligns with the docs/chatmode guidance for reuse-only mode.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (2)

24-35: Definition entry is consistent and complete

Tags, OnlyTags (including mob/ageable/panda_data), and create() are aligned with established patterns.


37-46: Instance entry matches established structure

Fields, defaults, and OnlyTags are appropriate.

@Marten-Mrfc Marten-Mrfc changed the title Add new entities to the EntityExtension [Entity] Add new entities to the EntityExtension Aug 11, 2025
@Stax95
Copy link

Stax95 commented Aug 18, 2025

@Marten-Mrfc Is this finished? Wanting to add this to my server as soon as possible

@Marten-Mrfc
Copy link
Collaborator Author

Yeah I think it will be in the next beta (:

@Stax95
Copy link

Stax95 commented Aug 23, 2025

Yeah I think it will be in the next beta (:

will this beta be soon? Also does this support having pandas sitting whilst eating bambboo constantly?

@Marten-Mrfc
Copy link
Collaborator Author

Not yet sadly if you could make add that data and add it to the pr

Otherwise i'll need to add it myself.

There is no ETA on the next beta

@Stax95
Copy link

Stax95 commented Aug 23, 2025

Not yet sadly if you could make add that data and add it to the pr

Otherwise i'll need to add it myself.

There is no ETA on the next beta

so get a dev to make an addon for me or wym? Im not a dev

@Marten-Mrfc
Copy link
Collaborator Author

Oow if you're not an dev than i'll need to add it.

I'll add it when I have time (:

@Stax95
Copy link

Stax95 commented Aug 23, 2025

have time (:

Thanks! I can offer money btw to get it added sooner

@Stax95
Copy link

Stax95 commented Aug 23, 2025

I need this so I can finish my server

Copy link
Contributor

@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: 0

🧹 Nitpick comments (4)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaPoseData.kt (3)

31-32: Surface default tick values in the editor via @default annotations.

You're already providing sensible tick defaults in the ctor; mirroring them with @default helps UX in form-based editors.

-    /** Timers (in ticks) used when a pose requires an active timer */
-    val sneezeTicks: Int = 20,
-    val eatTicks: Int = 40,
+    /** Timers (in ticks; 20 ticks = ~1s) used when a pose requires an active timer */
+    @Default("20")
+    val sneezeTicks: Int = 20,
+    @Default("40")
+    val eatTicks: Int = 40,

55-56: Align collector default with documented defaults to reduce surprises.

Functionally harmless today (STANDING ignores timers), but aligning these defaults with the entry’s 20/40 avoids confusion if the fallback ever renders in UI or logging.

-    companion object : SinglePropertyCollectorSupplier<PandaPoseProperty>(PandaPoseProperty::class, PandaPoseProperty(PandaPose.STANDING, 0, 0))
+    companion object : SinglePropertyCollectorSupplier<PandaPoseProperty>(
+        PandaPoseProperty::class,
+        PandaPoseProperty(PandaPose.STANDING, 20, 40)
+    )

68-79: Increase minimum animation timer ticks for better visibility

1 tick is technically valid but too short to be noticeable in-game. To ensure players see the sneeze/eat animations, bumping the minimum to around 5 ticks is recommended—this aligns with the typical “visible” threshold.

• File extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaPoseData.kt
– Lines 73, 74, 77 (current coerceAtLeast(1) usage)

Suggested diff:

-                PandaPose.SNEEZING -> setSneezeTimer(property.sneezeTicks.coerceAtLeast(1))
-                PandaPose.EATING -> setEatTimer(property.eatTicks.coerceAtLeast(1))
-                PandaPose.SITTING_EATING -> {
-                    setSitting(true)
-                    setEatTimer(property.eatTicks.coerceAtLeast(1))
+                PandaPose.SNEEZING -> setSneezeTimer(property.sneezeTicks.coerceAtLeast(5))
+                PandaPose.EATING -> setEatTimer(property.eatTicks.coerceAtLeast(5))
+                PandaPose.SITTING_EATING -> {
+                    setSitting(true)
+                    setEatTimer(property.eatTicks.coerceAtLeast(5))

Optionally, you could extract 5 into a named constant (e.g. MIN_VISIBLE_TICKS) if you foresee reusing it for other entity timers.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (1)

49-57: Early-return after panda-specific handlers to avoid redundant checks.

Not a bug, just avoids unnecessary generic/living checks on already-handled properties and mirrors the common wrapper pattern.

 override fun applyProperty(property: EntityProperty) {
-    when (property) {
-        is PandaGeneProperty -> applyPandaGeneData(entity, property)
-        is PandaPoseProperty -> applyPandaPoseData(entity, property)
-        is AgeableProperty -> applyAgeableData(entity, property)
-    }
+    when (property) {
+        is PandaGeneProperty -> { applyPandaGeneData(entity, property); return }
+        is PandaPoseProperty -> { applyPandaPoseData(entity, property); return }
+        is AgeableProperty -> { applyAgeableData(entity, property); return }
+    }
     if (applyGenericEntityData(entity, property)) return
     if (applyLivingEntityData(entity, property)) return
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 36dbd4a and 4c8dd56.

📒 Files selected for processing (2)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaPoseData.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (6)
engine/engine-core/src/main/kotlin/com/typewritermc/core/entries/EntryReference.kt (1)
  • emptyRef (6-6)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaGeneData.kt (1)
  • applyPandaGeneData (36-44)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaPoseData.kt (1)
  • applyPandaPoseData (58-83)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/AgeableData.kt (1)
  • applyAgeableData (38-46)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/GenericData.kt (1)
  • applyGenericEntityData (9-20)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/LivingData.kt (1)
  • applyLivingEntityData (7-20)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (4)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/living/panda/PandaPoseData.kt (2)

22-38: Well-shaped data entry with a clean reset/apply flow.

The entry, property, and enum model the pose state cleanly, and the reset-first approach avoids state leakage between applications. The tags align with PandaDefinition/Instance OnlyTags. Nice.


60-67: Minor note: full reset is correct here given SinglePropertyCollector semantics.

Given SinglePropertyCollectorSupplier enforces a single PandaPoseProperty, the pre-reset won’t fight other pose entries. Keep as-is.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/minecraft/PandaEntity.kt (2)

48-57: Good integration: dedicated panda-specific handlers plus generic/living fallbacks.

Property routing covers genes, pose, and ageable, then delegates to generic/living handlers. Consistent with other data applicators shown in the module.


55-56: Verify WrapperFakeEntity’s inheritance for living data application

I checked the inheritance in extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/entity/WrapperFakeEntity.kt and found:

  • WrapperFakeEntity (line 20) extends FakeEntity(player) and does not subclass me.tofaa.entitylib.wrapper.WrapperLivingEntity.
  • applyLivingEntityData only applies to instances of WrapperLivingEntity, so it will always skip when called on a WrapperFakeEntity.

Please confirm whether this is intentional. If you need living-entity properties applied to fake entities, consider having WrapperFakeEntity inherit from WrapperLivingEntity or otherwise adjust the data-application logic.

@Marten-Mrfc Marten-Mrfc merged commit a366731 into develop Aug 24, 2025
4 checks passed
@Marten-Mrfc Marten-Mrfc deleted the features/entities branch August 24, 2025 11:08
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