28 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
05af87e1d4 Strip empty lines at the end of classes 2018-06-11 13:19:23 +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
74b074753f Bulk addition of constant visibilities
thanks PhpStorm inspections plugin for annoying the shit out of me until
I did this.
2017-11-21 14:44:10 +00:00
Dylan K. Taylor
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +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
Dylan K. Taylor
9004417456 Fixed file headers (#255) 2017-01-13 16:57:05 +00:00
SOFe
58ff381557 PhpStorm automated formatting (#11)
* PhpStorm reformatting

* Tuned PhpStorm reformatting

* Improved ItemIds and BlockIds formatting

* Tuned more PhpStorm reformatting

* Improved string concatenation
2016-10-03 19:05:48 +08:00
Tatsuyuki Ishi
a3e3a5f631 RNG: XorShift128 adapted from php-random library
Fixes world generation problems on 32-bit systems
2016-09-30 19:19:53 +01:00
Shoghi Cervantes
0a85ad0d1f
Improved trees, improved inventory transactions, improved snowball/bow usage 2015-03-28 16:59:15 +01:00
Shoghi Cervantes
47de616ac5
Fixed commands, added level automatic tick delay, improved biome gradient 2015-03-28 01:26:06 +01:00
Shoghi Cervantes
1666602652
Improved memory output, logging, removed locks 2015-03-22 03:20:48 +01:00
Shoghi Cervantes
a76be6cf38
First biome based generator iteration 2015-01-07 04:07:11 +01:00
Shoghi Cervantes
315ea2ea3c 64-bit Random optimizations 2014-09-12 12:58:21 +02:00
Shoghi Cervantes
370a1a0041 Fixed seed generation 2014-06-05 18:13:33 +02:00
Shoghi Cervantes
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
Shoghi Cervantes
da5853083c crc fake random generator 2014-04-08 16:35:45 +02:00
Shoghi Cervantes
1d40399b9c hacky things D: 2014-04-08 16:22:52 +02:00
Shoghi Cervantes
d6f4e77b6c Another patch, added INT32_MASK 2014-04-08 16:05:27 +02:00
Shoghi Cervantes
cb32a95e60 Why, PHP? 2014-04-08 15:52:34 +02:00
Shoghi Cervantes
731fbbc8d1 Another 64-bit patch 2014-04-08 15:50:13 +02:00
Shoghi Cervantes
29ab53a46f Patched... again 2014-04-08 15:46:32 +02:00
Shoghi Cervantes
4c973ce625 Patched random generator on 64-bit 2014-04-08 15:43:13 +02:00
Shoghi Cervantes
9d8e6d5f8c New Random generator 2014-04-08 15:41:32 +02:00
Shoghi Cervantes
999990756c Fixed invalid string type in writeMetadata() 2014-04-07 16:24:58 +02:00
Shoghi Cervantes
c0de004472 Moved binary methods from Utils to Binary 2014-04-07 13:52:01 +02:00
Shoghi Cervantes
dd17652aca Fixed wrong paths 2014-04-01 05:06:12 +02:00