Pocketmine-mp: Confusion between registerEvent() and registerEvents()

Created on 3 Mar 2019  路  6Comments  路  Source: pmmp/PocketMine-MP

Description

It has long been a problem especially to the people who are new in PocketMine field between registerEvent() and registerEvents().

That one addition of s makes it a completely different function from the other. The reason for that is the confusing/conflicting names given to both these methods.

Alternative methods:

Following changes could be made to solve this confusion.

  • registerEvents() should be changed to registerListener().
  • registerEvent() should be changed to registerHandler().
BC break API Enhancement

Most helpful comment

Personally I was far more confused by onCommand() but that's a topic for a separate issue.

All 6 comments

I know that I struggled with this when I first started updating and writing plugins. I agree that this change would read better and make each function more transparent about what it does.

Personally I was far more confused by onCommand() but that's a topic for a separate issue.

Now, this is gonna break plugins :D

It's only one change lol. Wait till 4.0 hit the bell lol

bUkKiT hAs aN OuTstAnDinG aPi deSiGn

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HipsterAF picture HipsterAF  路  3Comments

Ox531 picture Ox531  路  3Comments

dktapps picture dktapps  路  3Comments

JoshuaACasey picture JoshuaACasey  路  3Comments

jasonwynn10 picture jasonwynn10  路  3Comments