pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.26k stars 1.54k forks source link

BlockGrowEvent not called when growing Bamboo #4352

Closed ColinHDev closed 3 years ago

ColinHDev commented 3 years ago

Issue description

The BlockGrowEvent should be called when a crop or plant is growing through randomTick or bone meal. However, it is missing in both the BambooSapling and Bamboo classes. The event should be called if the grow function in one of these classes is executed like it is called in the grow functions of the Sugarcane and Cactus class (two crops, which are the most similar to Bamboo).

Steps to reproduce the issue

OS and versions

Plugins

Crashdump, backtrace or other files


ColinHDev commented 3 years ago

Just out of curiosity, may I ask, why the growing of Saplings never called an event? I know, BlockGrowEvent wouldn't suit, because it just provides the original Block and its new state, but couldn't there just be a SaplingGrowEvent that would provide the sapling block as well as the BlockTransaction of the tree?

dktapps commented 3 years ago

BlockTransaction didn't exist prior to PM4.

ColinHDev commented 3 years ago

Yes, I know, but I am talking about pm4 (and upwards)

dktapps commented 3 years ago

The same reason why there are no rockets to Mars - nobody has done it yet.

ColinHDev commented 3 years ago

If I make a PR, would these additions (BlockGrowEvent on Bamboo and SaplingGrowEvent) be accepted to the current master branch or currently not because of feature freeze? I know, this question sounds dumb, but if you would say that you wouldn't add it to the current master branch e.g. because of the feature freeze, I probably wouldn't make a PR. When the PR would be added in a year or so, it might be outdated and the work was for nothing. That's why I am asking