jasonw4331 / MyPlot

Plot and protection plugin for PocketMine-MP
https://discord.gg/Qqcpp9Q
MIT License
101 stars 90 forks source link

Update Plot.php #354

Closed HimmelKreis4865 closed 3 years ago

HimmelKreis4865 commented 4 years ago

Introduction

This PR is adding some base API methods that should make PlotAPI easier

Relevant issues -

-->

Changes

API changes

Added Plot::getOwner() :string, Plot::getX() :int, Plot::getZ() :int, Plot::getLevelName() :string, Plot::isOwner(string $username) :bool

Behavioural changes -

Backwards compatibility

Compatible

Follow-up -

Requires translations: -

-->

Tests

It was tested and worked for me so far

DerDevHD commented 4 years ago

Why should it make the API easier? All properties are public, so I don't see a reason for adding Getters for them. They are just some uneseccary methods for the Plot-class.

^^^ Just my personal opinion.

HimmelKreis4865 commented 4 years ago

well, it can be your opinion yea but I think getters make the code look cleaner and make live easier for debugging or errror tracking.

Since Plot::isOwner() is as useless as Plot::isDenied and Plot::isHelper() I don't think its a big argument for rejecting that. .-.

HimmelKreis4865 commented 4 years ago

Now I removed every other "useless" method but still left Plot::isOwner() in and fixed /plot setowner subcommand which is showing the correct owner now