25 Commits

Author SHA1 Message Date
Dylan K. Taylor
4b9a142a5d Import global functions and constants for enhanced performance
This is better for performance because these then don't need to be reevaluated every time they are called.

When encountering an unqualified function or constant reference, PHP will first try to locate a symbol in the current namespace by that name, and then fall back to the global namespace.
This short-circuits the check, which has substantial performance effects in some cases - in particular, ord(), chr() and strlen() show ~1500x faster calls when they are fully qualified.

However, this doesn't mean that PM is getting a massive amount faster. In real world terms, this translates to about 10-15% performance improvement.
But before anyone gets excited, you should know that the CodeOptimizer in the PreProcessor repo has been applying fully-qualified symbol optimizations to Jenkins builds for years, which is one of the reasons why Jenkins builds have better performance than home-built or source installations.
We're choosing to do this for the sake of future SafePHP integration and also to be able to get rid of the buggy CodeOptimizer, so that phar and source are more consistent.
2019-01-04 20:43:15 +00:00
Dylan K. Taylor
d71a543d10 Fixed a bunch of things PHPStan finds unpalatable
close #2614, fix a bunch of docs bugs, fix sendCreativeContents() crash on Human holders, move some inline variable declarations
2019-01-04 00:23:09 +00:00
Dylan K. Taylor
6579930638
Revamp MetadataStore API (#2477)
This would be a lot less messy if we had generics, but no tango.
2018-10-12 12:16:21 +01:00
Dylan K. Taylor
f08537a1e0 BlockMetadataStore: fix case of import
found by PHPStan static analysis tool
2018-05-18 16:46:48 +01:00
Dylan K. Taylor
4f8e4f0522
Add EOF newlines where missing (bulk) (#1836)
This should solve issues with people making GitHub PRs and having the web editor messing things up. GitHub Web Editor sucks :(
2017-12-20 11:56:36 +00:00
Dylan K. Taylor
ea414ea72d Fixed MetadataStore 2017-08-16 17:09:03 +01:00
Dylan K. Taylor
e8bd0c3e09 add typehints to Metadatable interface and implementations, fix missing return for Block->hasMetadata() reported in #1285 2017-08-10 18:02:01 +01:00
Dylan K. Taylor
c3b8be3f60 and more typehints 2017-07-14 10:56:51 +01:00
Dylan K. Taylor
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
Sandertv
1c7773c5f1 Visibility keyword before final or abstract keyword. (#814) 2017-04-13 20:58:53 +08:00
Dylan K. Taylor
ad88ca09bd Fixed cannot remove block metadata 2017-02-23 15:18:42 +00:00
Dylan K. Taylor
0c35c16727 Fix some doc comments 2017-02-06 14:50:05 +00:00
Dylan K. Taylor
b28e38ab26 Move some exceptions out of utils into their relevant namespaces, move some Chunk methods to ChunkUtils for I/O, refactor "colour" -> "color" 2017-01-15 11:31:12 +00:00
Shoghi Cervantes
34dc6ea0d6 NOTE! THIS SHOULD BE REVERTED LATER! Removed WeakRef dependency 2015-08-23 00:25:29 +02:00
Shoghi Cervantes
d7d05c20a9 Bumped to API 2.0.0 2015-08-23 00:25:29 +02:00
Shoghi Cervantes
8e56782138
Fixed #2619 BlockMetadataStore 2015-02-15 18:25:40 +01:00
Shoghi Cervantes
a98da3bab1 Renamed old getID() calls to getId() 2014-12-07 15:21:32 +01:00
Shoghi Cervantes
8c4faa8622 Added extra Exceptions 2014-10-28 21:07:12 +01:00
MCMrARM
fadf1a5d40 Fixed PlayerMetadataStore 2014-06-26 21:12:03 +02:00
Shoghi Cervantes
4354d76cae Fully fixed metadata sending 2014-06-14 21:44:02 +02:00
Shoghi Cervantes
8d40f843cf MainLogger can now have debug level disabled 2014-05-29 00:08:02 +02:00
Shoghi Cervantes
160c633c08 Updated trigger_error to Exceptions, fixed bug in Plugin task deletion 2014-05-26 12:22:28 +02:00
Shoghi Cervantes
683ab8d2cd Fixed invalid metadata and updated weak references on PluginManager 2014-05-23 22:30:37 +02:00
Shoghi Cervantes
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
Shoghi Cervantes
99818a26f5 Added object metadata for Plugins, use WeakMap on perms 2014-05-19 20:07:27 +02:00