https://bugs.php.net/bug.php?id=75992
When plugins do time-limited bans and users enter stupid time values, a shitty bug in ext/date gets triggered, but only when reading the ban entries from disk. DateTime->format() is able to produce formatted strings which have more than 4 digits in the year, which are then considered invalid. This works around it by trying to parse a formatted version on the fly to ensure that it is valid.
This also cleans up and improves ban list loading and handling.
This cleans a lot of mess out of the bootstrap file, and also has the added bonus that threads which do not inherit functions can now get access to them by autoloading Utils.
Currently an ItemBlock is created for every Block requested, but this will need to change in the future (for Anvils because they have stupid bitshifts on the meta instead of a nice bitmask). This allows registering items in the ItemFactory with IDs lower than 256 and having them recognized.
This allows retrieving the name of an item without the custom name being plastered over the top. This will also allow weird things to have special functions for their names.
This convention is used throughout the code to allow plugin developers to alter the behaviour of the event. In this case, it would instead produce unexpected behaviour when the event is not cancelled by a plugin.
These are never called accidentally, or at least it's highly unlikely to do so. It might be reasonable to throw exceptions for this, but for the meantime they are redundant - extra indentation for no good reason.
This also removes the $force parameter from BlockFactory::init().
Wanting initialized item factory does not require initializing the creative inventory. This is often useless and unwanted extra baggage (when this is used on threads for example).
This code is no longer necessary, because entities are constructed with a Level instead of a Chunk since API 3.0.0-ALPHA4. This means that they will not get allocated in the wrong chunk at runtime after having been saved on the wrong chunk by something else (such as an older version of PM). They will instead be allocated in a chunk selected by bitshifting their coordinates.
This is necessary to be able to fix#1789 without causing entities affected by the infamous bitshift-on-floats bugs to inexplicably vanish.