LegacyStringToItemParser: mark as deprecated, and point people towards StringToItemParser, which is much nicer

This commit is contained in:
Dylan K. Taylor 2021-08-29 16:13:19 +01:00
parent dee2062b1b
commit 8847aa2d7f
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -38,9 +38,14 @@ use function strtolower;
use function trim;
/**
* This class fills in as a substitute for all the stuff that used to make ItemFactory::fromString()
* work. Since legacy item IDs are on their way out, we can't keep using their constants as stringy
* IDs (especially not considering the unnoticed BC-break potential posed by such a stupid idea).
* @deprecated
* @see StringToItemParser
*
* This class replaces the functionality that used to be provided by ItemFactory::fromString(), but in a more dynamic
* way.
* Avoid using this wherever possible. Unless you need to parse item strings containing meta (e.g. "dye:4", "351:4") or
* item IDs (e.g. "351"), you should prefer the newer StringToItemParser, which is much more user-friendly, more
* flexible, and also supports registering custom aliases for any item in any state.
*/
final class LegacyStringToItemParser{
use SingletonTrait;