Skip to content

feat: chicken coop 3x3x2 is placeable in world#64

Merged
The-Code-Monkey merged 2 commits into1.21from
feat/chicken-coop
Mar 4, 2026
Merged

feat: chicken coop 3x3x2 is placeable in world#64
The-Code-Monkey merged 2 commits into1.21from
feat/chicken-coop

Conversation

@The-Code-Monkey
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Warning

Rate limit exceeded

@The-Code-Monkey has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 20 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0adb7a5-720c-4efa-b3e9-145242f30b80

📥 Commits

Reviewing files that changed from the base of the PR and between 445ba9a and 1449c57.

📒 Files selected for processing (2)
  • src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.java
  • src/main/java/com/tcm/MineTale/util/CoopPart.java
📝 Walkthrough

Walkthrough

A new three-by-three-by-two chicken coop block structure has been introduced to the Minecraft mod. The implementation includes a dedicated ChickenCoopBlock class, a CoopPart enum cataloguing eighteen grid positions, and registry integration. The block manages multi-block placement validation, state-dependent destruction of all constituent parts, and neighbour orientation tracking.

Changes

Cohort / File(s) Summary
Chicken Coop Block Implementation
src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.java
New block class implementing 3×3×2 structure with facing-oriented placement, state definition (FACING, PART properties), neighbour-aware shape updates, and coordinated multi-block destruction when any part is removed.
Coop Part Enumeration
src/main/java/com/tcm/MineTale/util/CoopPart.java
New enum defining eighteen constants representing grid positions across three vertical layers (bottom, middle, top), each with x/z/y offsets; includes coordinate-to-part lookup and serialization support.
Block Registry
src/main/java/com/tcm/MineTale/registry/ModBlocks.java
Registration of CHICKEN_COOP as public static final Block with BASS instrument, wood properties, 2.0 hardness, and automatic BlockItem registration.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A coop of grain and wooden frame so grand,
Eighteen parts arranged across the land,
Lowkey slay, no cap—it's giving multi-block energy,
Though the nested destruction logic's kinda sketchy,
From the stars to Middle-earth, quite the feat this be. ✨🐔


A Brief Interjection on the Matter at Hand:

One must say, the implementation is rather splendid overall—quite the feat of structural engineering, reminiscent of the great halls of Erebor, one supposes. However, one does harbour considerable disapproval of the isNeighborPartOfCoop() method returning true as a perpetual stub. That's absolutely unhinged, bestie. The logic for determining coop membership is essentially non-functional at present, which means the entire neighbour-aware destruction cascade is operating on pure faith rather than actual validation. Highkey concerning. The coordinate offset calculations and multi-block state management appear sound, but this particular stub implementation is giving "placeholder nobody tested" energy, and that's not it, chief.

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No description was provided by the author; the pull request lacks any explanatory text about the changes. Add a description explaining the chicken coop feature, its functionality, and any relevant implementation details for reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and accurately describes the main feature being introduced: a 3x3x2 chicken coop block structure that can be placed in the game world.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/chicken-coop

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
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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.java`:
- Around line 98-116: The current isNeighborPartOfCoop always returns true,
causing updateShape to destroy the block whenever any adjacent block is not a
coop; change isNeighborPartOfCoop to actually detect whether the neighbor in the
given Direction is supposed to be part of this 3x3x2 coop (i.e., compute the
expected multi-block offsets relative to this part or the “master” block and
only return true when the direction points at one of those required offsets), so
updateShape only returns AIR when a required coop part was removed; locate and
modify isNeighborPartOfCoop(BlockState state, Direction dir) (and if you use a
master marker, consult the master-checking code or playerWillDestroy logic) to
inspect the relative offset pattern instead of returning true unconditionally.
- Around line 118-148: The current playerWillDestroy implementation both
redundantly forces neighbour updates (see updateShape/isNeighborPartOfCoop) and
nukes coop blocks without dropping items; fix by ensuring you collect and drop
each block's loot before replacing with AIR: in playerWillDestroy (and when
iterating using calculateOffset, FACING, PART, CoopPart) first gather the target
BlockState instances, call Block.dropResources(...) for each (or invoke the
block's getDrops()/loot table) and/or implement/override getDrops() or wire a
loot table for the coop block so drops are produced, then setBlock to AIR; also
tighten isNeighborPartOfCoop so it only returns true for parts belonging to the
same coop origin to avoid cascade reprocessing.

In `@src/main/java/com/tcm/MineTale/util/CoopPart.java`:
- Around line 54-64: The getPartFromCoords method currently returns a silent
fallback BOTTOM_FRONT_LEFT when no match is found; change this to fail-fast by
throwing an IllegalArgumentException (including the invalid x,z,y values) from
getPartFromCoords (or alternatively change the return type to Optional<CoopPart>
if callers prefer) instead of returning BOTTOM_FRONT_LEFT, and update the method
JavaDoc to accurately describe the grid as 3x2x3 (width × depth × height) so the
comment matches the actual coordinate ordering used by
values()/xOffset/zOffset/yOffset.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 23e5c8ee-a6c6-44de-a810-6f20608f84d7

📥 Commits

Reviewing files that changed from the base of the PR and between 8568d46 and 445ba9a.

📒 Files selected for processing (3)
  • src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.java
  • src/main/java/com/tcm/MineTale/registry/ModBlocks.java
  • src/main/java/com/tcm/MineTale/util/CoopPart.java

@The-Code-Monkey
Copy link
Contributor Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

Note

Docstrings generation - SKIPPED
Skipped regeneration as there are no new commits. Docstrings already generated for this pull request at #65.

coderabbitai bot added a commit that referenced this pull request Mar 4, 2026
Docstrings generation was requested by @The-Code-Monkey.

* #64 (comment)

The following files were modified:

* `src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.java`
* `src/main/java/com/tcm/MineTale/util/CoopPart.java`
@The-Code-Monkey The-Code-Monkey merged commit 97a1923 into 1.21 Mar 4, 2026
3 checks passed
@The-Code-Monkey
Copy link
Contributor Author

@coderabbitai generate docstrings

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 4, 2026

✅ Actions performed

Initiated docstring generation; will generate only if new commits exist.

@coderabbitai coderabbitai bot mentioned this pull request Mar 5, 2026
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.

1 participant