Skip to content

Implemented Composter#6922

Open
Its123Miguel321 wants to merge 13 commits intopmmp:minor-nextfrom
Its123Miguel321:composter
Open

Implemented Composter#6922
Its123Miguel321 wants to merge 13 commits intopmmp:minor-nextfrom
Its123Miguel321:composter

Conversation

@Its123Miguel321
Copy link
Copy Markdown

This PR implements the Composter

Related issues & PRs

Related to #4742

Changes

API changes

Block

  • Added Block Classes:
    • Composter
    • Fern
    • LargeFern
    • NetherWart
    • PitcherPlant
    • ShroomLight
    • TorchFlower
    • WarpedWart
  • Updated: Block Class:
    • Added getCompostabilityChance()
    • Added isCompostable()
  • Updated Blocks:
    • BaseBigDripleaf
    • BaseCake
    • Cactus
    • CactusFlower
    • DoubleTallGrass
    • DriedKelp
    • Flower
    • GlowLichen
    • Grass
    • HangingRoots
    • HayBale
    • Leaves
    • MangroveRoots
    • Melon
    • MushroomStem
    • NetherRoots
    • NetherVines
    • NetherWartPlant
    • PinkPetals
    • Pumpkin
    • RedMushroom
    • RedMushroomBlock
    • Sapling
    • SeaPickle
    • SmallDripleaf
    • SporeBlossom
    • Stem
    • SugarCane
    • TallGrass
    • Vine
    • WaterLily
    • WitherRose

Event

  • Added Events:
    • ComposterEmptyEvent
    • ComposterFillEvent
    • ComposterReadyEvent

Item

  • Added Item: Wheat
  • Updated Item & ItemBlock Classes:
    • Added getCompostabilityChance()
    • Added isCompostable()
  • Updated Items:
    • Apple
    • BakedPotato
    • Beetroot
    • BeetrootSeeds
    • Bread
    • Carrot
    • CocoaBeans
    • Cookie
    • DriedKelp
    • GlowBerries
    • Melon
    • MelonSeeds
    • PitcherPod
    • Potato
    • PumpkinPie
    • PumpkinSeeds
    • SweetBerries
    • TorchflowerSeeds
    • WheatSeeds

World

  • Added Particle: CropGrowthEmitterParticle
  • Added Sounds:
    • ComposterEmptySound
    • ComposterFillSound
    • ComposterFillSuccessSound
    • ComposterReadySound

Follow-up

Once more items/blocks are added could check if they are compostable

Tests

Composter functionality Video

@Its123Miguel321 Its123Miguel321 requested a review from a team as a code owner November 30, 2025 05:57
Copy link
Copy Markdown
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

This looks mostly OK, good work

However, some comments below

Comment thread src/block/Composter.php
Comment thread src/block/Composter.php Outdated
Comment thread src/block/Composter.php Outdated
Comment thread src/block/Composter.php
Comment thread src/world/particle/CropGrowthEmitterParticle.php Outdated
Comment thread src/world/particle/CropGrowthEmitterParticle.php Outdated
Comment thread src/world/particle/CropGrowthEmitterParticle.php Outdated
@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Nov 30, 2025
Comment thread src/block/Composter.php Outdated
Comment thread src/block/Composter.php Outdated
@dktapps
Copy link
Copy Markdown
Member

dktapps commented Dec 21, 2025

Please make the build pass.
The CS issues are mostly cases of trailing whitespace or missing blank lines at the end of the file. php-cs-fixer can fix those for you.

I also don't like the idea of adding functions inside which the compostability gets hardcoded. I've been trying to move away from that generally, since it's inflexible and requires tons of useless classes. It'd be better if we had some way to inject this information into item constructors where it's appropriate. For Blocks, it could go in BlockTypeInfo. For Items I suppose it'd have to just go in the Item class directly...

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

Labels

Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants