Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove $blockClicked from Block::place() #5509

Open
dktapps opened this issue Jan 12, 2023 · 0 comments
Open

Remove $blockClicked from Block::place() #5509

dktapps opened this issue Jan 12, 2023 · 0 comments
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Category: Core Related to internal functionality Easy task Probably really easy to do, good task for first-time contributors Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Jan 12, 2023

Description

This parameter:

  • is used in very few places, which can all be migrated to use blockReplace
  • is a giant footgun (usually blockReplace->getSide() should be used instead - doing otherwise causes bugs when the resulting facing of the block doesn't match the face clicked)

This is, of course, BC breaking.

The only irreplaceable use case for it is to detect when the block replaced is the block clicked (e.g. when clicking on grass). However, this case is currently buggy anyway due to usage of dodgy Facing values (try placing a bell next to a wall by clicking on the side of grass), and the signature needs to be changed to avoid passing dodgy values into place() anyway.

Alternative methods

@dktapps dktapps added Category: API Related to the plugin API Category: Core Related to internal functionality BC break Breaks API compatibility Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Jan 12, 2023
@dktapps dktapps added the Easy task Probably really easy to do, good task for first-time contributors label Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break Breaks API compatibility Category: API Related to the plugin API Category: Core Related to internal functionality Easy task Probably really easy to do, good task for first-time contributors Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant