Skip to content

feat: allow slabs, stairs and signs just above crops - #83

Merged
XxFran10xX merged 2 commits into
mainfrom
feat/crop-low-cover
Oct 19, 2026
Merged

XxFran10xX merged 2 commits into
mainfrom
feat/crop-low-cover

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Player suggestion (12 ✅ / 0 ❌): let players build signs, slabs and stairs over crops so fields can have pergolas and lantern posts.

Planting already worked under hanging signs, fences and lanterns, but slabs, stairs and standing/wall signs anywhere above the crop counted as a roof. So seeds couldn't be planted under them, and hoe-harvest replanting dropped the seed instead.

This adds planting.low-cover to crops.yml:

low-cover:
  max-height: 5
  materials: ["#slabs", "#stairs", "#all_signs"]
  • low-cover.materials count as open sky only within max-height blocks above the crop. Higher up, they are a roof as before.
  • The sky above the low band must still be clear, so caves and crops inside or under buildings are still refused.
  • A double slab is a full block, so it still counts as a roof.
  • Entries starting with # are vanilla block tags (#slabs or #minecraft:slabs). allowed-cover and exempt-vanilla accept them too. Unknown tags are skipped with a console warning, the same as invalid materials.
  • With no low-cover section, nothing changes. Existing servers need the section added to their crops.yml (config files are never rewritten).

The same check covers vanilla planting, CustomCrops planting and hoe replanting.

Tests

  • mvn clean verify passes locally: 1233 tests, 0 failures, and JaCoCo shows CropPlantingRule with no missed lines or branches.
  • New unit tests cover:
    • the height limit;
    • double slabs;
    • the default height when max-height is missing;
    • negative heights;
    • tag parsing;
    • warnings for unknown tags and entries.
  • Dev: a character bot planted wheat seeds under ten different covers (results in a comment below).

Docs: TF-Minecraft/Docs#304.

🤖 Generated with Claude Code

XxFran10xX and others added 2 commits October 19, 2026 17:45
Add planting.low-cover: materials that count as open sky only within
max-height blocks above the crop (default 5), so players can build
pergolas and lantern posts over fields while caves and buildings still
block planting. Entries starting with # are vanilla block tags; double
slabs stay a roof.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5dab4c70-9c0d-4ef5-9a03-50b4b8bc3fbd
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Dev test (TFMCDev01, this branch's jar at 597f35a, Dev crops.yml given the bundled low-cover section): no invalid-material warnings at startup. A character bot in creative planted wheat seeds on farmland at y 200 (open sky above every structure):

Cover above the crop Expected Result
none plant planted
bottom oak slab +2 plant planted
hanging lantern +1, top spruce slab +2, stone brick stairs +3, oak sign +5 plant planted
oak slab +6 (above the band) refuse refused + message
double oak slab +2 refuse refused + message
stone +3 refuse refused + message
slab +2 under stone +20 refuse refused + message
cherry wall sign +4 plant planted
mossy cobblestone stairs +5 plant planted
oak planks +2 (control) refuse refused + message

10/10 as expected. CustomCrops planting and hoe replanting call the same hasOpenSky check and are covered by the unit tests.

@XxFran10xX
XxFran10xX merged commit 728599e into main Oct 19, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the feat/crop-low-cover branch October 19, 2026 16:03
XxFran10xX added a commit to TF-Minecraft/Docs that referenced this pull request Oct 19, 2026
Covers planting.low-cover (slabs, stairs and signs within max-height
blocks of the crop) and block tags in planting material lists, for
TF-Minecraft/Cooking#83.

Co-authored-by: XxFran10xX <318299142+XxFran10xX@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Pull request is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant