Commit Graph

27 Commits

Author SHA1 Message Date
3cd6e12e71 Renaming "Level" -> "World" (#2907)
This has been a pain point for a long time due to the misleading nature of the name "level". It's also confusing when trying to do things like getting the XP level of the player or such, and also does not translate well to other languages.

This transition was already executed on the UI some time ago (language strings) and now it's time for the same change to occur on the API.

This will burn a lot of plugins, but they'll acclimatize. Despite the scary size of this PR, there isn't actually so many changes to make. Most of this came from renaming `Position->getLevel()` to `Position->getWorld()`, or cosmetic changes like changing variable names or doc comments.
2019-05-07 14:47:28 +01:00
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
1648fff916 Replaced Position->getLevel() null checks with isValid() 2018-03-20 11:10:36 +00:00
e7e4645c0b Fixed a wide range of bugs with floating-point coordinates getting incorrectly int-casted
This causes lots of bugs in negative coordinates.

This fixes #1789 after world load & save.
2018-02-15 10:27:42 +00:00
906d7eb176 Lang: Move TranslationContainer and TextContainer to \pocketmine\lang namespace
why the hell were they ever put in \pocketmine\event in the first place??

This change was suggested many months ago but I forgot all about it.
2018-02-04 20:03:30 +00:00
592ce3c9e9 Adding some missed commands typehints and documentation 2017-08-21 19:02:30 +01:00
8bb0c53797 More typehints for Command stuff 2017-07-14 08:52:27 +01:00
97f6a32557 Changed usage message displaying to exceptions to reduce boilerplate code
Someday this won't need to be done by commands themselves, it'll be done by the parser.
2017-07-04 13:45:00 +01:00
03826d9cbc Fixed player spawnpoints glitching and not saving 2017-06-21 12:17:26 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
e2bae92df8 Updated language files and command descriptions 2015-04-12 00:59:12 +02:00
c2138aa30c More language files 2015-04-11 12:56:38 +02:00
0c041ebca3 Added base translation system 2015-04-11 01:32:08 +02:00
8601405a88 Fixed CPU leak 2014-10-31 21:07:00 +01:00
144a871c07 Improved Vector3 and Block handling, less allocation on Positions 2014-10-28 10:03:10 +01:00
8b585fd9f7 Deprecated Level->getSpawn() in favor of Level->getSpawnLocation() 2014-10-10 11:43:54 +02:00
db7222976e Code cleanup 2014-08-21 17:26:41 +02:00
cb879977d2 Use Player::getDisplayName() on more commands 2014-07-14 14:12:03 +02:00
096e238242 Fixed #1628 invalid sender x,y,z on /spawnpoint, closes #1671 2014-07-14 14:07:43 +02:00
279a438ae6 Fixed spawning of Tile entities via chunk packets 2014-06-22 18:05:42 +02:00
f073a5b837 Fixed a few things 2014-06-17 18:46:16 +02:00
9e8f015dc0 Changed commands to use CommandSender::getServer() 2014-06-17 18:41:10 +02:00
53749483c3 Implemented new Inventory windows on Player, Chest and Furnace 2014-05-23 20:53:06 +02:00
076bf2f2fe Added /spawnpoint message 2014-04-04 01:54:38 +02:00
cbf1f7a2e8 Fix /spawnpoint from console with no coordinate crash 2014-04-03 16:37:00 -05:00
c81266d1da Added /tp 2014-04-02 19:04:07 +02:00
8c4afcd21a Added /spawnpoint 2014-04-02 18:40:24 +02:00