magemonkeystudio / genesis

MIT License
8 stars 8 forks source link

performance issue when executing commands BSRewardTypePlayerCommand.java #42

Closed frogglen closed 8 months ago

frogglen commented 11 months ago

you are incorrectly using the bukkit API by unnecessarily calling the PlayerCommandPreprocessEvent event manually

https://github.com/promcteam/BossShopPro/blob/main/src/main/java/org/black_ixx/bossshop/core/rewards/BSRewardTypePlayerCommand.java

Travja commented 11 months ago

I'm obviously not the original developer of this plugin, but I do believe it was set up this way to check if the player even has the ability to run the command before actually performing it. At the same time, I see the point and it probably would be simpler and more efficient just to call the performCommand method and call it a day.