ObelusPA / CreativeParkour

Bukkit parkour plugin that allows all the players to play and show their skills in fun parkour maps they build or download!
https://creativeparkour.net
GNU General Public License v3.0
3 stars 9 forks source link

Why are you restoring the inventory after 2 ticks? #9

Closed RoboMWM closed 6 years ago

RoboMWM commented 6 years ago

So I wrote my own inventory save and restorer, but unless I make it wait like at least 3 ticks before restoring, your plugin will take over and restore whatever it thinks it should restore (which in some cases might be an empty inventory!)

This wouldn't be an issue if you'd just runTask()/schedule it 1 tick later. But anyways, I've found out how to disable the inventory restorer, and upon testing it seems to work okay. So at this point I'm just curious why you wait 2 ticks instead of 1.

ObelusPA commented 6 years ago

Hi! When I made this (a long time ago), many users had problems with their inventories not being restored, there was conflicts with other plugins that replaced inventories during the first tick, so I made CreativeParkour wait 2 ticks to make sure inventories are not lost but there was still the option to disable this feature for users that want to use their own inventory restorer.

RoboMWM commented 6 years ago

Ok cool, that was going to be my guess. Yea, inventory restoration + working with other plugins isn't a fun task to perform, and probably impossible to cover all cases without user configuration/using a centralized API to do that.