12 Commits

Author SHA1 Message Date
Dylan K. Taylor
adc1069ed2 Merge branch '3.5' 2019-01-04 23:28:44 +00:00
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
d88b32da91 Drop useless numeric IDs for attributes, use strings instead 2018-10-19 15:29:01 +01:00
Dylan K. Taylor
0bb5e88b5c Hinting up Entity API to PHP 7.2 standards 2018-05-19 10:46:47 +01:00
Dylan K. Taylor
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +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
2204942338 Fixed the half-done hunger implementation, fixed lots of bugs related to hunger
- Fixed starvation doesn't deal any damage at all (Human->getFood() returns a float, not an int, === 0 won't work so great)
- Added exhaustion for sprinting, walking, jumping and sprint-jumping as per MCPE (these use MCPE values, and yes MCPE does walking exhaustion!)
- Fixed attributes don't get reset after player death
- Added food and hunger regeneration in peaceful difficulty
- Added API methods Living->jump() (motion isn't updated yet, so this won't actually do much if plugins try to use it) and Living->getJumpVelocity()

TODO: implement exhaustion for swimming
2017-04-21 19:48:25 +01:00
Dylan K. Taylor
8f9574dec5 Fixed FOV and attributes 2016-10-27 10:55:01 +01: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
PEMapModder
5459576833 Added hunger and experience saving 2016-02-17 19:56:19 +08:00
PEMapModder
8807617480 Fixed attriutes not sending 2016-02-11 18:45:58 +08:00
PEMapModder
329a525ea1 Implemented food and hunger 2016-02-10 22:49:48 +08:00