这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@DavyCraft648
Copy link
Contributor

@DavyCraft648 DavyCraft648 commented Nov 2, 2025

This PR implements moss blocks and moss carpets, including their pale variants. This also update relevant block logic to recognize moss blocks as valid support.

This PR does not implement Azalea and Flowering Azalea

1.17.0 - Caves and Cliffs, 1.21.50 - The Garden Awakens

Related issues & PRs

#6116

Changes

API changes

  • Added new block classes: MossBlock, MossCarpet, PaleMossBlock, PaleMossCarpet, and PaleMossCarpetVine
  • Registered MOSS_BLOCK, MOSS_CARPET, PALE_MOSS_BLOCK, PALE_MOSS_CARPET, and PALE_MOSS_CARPET_VINE in VanillaBlocks
  • Added new block type IDs for moss blocks and carpets in BlockTypeIds
  • Introduced the MOSS_REPLACEABLE tag in BlockTypeTags and applied it to relevant existing blocks to allow moss spreading and placement
  • Updated support logic in various blocks to allow placement on moss blocks and recognize moss blocks as valid supports.

Behavioural changes

  • These blocks now recognize moss block as valid support:
    • Bamboo & Bamboo Sapling
    • Big Dripleaf
    • Deadbush
    • DoublePlant
    • Flowers
    • Nether Fungus
    • Nether Roots
    • Nether Sprouts
    • Pink Petals
    • Saplings
    • Small Dripleaf
    • Sugarcane
    • Sweet Berry Bush
    • Tall Grass

Follow-up

Implement Azalea and Flowering Azalea

Tests

https://youtu.be/mBI6AJ52Lx8

@DavyCraft648 DavyCraft648 requested a review from a team as a code owner November 2, 2025 09:39
Copy link
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.

I don't know WTF is going on with Mossy Carpet

@dktapps
Copy link
Member

dktapps commented Nov 2, 2025

Sorry for all the WTFs btw. Since I'm not familiar with pale moss carpets I was tripping out wondering if you'd vibecoded the class for it 😂

@dktapps dktapps added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Nov 2, 2025

use pocketmine\item\Item;

class PaleMossCarpetVine extends PaleMossCarpet{
Copy link
Member

Choose a reason for hiding this comment

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

This seems suspicious. When is a carpet not a carpet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry I'm not sure I understand the question. If it's the top part, it doesn't have the carpet texture

Copy link
Member

Choose a reason for hiding this comment

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

instanceof PaleMossCarpet will return true for the vines, which are not really carpets

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we should separate these two classes? These two blocks have similarities so I thought we could make isCarpetPart()

Copy link
Member

Choose a reason for hiding this comment

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

The class name looks weird too. Its more a PaleMossVine only ? I'm agree that extending PaleMossCarpet is creepy, would be better to add a trait if you have many duplicate code ?

Copy link
Member

Choose a reason for hiding this comment

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

So we should separate these two classes? These two blocks have similarities so I thought we could make isCarpetPart()

You could have a common base class if you want, but the instanceof PaleMossCarpet returning true feels like a problem to me

Copy link
Contributor Author

@DavyCraft648 DavyCraft648 Nov 5, 2025

Choose a reason for hiding this comment

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

I'm not sure about the naming of the base class, BasePaleMossCarpet seems a bit odd in the "base" part. What do you think? Or maybe I'm overthinking it
It's in line with the naming of abstract classes from other blocks though

Copy link
Member

Choose a reason for hiding this comment

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

PaleMossVegetation? PaleMossPlant? idk

Copy link
Member

@ShockedPlot7560 ShockedPlot7560 left a comment

Choose a reason for hiding this comment

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

I wonder if I missed something with the TODO removing ? Does minecraft changed the behavior ?


use pocketmine\item\Item;

class PaleMossCarpetVine extends PaleMossCarpet{
Copy link
Member

Choose a reason for hiding this comment

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

The class name looks weird too. Its more a PaleMossVine only ? I'm agree that extending PaleMossCarpet is creepy, would be better to add a trait if you have many duplicate code ?

@DavyCraft648
Copy link
Contributor Author

DavyCraft648 commented Nov 4, 2025

I added the DIRT tag to the moss block. That's what the game does to check for support for most blocks

@github-actions
Copy link
Contributor

This PR has been marked as "Waiting on Author", but we haven't seen any activity in 7 days.

If there is no further activity, it will be closed in 28 days.

Note for maintainers: Adding an assignee to the PR will prevent it from being marked as stale.

@github-actions github-actions bot added the Stale label Nov 13, 2025

protected function canBeSupportedAt(Block $block) : bool{
$below = $block->getSide(Facing::DOWN);
return $below instanceof PaleMossVine && $below->isCarpetPart();
Copy link
Member

Choose a reason for hiding this comment

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

Type ID would make more sense for this

use pocketmine\player\Player;
use pocketmine\world\BlockTransaction;

class PaleMossCarpet extends PaleMossVine{
Copy link
Member

Choose a reason for hiding this comment

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

Not a fan of this either.

My thinking was to have a base class and then the carpet and vine would individually extend it.
That way you wouldn't need a dodgy hack to avoid the infinite recursion for asItem()

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