fix: prevent food crops being planted indoors or underground - #62
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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughVanilla and CustomCrops planting now checks whether crops require open sky and whether the planting location has it. The change adds configurable exemptions and allowed covers, registers planting listeners, and documents the rules. ChangesCrop planting rules
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant Bukkit as Bukkit block placement event
participant Planting as CropPlantingListener
participant CustomEvent as CustomCrops planting event
participant CustomListener as CropCustomCropsListener
participant Rule as CropPlantingRule
participant Player
Bukkit->>Planting: Check block placement
Planting->>Rule: Check crop requirement and open sky
Rule-->>Planting: Return check results
Planting->>Player: Cancel placement and send denial if required
CustomEvent->>CustomListener: Check crop planting
CustomListener->>Rule: Check crop requirement and open sky
Rule-->>CustomListener: Return check results
CustomListener->>Player: Cancel planting and send denial if required
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The planting restrictions and configurable exceptions have no identified merge-blocking defect. Complete the planned build and in-game smoke test before release. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The planting restriction uses existing event and administrative configuration paths. Cooking’s automatic replanting honors cancellation and returns the reserved seed. No new player configuration authority was established, but external crop-plugin behavior and runtime integration remain incompletely verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Comment |
Food crops could be planted under cave ceilings and house roofs. Require an open column above vanilla and CustomCrops planting, including Cooking's automatic replanting. Glass greenhouses are allowed by default; nether wart, mushrooms, and CustomCrops yeast remain exempt. Existing planted crops and growth rules are unchanged.
Add reloadable crops.yml options for requiring open sky, allowing glass roofs, additional allowed roof materials, and vanilla/custom crop exemptions. Existing configs use these defaults without migration.
Validation: Maven verify passed all 290 tests, including 14 planting cases for stone/wood roofs, glass greenhouses, world height, custom crops, configuration and fungal exceptions. TFMCDev01 enabled the final DEV-20261001-greenhouses build and reached Paper Done. In-game tests passed: open-sky wheat allowed, stone roof denied without seed consumption and with feedback, glass greenhouse wheat allowed, nether wart allowed indoors. Test blocks were restored. GitHub CI passed and CodeRabbit approved.