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

6161 implement interface common block properties #6383

Draft
wants to merge 7 commits into
base: minor-next
Choose a base branch
from

Conversation

CoderJoeW
Copy link

Introduction

The goal of this is to give plugins an easier way of accessing common properties of blocks such as facing and on/off

Relevant issues

Fixes #6161

@CoderJoeW CoderJoeW marked this pull request as draft July 3, 2024 21:17
@CoderJoeW
Copy link
Author

@dktapps Just want to get a quick review of this to make sure its headed in the intended direction

@CJMustard1452
Copy link

CJMustard1452 commented Jul 4, 2024

Would this be better utilized trait, I think the is the direction most items like this follow.

pocketmine\block\Bell.php#42

@CoderJoeW
Copy link
Author

Would this be better utilized trait, I think the is the direction most items like this follow.

pocketmine\block\Bell.php#42

Probably should use the trait as there is Horizontal and AnyFacing traits that could be used

Possibly out of scope? Would likely fit more into another PR for cleaning up the code

/**
* Set the current facing direction of the block
*/
public function setFacing(int $facing) : object;
Copy link
Member

Choose a reason for hiding this comment

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

Its block not object

@@ -40,7 +41,7 @@
use pocketmine\world\World;
use function ceil;

class Painting extends Entity{
class Painting extends Entity implements FacingInterface{
Copy link
Member

Choose a reason for hiding this comment

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

Design error, you're using an interface made for blocks in an entity, I don't think you should do that

@ShockedPlot7560 ShockedPlot7560 added Category: API Related to the plugin API Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: API Related to the plugin API 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