feat: chicken coop 3x3x2 is placeable in world#64
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new three-by-three-by-two chicken coop block structure has been introduced to the Minecraft mod. The implementation includes a dedicated Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
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 🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
d24dde3 to
445ba9a
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
src/main/java/com/tcm/MineTale/block/ChickenCoopBlock.javasrc/main/java/com/tcm/MineTale/registry/ModBlocks.javasrc/main/java/com/tcm/MineTale/util/CoopPart.java
|
@coderabbitai generate docstrings |
✅ Actions performedInitiated docstring generation; will generate only if new commits exist. |
|
Note Docstrings generation - SKIPPED |
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`
|
@coderabbitai generate docstrings |
✅ Actions performedInitiated docstring generation; will generate only if new commits exist. |
No description provided.